Merge pull request #2742 from seefs001/fix/pr-2540

feat(gemini): 支持 tool_choice 参数转换,优化多个渠道错误处理
This commit is contained in:
Calcium-Ion
2026-01-26 15:12:09 +08:00
committed by GitHub
10 changed files with 247 additions and 32 deletions
+7
View File
@@ -229,6 +229,13 @@ func OpenaiHandler(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Respo
return nil, types.WithOpenAIError(*oaiError, resp.StatusCode)
}
for _, choice := range simpleResponse.Choices {
if choice.FinishReason == constant.FinishReasonContentFilter {
common.SetContextKey(c, constant.ContextKeyAdminRejectReason, "openai_finish_reason=content_filter")
break
}
}
forceFormat := false
if info.ChannelSetting.ForceFormat {
forceFormat = true