From f9de88f930e590f61605c6c6439061bfa6c3c8c1 Mon Sep 17 00:00:00 2001 From: Navnit Shukla Date: Mon, 8 Jun 2026 14:34:23 -0700 Subject: [PATCH] fix: resolve mypy type errors in anthropic transformation --- litellm/llms/snowflake/anthropic/transformation.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/litellm/llms/snowflake/anthropic/transformation.py b/litellm/llms/snowflake/anthropic/transformation.py index 58b1626ea3e..64bf607760d 100644 --- a/litellm/llms/snowflake/anthropic/transformation.py +++ b/litellm/llms/snowflake/anthropic/transformation.py @@ -171,7 +171,7 @@ class SnowflakeCortexAnthropicConfig(SnowflakeBaseConfig): for msg in messages: if isinstance(msg, dict): role = msg.get("role", "") - content = msg.get("content", "") + content: Any = msg.get("content", "") else: role = getattr(msg, "role", "") content = getattr(msg, "content", "") @@ -184,11 +184,11 @@ class SnowflakeCortexAnthropicConfig(SnowflakeBaseConfig): if isinstance(msg, dict) else getattr(msg, "tool_calls", None) ) - if tool_calls: + if tool_calls: # type: ignore[truthy-bool] content_blocks: List[Dict[str, Any]] = [] if content: content_blocks.append({"type": "text", "text": content}) - for tc in tool_calls: + for tc in tool_calls: # type: ignore[union-attr] func = ( tc.get("function", {}) if isinstance(tc, dict) @@ -385,7 +385,7 @@ class SnowflakeCortexAnthropicConfig(SnowflakeBaseConfig): ) model_response.choices = [choice] - model_response.usage = usage + model_response.usage = usage # type: ignore[assignment] model_response.model = "snowflake/" + response_json.get("model", model) model_response.id = response_json.get("id", "")