Enable Gemini thinking stream

This commit is contained in:
2026-06-15 11:37:29 -07:00
parent b3ec779058
commit e58972d594
5 changed files with 72 additions and 17 deletions

View File

@@ -114,6 +114,12 @@ export async function callGeminiChat(opts: {
maxOutputTokens: 8192,
};
if (GEMINI_MODEL.includes("thinking") || GEMINI_MODEL.includes("pro")) {
config.thinkingConfig = {
thinkingBudget: 1024, includeThoughts: true
};
}
if (opts.systemPrompt) {
config.systemInstruction = opts.systemPrompt;
}
@@ -197,6 +203,12 @@ export async function* streamGeminiChat(opts: {
maxOutputTokens: 8192,
};
if (GEMINI_MODEL.includes("thinking") || GEMINI_MODEL.includes("pro")) {
config.thinkingConfig = {
thinkingBudget: 1024, includeThoughts: true
};
}
if (opts.systemPrompt) {
config.systemInstruction = opts.systemPrompt;
}