Enable Gemini thinking stream
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user