Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Claude Sonnet 3.7 as a reasoning tool #11445

Merged
merged 41 commits into from
Mar 19, 2025
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
89454ac
add 3.7 sonnet as a reasoning model behind a FF
aubin-tchoi Mar 18, 2025
886931f
add Anthropic beta reasoning when a reasoning tool is available
aubin-tchoi Mar 18, 2025
d0668af
correctly remove the reasoning tool for claude 3.7 sonnet
aubin-tchoi Mar 18, 2025
2db9904
add a function actionIsClaudeReasoning
aubin-tchoi Mar 18, 2025
01fc2a5
fix passing extra parameters
aubin-tchoi Mar 18, 2025
aba7aac
rename the feature flag to remove the dot
aubin-tchoi Mar 18, 2025
b12d848
fix types
aubin-tchoi Mar 18, 2025
316367c
add thinking to the extras
aubin-tchoi Mar 18, 2025
bd5b92a
pass thinking in the api call to anthropic
aubin-tchoi Mar 18, 2025
629c0b5
fix var name
aubin-tchoi Mar 18, 2025
54866db
override the temperature in thinking mode (not supported)
aubin-tchoi Mar 18, 2025
c658c51
remove the top_p too
aubin-tchoi Mar 18, 2025
e9a7671
add two missing variants to the enum StreamContent (new blocks)
aubin-tchoi Mar 18, 2025
21fa03a
add missing signature block
aubin-tchoi Mar 18, 2025
cc04550
fix thinking delta handling (it's actually a != struct bc the field i…
aubin-tchoi Mar 18, 2025
36af0ea
fix handling of the thinking deltas
aubin-tchoi Mar 18, 2025
9444d30
fix field name
aubin-tchoi Mar 18, 2025
2a1ea5f
reduce the budget_token count
aubin-tchoi Mar 18, 2025
0a354af
handle SignatureDelta
aubin-tchoi Mar 18, 2025
0e5070f
fix handling of AnthropicStreamRedactedThinking
aubin-tchoi Mar 18, 2025
0e74eba
remove unneeded TODO
aubin-tchoi Mar 18, 2025
13592c2
fix how reasoning tokens are passed to the context
aubin-tchoi Mar 18, 2025
c20f00f
remove info log
aubin-tchoi Mar 18, 2025
0352ccf
fix handling of redacted thinking in deltas
aubin-tchoi Mar 18, 2025
962aff3
add parsing from ChatMessageConversionInput to Anthropic message
aubin-tchoi Mar 18, 2025
6109159
fix changes in AssistantChatMessage
aubin-tchoi Mar 18, 2025
1b83058
fix parsing in the response sent from core
aubin-tchoi Mar 18, 2025
c1696c1
fix rendering of CoTs
aubin-tchoi Mar 18, 2025
c15694b
fix a content type
aubin-tchoi Mar 18, 2025
8150dfd
remove debug log
aubin-tchoi Mar 18, 2025
982c6ed
fix tool use
aubin-tchoi Mar 18, 2025
de91256
increase the budget token to 12k
aubin-tchoi Mar 18, 2025
521cb12
reduce the token budget
aubin-tchoi Mar 19, 2025
18a9874
remove the thinking and redacted_thinking fields from AssistantChatMe…
aubin-tchoi Mar 19, 2025
1807eff
stop reading the resoning_content
aubin-tchoi Mar 19, 2025
154fd60
remove the thinking content from the AssistantChatMessage
aubin-tchoi Mar 19, 2025
2e1e17e
pass the extra thinking parameters when used as a reasoning tool, rem…
aubin-tchoi Mar 19, 2025
f505d4b
add back the removal of the top_p parameter
aubin-tchoi Mar 19, 2025
ea7ac26
fix a typo
aubin-tchoi Mar 19, 2025
acb2a79
remove unused function
aubin-tchoi Mar 19, 2025
2ef750c
remove the top_p in reasoning mode
aubin-tchoi Mar 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove the top_p too
aubin-tchoi committed Mar 18, 2025
commit c658c511caf863f7fcf2538660b739ec1b2c3e0c
1 change: 1 addition & 0 deletions core/src/providers/anthropic.rs
Original file line number Diff line number Diff line change
@@ -933,6 +933,7 @@ impl AnthropicLLM {
// 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
// TODO(2025-03-18 aubin): we should surface this sooner
body["temperature"] = 1.0f32.into();
body.as_object_mut().unwrap().remove("top_p");
}

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