-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: Updating ToolCall.arguments to allow for json strings that can be decoded on client side
#1685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| call_id: str | ||
| tool_name: Union[BuiltinTool, str] | ||
| arguments: Dict[str, RecursiveType] | ||
| arguments: Union[str, Dict[str, RecursiveType]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a comment here explaining why there is a Union[str, ...] and how the deprecation process will happen?
|
Generally looks good. Can you add an integration test case for this maybe? |
|
https://github.com/meta-llama/llama-stack-ops/actions/runs/13952670908 Ran the job with main branch of python client and worked fine |
… be decoded on client side (llamastack#1685) ### What does this PR do? Currently, `ToolCall.arguments` is a `Dict[str, RecursiveType]`. However, on the client SDK side -- the `RecursiveType` gets deserialized into a number ( both int and float get collapsed ) and hence when params are `int` they get converted to float which might break client side tools that might be doing type checking. Closes: https://github.com/meta-llama/llama-stack/issues/1683 ### Test Plan Stainless changes -- llamastack/llama-stack-client-python#204 ``` pytest -s -v --stack-config=fireworks tests/integration/agents/test_agents.py --text-model meta-llama/Llama-3.1-8B-Instruct ```

What does this PR do?
Currently,
ToolCall.argumentsis aDict[str, RecursiveType]. However, on the client SDK side -- theRecursiveTypegets deserialized into a number ( both int and float get collapsed ) and hence when params areintthey get converted to float which might break client side tools that might be doing type checking.Closes: https://github.com/meta-llama/llama-stack/issues/1683
Test Plan
Stainless changes -- llamastack/llama-stack-client-python#204