fix(ai): completely remove thinkingConfig from Gemini payload to prevent 400 errors
This commit is contained in:
@@ -113,9 +113,7 @@ export async function callGeminiChat(opts: {
|
||||
config.systemInstruction = opts.systemPrompt;
|
||||
}
|
||||
|
||||
if (opts.includeThoughts) {
|
||||
config.thinkingConfig = { thinkingBudget: 1024 };
|
||||
}
|
||||
|
||||
|
||||
const fns = toGeminiFunctions(opts.tools ?? []);
|
||||
if (fns) config.tools = fns;
|
||||
@@ -174,7 +172,7 @@ export async function* streamGeminiChat(opts: {
|
||||
const config: any = {
|
||||
temperature: opts.temperature ?? 0.7,
|
||||
maxOutputTokens: 8192,
|
||||
thinkingConfig: { thinkingBudget: 1024 },
|
||||
|
||||
};
|
||||
|
||||
if (opts.systemPrompt) {
|
||||
|
||||
@@ -86,11 +86,7 @@ export class GeminiLlmClient implements LlmClient {
|
||||
config.systemInstruction = `${args.systemPrompt}\n\nIMPERATIVE: Respond ONLY with this exact JSON format:\n${JSON.stringify(exampleJson)}\n\nDo NOT add any other fields.`;
|
||||
}
|
||||
|
||||
if (args.thinking_config) {
|
||||
config.thinkingConfig = {
|
||||
thinkingBudget: 1024,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
const run = async (currentContents: any[]) => {
|
||||
console.log(`[GoogleGenAI] generateContent with ${this.model}`);
|
||||
|
||||
Reference in New Issue
Block a user