mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-17 09:16:36 +08:00
Compare commits
2 Commits
a9210690a6
...
590a5fa2d5
Author | SHA1 | Date | |
---|---|---|---|
|
590a5fa2d5 | ||
|
703859214b |
@ -79,5 +79,5 @@ type ChatGenerationConfig struct {
|
|||||||
MaxOutputTokens int `json:"maxOutputTokens,omitempty"`
|
MaxOutputTokens int `json:"maxOutputTokens,omitempty"`
|
||||||
CandidateCount int `json:"candidateCount,omitempty"`
|
CandidateCount int `json:"candidateCount,omitempty"`
|
||||||
StopSequences []string `json:"stopSequences,omitempty"`
|
StopSequences []string `json:"stopSequences,omitempty"`
|
||||||
ThinkingConfig *ThinkingConfig `json:"thinkingConfig,omitempty"`
|
ThinkingConfig *ThinkingConfig `json:"thinkingConfig"`
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,17 @@ 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
|
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) {
|
func (a *Adaptor) ConvertRequest(c *gin.Context, relayMode int, request *model.GeneralOpenAIRequest) (any, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user