From 9750592ee97bbcd318d921bdfdb88ec3e585cfe2 Mon Sep 17 00:00:00 2001 From: Mic Date: Mon, 8 Sep 2025 21:22:00 +0200 Subject: [PATCH] thinkingBudget added to google gemini. see #494 --- js/api/google_gemini.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/js/api/google_gemini.js b/js/api/google_gemini.js index bd2f24f9..2f46f8b1 100644 --- a/js/api/google_gemini.js +++ b/js/api/google_gemini.js @@ -24,17 +24,20 @@ export class GoogleGemini { model = ''; system_instruction = ''; stream = false; + thinkingBudget = 0; //Off constructor({ apiKey = '', model = '', system_instruction = '', - stream = false + stream = false, + thinkingBudget = 0 } = {}) { this.apiKey = apiKey; this.model = model; this.system_instruction = system_instruction; this.stream = stream; + this.thinkingBudget = thinkingBudget; } @@ -88,7 +91,12 @@ export class GoogleGemini { parts:{ text: this.system_instruction } - } + }; + google_gemini_body.generationConfig = { + thinkingConfig: { + thinkingBudget: this.thinkingBudget, + } + }; } // console.log("[ThunderAI] Google Gemini API request: " + JSON.stringify(google_gemini_body));