Skip to content

Commit 54866db

Browse files
committed
override the temperature in thinking mode (not supported)
1 parent 629c0b5 commit 54866db

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/src/providers/anthropic.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -930,6 +930,9 @@ impl AnthropicLLM {
930930
"type": thinking_type,
931931
"budget_tokens": thinking_budget_tokens,
932932
});
933+
// We can't pass a temperature different than 1.0 in thinking mode: https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking#important-considerations-when-using-extended-thinking
934+
// TODO(2025-03-18 aubin): we should surface this sooner
935+
body["temperature"] = 1.0f32.into();
933936
}
934937

935938
let url = self.messages_uri()?.to_string();

0 commit comments

Comments
 (0)