Enable thinking stream in frontend lib/ai/gemini-chat.ts

This commit is contained in:
2026-06-15 11:46:20 -07:00
parent e58972d594
commit dfb79f3acd

View File

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