From 77136f9f354103f54b1efced747c5782df1fc1e1 Mon Sep 17 00:00:00 2001 From: Vince Mi Date: Thu, 31 Jul 2025 16:27:25 -0700 Subject: [PATCH] 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'}} ``` --- src/strands/models/anthropic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/strands/models/anthropic.py b/src/strands/models/anthropic.py index 975fca3e9..29cb40d40 100644 --- a/src/strands/models/anthropic.py +++ b/src/strands/models/anthropic.py @@ -55,7 +55,7 @@ class AnthropicConfig(TypedDict, total=False): For a complete list of supported parameters, see https://docs.anthropic.com/en/api/messages. """ - max_tokens: Required[str] + max_tokens: Required[int] model_id: Required[str] params: Optional[dict[str, Any]]