Enable thinking stream in frontend lib/ai/gemini-chat.ts
This commit is contained in:
@@ -124,6 +124,13 @@ 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;
|
||||
}
|
||||
@@ -259,6 +266,13 @@ 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user