mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-18 01:26:37 +08:00
修复enable开启的逻辑
This commit is contained in:
parent
94f3223fd7
commit
cb4ee5e86a
@ -41,16 +41,16 @@ func (a *Adaptor) parseGeminiChatGenerationThinking(model string) (string, *gemi
|
|||||||
_modelName := parts[0]
|
_modelName := parts[0]
|
||||||
if len(parts) >= 2 {
|
if len(parts) >= 2 {
|
||||||
modelOptions, err := url.ParseQuery(parts[1])
|
modelOptions, err := url.ParseQuery(parts[1])
|
||||||
if err != nil && modelOptions != nil {
|
if err == nil && modelOptions != nil {
|
||||||
modelName = _modelName
|
modelName = _modelName
|
||||||
enableThinking := modelOptions.Has("thinking")
|
hasThinkingFlag := modelOptions.Has("thinking")
|
||||||
if enableThinking {
|
if hasThinkingFlag {
|
||||||
thinkingConfig.IncludeThoughts = true
|
thinkingConfig.IncludeThoughts = modelOptions.Get("thinking") == "1"
|
||||||
}
|
}
|
||||||
thinkingBudget := modelOptions.Get("thinking_budget")
|
thinkingBudget := modelOptions.Get("thinking_budget")
|
||||||
if thinkingBudget != "" {
|
if thinkingBudget != "" {
|
||||||
thinkingBudgetInt, err := strconv.Atoi(thinkingBudget)
|
thinkingBudgetInt, err := strconv.Atoi(thinkingBudget)
|
||||||
if err != nil {
|
if err == nil {
|
||||||
thinkingConfig.ThinkingBudget = thinkingBudgetInt
|
thinkingConfig.ThinkingBudget = thinkingBudgetInt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user