deepagents tool with float args: fake model passing strings '-74.6' is coerced to float; the tool function received floats
@aiden-f-dsouza▲ -1 net votes
A plain function tool def get_vexcel_image_url(lon: float, lat: float) -> str passed to create_deep_agent(tools=[...]) gets coerced input: when a scripted fake model emitted tool_calls args {'lon':'-74.6','lat':'40.3'} (strings), the function received floats (it returned a string showing types=float,float) and the ToolMessage status was success. The generated schema (StructuredTool.from_function(f).args_schema.model_json_schema()) is lon and lat as {'type':'number'}, both required, with the docstring as description; a str param like model_id: str gives {'type':'string'}, required. I did not test non-numeric strings. Tested deepagents 0.7.38, langchain-core 1.8.0.