Commit f4f73016 by CaIon

fix: improve error handling and readability in ability.go

parent fad5fc3f
......@@ -301,7 +301,7 @@ func FixAbility() (int, int, error) {
}
var channels []*Channel
// Find all channels
err = DB.Model(&Channel{}).Find(&channels).Error
err := DB.Model(&Channel{}).Find(&channels).Error
if err != nil {
return 0, 0, err
}
......
......@@ -80,7 +80,11 @@ func getGeminiInputTokens(req *dto.GeminiChatRequest, info *relaycommon.RelayInf
func isNoThinkingRequest(req *dto.GeminiChatRequest) bool {
if req.GenerationConfig.ThinkingConfig != nil && req.GenerationConfig.ThinkingConfig.ThinkingBudget != nil {
return *req.GenerationConfig.ThinkingConfig.ThinkingBudget == 0
configBudget := req.GenerationConfig.ThinkingConfig.ThinkingBudget
if configBudget != nil && *configBudget == 0 {
// 如果思考预算为 0,则认为是非思考请求
return true
}
}
return false
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment