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