Browse Source

fix: ali parameter.enable_thinking must be set to false for non-streaming calls

skynono 9 months ago
parent
commit
368fd75c86
1 changed files with 6 additions and 0 deletions
  1. 6 0
      relay/channel/ali/adaptor.go

+ 6 - 0
relay/channel/ali/adaptor.go

@@ -57,6 +57,12 @@ func (a *Adaptor) ConvertOpenAIRequest(c *gin.Context, info *relaycommon.RelayIn
 	if request == nil {
 		return nil, errors.New("request is nil")
 	}
+
+	// fix: ali parameter.enable_thinking must be set to false for non-streaming calls
+	if !info.IsStream {
+		request.EnableThinking = false
+	}
+
 	switch info.RelayMode {
 	default:
 		aliReq := requestOpenAI2Ali(*request)