The ToolUsage class is encountering an AttributeError when parsing tool_input using ast.literal_eval.
The error message is: “AttributeError: ‘Name’ object has no attribute ‘value’ (in console i am gettingError: the Action Input is not a valid key, value dictionary.)”
The tool_input is a JSON-formatted string, which includes JSON-specific syntax such as double-quoted strings and lowercase booleans (true/false). The ast.literal_eval function expects Python literals and cannot parse JSON-formatted strings correctly. When it encounters JSON booleans like false, it treats them as names (identifiers), resulting in ast.Name nodes without a value attribute.
Example of Problematic Input: "{
“recipient_email”: “user@example.com”,
“subject”: “Meeting Scheduled”,
“body”: “Details of the meeting…”,
“user_id”: “me”,
“is_html”: false
}
"