fix: Updating ToolCall.arguments to allow for json strings that can be decoded on client side#1685
Merged
hardikjshah merged 3 commits intollamastack:mainfrom Mar 19, 2025
Merged
Conversation
ashwinb
reviewed
Mar 19, 2025
| call_id: str | ||
| tool_name: Union[BuiltinTool, str] | ||
| arguments: Dict[str, RecursiveType] | ||
| arguments: Union[str, Dict[str, RecursiveType]] |
Contributor
There was a problem hiding this comment.
can you add a comment here explaining why there is a Union[str, ...] and how the deprecation process will happen?
Contributor
|
Generally looks good. Can you add an integration test case for this maybe? |
ashwinb
approved these changes
Mar 19, 2025
Contributor
yanxi0830
approved these changes
Mar 19, 2025
Contributor
Author
|
https://github.com/meta-llama/llama-stack-ops/actions/runs/13952670908 Ran the job with main branch of python client and worked fine |
franciscojavierarceo
pushed a commit
to franciscojavierarceo/llama-stack
that referenced
this pull request
Mar 22, 2025
… 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 ```
mattf
added a commit
to langchain-ai/langchain-llama-stack
that referenced
this pull request
Mar 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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