-
Notifications
You must be signed in to change notification settings - Fork 16.9k
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
anthropic[patch]: support claude 3.7 sonnet #29971
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tangential but ooc what happens if you send thinking block without the signature?
if ( | ||
isinstance(block, dict) | ||
and block.get("type") == "thinking" | ||
and "text" in block |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't "thinking" the key in a type: thinking block?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
model_dumping the content generates a key {"text": None}
, so I remove it here.
BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'messages.1.content.0.thinking.signature: Field required'}} |
we should follow up with reasoning token counts if their api exposes those (guessing it does) |
I'm not seeing these carved out in the response: import anthropic
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-3-7-sonnet-latest",
max_tokens=5000,
thinking={
"type": "enabled",
"budget_tokens": 2000,
},
messages=[{
"role": "user",
"content": "Hello",
}]
)
response.usage
|
yea doesn't seem updated yet https://github.com/anthropics/anthropic-sdk-python/blob/main/src/anthropic/types/usage.py |
No description provided.