The Python Anthropic provider prepares tools by iterating options[tools] directly. Core ChatOptions accepts either a single tool or a sequence of tools, so passing a single FunctionTool currently raises TypeError before the request is sent, while passing a single dict tool is treated as dictionary keys instead of one tool specification.
Repro summary:
- tools= -> TypeError: 'FunctionTool' object is not iterable
- tools= -> {'tools': ['type', 'name', 'description']}
- tools=[...] works as expected
Expected behavior:
The Anthropic provider should normalize the framework-level tools input before applying Anthropic-specific tool conversion, matching the behavior of other Python providers and core tool handling.
The Python Anthropic provider prepares tools by iterating options[tools] directly. Core ChatOptions accepts either a single tool or a sequence of tools, so passing a single FunctionTool currently raises TypeError before the request is sent, while passing a single dict tool is treated as dictionary keys instead of one tool specification.
Repro summary:
Expected behavior:
The Anthropic provider should normalize the framework-level tools input before applying Anthropic-specific tool conversion, matching the behavior of other Python providers and core tool handling.