fix: incorrect spelling caused Gemini endpoint’s thinking budget to fail (#11217)

This commit is contained in:
Konjac-XZ 2025-11-10 16:42:34 +08:00 committed by GitHub
parent 5e0a66fa1f
commit e2c8edab61
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -418,6 +418,8 @@ export function getAnthropicReasoningParams(assistant: Assistant, model: Model):
/**
* Gemini
* GeminiAPIClient
* Gemini/GCP 使 thinkingBudget
* Google OpenAI 使 thinking_budget
*/
export function getGeminiReasoningParams(assistant: Assistant, model: Model): Record<string, any> {
if (!isReasoningModel(model)) {
@ -431,8 +433,8 @@ export function getGeminiReasoningParams(assistant: Assistant, model: Model): Re
if (reasoningEffort === undefined) {
return {
thinkingConfig: {
include_thoughts: false,
...(GEMINI_FLASH_MODEL_REGEX.test(model.id) ? { thinking_budget: 0 } : {})
includeThoughts: false,
...(GEMINI_FLASH_MODEL_REGEX.test(model.id) ? { thinkingBudget: 0 } : {})
}
}
}
@ -442,7 +444,7 @@ export function getGeminiReasoningParams(assistant: Assistant, model: Model): Re
if (effortRatio > 1) {
return {
thinkingConfig: {
include_thoughts: true
includeThoughts: true
}
}
}
@ -452,8 +454,8 @@ export function getGeminiReasoningParams(assistant: Assistant, model: Model): Re
return {
thinkingConfig: {
...(budget > 0 ? { thinking_budget: budget } : {}),
include_thoughts: true
...(budget > 0 ? { thinkingBudget: budget } : {}),
includeThoughts: true
}
}
}