Allow function argument to be excluded from the tool's JSON schema #574
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.
Add
client_provided_arg_model
toFuncMetadata
to allow certain arguments to be excluded from the JSON schema. This creates a cleaner interface for LLMs while still providing the necessary context at execution time.Motivation and Context
With the current implementation, all function arguments are included in the JSON schema when
list_tools
is called, which prompts the LLM to provide values for all arguments when calling the tool. This can be limiting in scenarios where some arguments are intended to be provided by the client at execution time rather than being part of the LLM’s input. For example, if a tool requires a customer ID or session token the LLM should not be prompted to provide these values.This solves #375
How Has This Been Tested?
Unit tests have been added to verify the changes are working.
Breaking Changes
Types of changes
Checklist
Additional context