fix: scope reasoning_effort=none to OpenAI provider only (Xiaomi rejects 'none')
This commit is contained in:
@@ -191,7 +191,6 @@ func BuildOpenAIBody(request *models.UnifiedRequest, messagesJSON []interface{},
|
||||
}
|
||||
}
|
||||
body["tools"] = sanitizedTools
|
||||
body["reasoning_effort"] = "none" // pontytail: OpenAI reasoning models reject tools + reasoning_effort
|
||||
}
|
||||
if request.ToolChoice != nil {
|
||||
var toolChoice interface{}
|
||||
|
||||
@@ -57,6 +57,9 @@ func (p *OpenAIProvider) ChatCompletion(ctx context.Context, req *models.Unified
|
||||
delete(body, "max_tokens")
|
||||
body["max_completion_tokens"] = maxTokens
|
||||
}
|
||||
if len(req.Tools) > 0 {
|
||||
body["reasoning_effort"] = "none"
|
||||
}
|
||||
}
|
||||
|
||||
resp, err := p.client.R().
|
||||
@@ -169,6 +172,9 @@ func (p *OpenAIProvider) ChatCompletionStream(ctx context.Context, req *models.U
|
||||
delete(body, "max_tokens")
|
||||
body["max_completion_tokens"] = maxTokens
|
||||
}
|
||||
if len(req.Tools) > 0 {
|
||||
body["reasoning_effort"] = "none"
|
||||
}
|
||||
}
|
||||
|
||||
resp, err := p.client.R().
|
||||
|
||||
Reference in New Issue
Block a user