diff --git a/litellm/llms/anthropic/experimental_pass_through/adapters/transformation.py b/litellm/llms/anthropic/experimental_pass_through/adapters/transformation.py index fa99aa1bac3..5dd1b3c0bc6 100644 --- a/litellm/llms/anthropic/experimental_pass_through/adapters/transformation.py +++ b/litellm/llms/anthropic/experimental_pass_through/adapters/transformation.py @@ -1404,8 +1404,8 @@ class LiteLLMAnthropicMessagesAdapter: @staticmethod def _positive_int(value: object) -> int: - if isinstance(value, int) and value > 0: - return value + if isinstance(value, (int, float)) and not isinstance(value, bool) and value > 0: + return int(value) return 0 @classmethod