diff --git a/litellm/llms/bedrock/chat/invoke_agent/transformation.py b/litellm/llms/bedrock/chat/invoke_agent/transformation.py index 98fdc00e65..2c7135f4d8 100644 --- a/litellm/llms/bedrock/chat/invoke_agent/transformation.py +++ b/litellm/llms/bedrock/chat/invoke_agent/transformation.py @@ -401,8 +401,9 @@ class AmazonInvokeAgentConfig(BaseConfig, BaseAWSLLM): if not pre_processing: return - model_output: Optional[InvokeAgentModelInvocationOutput] = pre_processing.get( - "modelInvocationOutput" or InvokeAgentModelInvocationOutput() + model_output: Optional[InvokeAgentModelInvocationOutput] = ( + pre_processing.get("modelInvocationOutput") + or InvokeAgentModelInvocationOutput() ) if not model_output: return diff --git a/tests/test_litellm/log.txt b/tests/test_litellm/log.txt index 490bb10f88..6470b12fed 100644 --- a/tests/test_litellm/log.txt +++ b/tests/test_litellm/log.txt @@ -1,3 +1,2 @@ -llms/bedrock/chat/invoke_agent/transformation.py:404: error: Incompatible types in assignment (expression has type "InvokeAgentModelInvocationOutput | dict[Never, Never] | None", variable has type "InvokeAgentModelInvocationOutput | None") [assignment] -llms/bedrock/chat/invoke_agent/transformation.py:410: error: Incompatible types in assignment (expression has type "InvokeAgentMetadata | dict[Never, Never] | None", variable has type "InvokeAgentMetadata | None") [assignment] -Found 2 errors in 1 file (checked 1114 source files) \ No newline at end of file +llms/bedrock/chat/invoke_agent/transformation.py:404: error: Incompatible types in assignment (expression has type "object", variable has type "InvokeAgentModelInvocationOutput | None") [assignment] +llms/bedrock/chat/invoke_agent/transformation.py:405: error: Argument 1 to "get" of "Mapping" has incompatible type "str | InvokeAgentModelInvocationOutput"; expected "str" [typeddict-item]