@ssweens/pi-handoff 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/extensions/handoff.ts
CHANGED
|
@@ -188,7 +188,9 @@ async function generateHandoffPrompt(
|
|
|
188
188
|
loader.onAbort = () => done(null);
|
|
189
189
|
|
|
190
190
|
const run = async () => {
|
|
191
|
-
const
|
|
191
|
+
const auth = await ctx.modelRegistry.getApiKeyAndHeaders(ctx.model!);
|
|
192
|
+
if (!auth.ok) throw new Error(auth.error);
|
|
193
|
+
const apiKey = auth.apiKey;
|
|
192
194
|
|
|
193
195
|
const userMessage: Message = {
|
|
194
196
|
role: "user",
|
|
@@ -171,7 +171,9 @@ export default function (pi: ExtensionAPI) {
|
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
try {
|
|
174
|
-
const
|
|
174
|
+
const auth = await ctx.modelRegistry.getApiKeyAndHeaders(ctx.model);
|
|
175
|
+
if (!auth.ok) return errorResult(`Auth error: ${auth.error}`);
|
|
176
|
+
const apiKey = auth.apiKey;
|
|
175
177
|
|
|
176
178
|
const userMessage: Message = {
|
|
177
179
|
role: "user",
|