[Bug] AwsBedrock dict tool arguments raise AttributeError on strip
Author: MohammadHijjawi97Created Sep 17, 2026Updated Sep 17, 2026
Description
AwsBedrock request assembly calls arguments.strip() on tool-call arguments. Already-parsed dicts raise AttributeError and abort the Bedrock request. JSON null is handled by the truthiness check, but a dict is not.
Steps to Reproduce
from agno.models.aws.bedrock import AwsBedrock
from agno.models.message import Message
model = AwsBedrock(id="mistral.mistral-small-2402-v1:0", aws_region="us-east-1")
assistant = Message(
role="assistant",
content=None,
tool_calls=[{
"id": "tooluse_1",
"type": "function",
"function": {"name": "get_weather", "arguments": {"city": "London"}},
}],
)
model._format_messages([Message(role="user", content="hi"), assistant])Expected Behavior
A dict is used as the tool input. Empty or null arguments become {}. Request assembly succeeds.
Actual Behavior
AttributeError: 'dict' object has no attribute 'strip'
Environment
- OS: Windows 11
- Agno Version: current main
- Additional Environment Details: Python 3.13
Possible Solutions (optional)
Treat dict arguments as already parsed. Keep JSON strings. Treat None or blank strings as {}.
Source: agno-agi/agno