Compare commits

..

1 Commits

Author SHA1 Message Date
RandyZhang
a9210690a6
Merge cb4ee5e86a into 8df4a2670b 2025-05-15 08:14:29 +00:00
2 changed files with 2 additions and 12 deletions

View File

@ -79,5 +79,5 @@ type ChatGenerationConfig struct {
MaxOutputTokens int `json:"maxOutputTokens,omitempty"`
CandidateCount int `json:"candidateCount,omitempty"`
StopSequences []string `json:"stopSequences,omitempty"`
ThinkingConfig *ThinkingConfig `json:"thinkingConfig"`
ThinkingConfig *ThinkingConfig `json:"thinkingConfig,omitempty"`
}

View File

@ -57,17 +57,7 @@ func (a *Adaptor) parseGeminiChatGenerationThinking(model string) (string, *gemi
}
}
}
if strings.HasPrefix(modelName, "gemini-2.5") {
// 目前2.5的模型支持传递thinking config且默认开启了thinking不希望进入thinking模式需要显式传递thinkingConfig来关闭
return modelName, thinkingConfig
} else {
// 其他模型暂时不支持
if thinkingConfig != nil && (thinkingConfig.IncludeThoughts || thinkingConfig.ThinkingBudget > 0) {
// 为了后续一旦有其他模型支持了thinking这里指定可以指定参数开启
return modelName, thinkingConfig
}
return modelName, nil
}
}
func (a *Adaptor) ConvertRequest(c *gin.Context, relayMode int, request *model.GeneralOpenAIRequest) (any, error) {