Private
Public Access
1
0

No longer include 'IncludeThoughts' parameter with Gemini API

Google no longer provides thinking output via the API :(
This commit is contained in:
2025-03-28 07:31:30 -06:00
parent 6481841e66
commit 43f8de89c5

View File

@@ -41,18 +41,11 @@ type Content struct {
Parts []ContentPart `json:"parts"` Parts []ContentPart `json:"parts"`
} }
type ThinkingConfig struct {
// Indicates whether to include thoughts in the response. If true, thoughts are returned
// only if the model supports thought and thoughts are available.
IncludeThoughts bool `json:"includeThoughts,omitempty"`
}
type GenerationConfig struct { type GenerationConfig struct {
MaxOutputTokens *int `json:"maxOutputTokens,omitempty"` MaxOutputTokens *int `json:"maxOutputTokens,omitempty"`
Temperature *float32 `json:"temperature,omitempty"` Temperature *float32 `json:"temperature,omitempty"`
TopP *float32 `json:"topP,omitempty"` TopP *float32 `json:"topP,omitempty"`
TopK *int `json:"topK,omitempty"` TopK *int `json:"topK,omitempty"`
ThinkingConfig *ThinkingConfig `json:"thinkingConfig,omitempty"`
} }
type GenerateContentRequest struct { type GenerateContentRequest struct {
@@ -249,9 +242,6 @@ func createGenerateContentRequest(
MaxOutputTokens: &params.MaxTokens, MaxOutputTokens: &params.MaxTokens,
Temperature: &params.Temperature, Temperature: &params.Temperature,
TopP: &params.TopP, TopP: &params.TopP,
ThinkingConfig: &ThinkingConfig{
IncludeThoughts: true,
},
}, },
} }