update pi

This commit is contained in:
2026-03-27 09:22:40 +00:00
parent d5b4042b06
commit 39e7bddb35
12 changed files with 82 additions and 65 deletions
+3 -2
View File
@@ -80,7 +80,8 @@ export default function (pi: ExtensionAPI) {
loader.onAbort = () => done(null);
const doGenerate = async () => {
const apiKey = await ctx.modelRegistry.getApiKey(ctx.model!);
const auth = await ctx.modelRegistry.getApiKeyAndHeaders(ctx.model!);
if (!auth.ok) throw new Error(auth.error);
const userMessage: Message = {
role: "user",
@@ -96,7 +97,7 @@ export default function (pi: ExtensionAPI) {
const response = await complete(
ctx.model!,
{ systemPrompt: SYSTEM_PROMPT, messages: [userMessage] },
{ apiKey, signal: loader.signal },
{ apiKey: auth.apiKey, headers: auth.headers, signal: loader.signal },
);
if (response.stopReason === "aborted") {