Commit 2559e2f1 authored by Your Name's avatar Your Name

fix: Skip temperature 0.0 for Claude API to avoid thinking conflict

- Claude API requires temperature: 1.0 when thinking is enabled
- Our Anthropic-Beta header includes interleaved-thinking-2025-05-14
- Sending temperature: 0.0 with thinking beta causes API errors
- Now only add temperature to payload if > 0
parent e33c263b
......@@ -3247,8 +3247,10 @@ class ClaudeProviderHandler(BaseProviderHandler):
'max_tokens': max_tokens or 4096,
}
# Only add temperature if not None
if temperature is not None:
# Only add temperature if not None and not 0.0
# Claude API requires temperature: 1.0 when thinking is enabled (interleaved-thinking beta)
# Sending temperature: 0.0 with thinking beta causes API errors
if temperature is not None and temperature > 0:
payload['temperature'] = temperature
if system_message:
......
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 to comment