thinkingBudget renamed to thinking_budget. see #494

This commit is contained in:
Mic 2025-09-08 22:00:00 +02:00
parent 9d34ef2cf7
commit 2b794690d8

View file

@ -24,25 +24,25 @@ export class GoogleGemini {
model = '';
system_instruction = '';
stream = false;
thinkingBudget = ''; // Model default
thinking_budget = ''; // Model default
constructor({
apiKey = '',
model = '',
system_instruction = '',
stream = false,
thinkingBudget = '',
thinking_budget = '',
} = {}) {
this.apiKey = apiKey;
this.model = model;
this.system_instruction = system_instruction;
this.stream = stream;
this.thinkingBudget = thinkingBudget.trim();
this.thinking_budget = thinking_budget.trim();
/* Info from: https://ai.google.dev/gemini-api/docs/thinking?#set-budget
# Turn on thinking with a specific token limit: "thinkingBudget": 1024
# Thinking off: "thinkingBudget": 0
# Turn on dynamic thinking: "thinkingBudget": -1
# Keep model default thinking: "thinkingBudget": ""
# Turn on thinking with a specific token limit: "thinking_budget": 1024
# Thinking off: "thinking_budget": 0
# Turn on dynamic thinking: "thinking_budget": -1
# Keep model default thinking: "thinking_budget": ""
*/
}
@ -100,10 +100,10 @@ export class GoogleGemini {
};
}
if(this.thinkingBudget !== '') {
if(this.thinking_budget !== '') {
google_gemini_body.generationConfig = {
thinkingConfig: {
thinkingBudget: this.thinkingBudget,
thinking_budget: this.thinking_budget,
}
};
}