Skip to content

Commit 77136f9

Browse files
committed
Change max_tokens type to int to match Anthropic API
Using a string causes the Anthropic API call to fail: ``` anthropic.BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'max_tokens: Input should be a valid integer'}} ```
1 parent c85464c commit 77136f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/strands/models/anthropic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class AnthropicConfig(TypedDict, total=False):
5555
For a complete list of supported parameters, see https://docs.anthropic.com/en/api/messages.
5656
"""
5757

58-
max_tokens: Required[str]
58+
max_tokens: Required[int]
5959
model_id: Required[str]
6060
params: Optional[dict[str, Any]]
6161

0 commit comments

Comments
 (0)