-
Notifications
You must be signed in to change notification settings - Fork 2.7k
docs: add ToolContext section for advanced tool metadata #1868
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
base: main
Are you sure you want to change the base?
Conversation
`ToolContext` provides the same `.context` property as `RunContextWrapper`, | ||
plus additional fields specific to the current tool call: | ||
|
||
- `tool_name` – the name of the tool being invoked |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
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.
Thanks for reviewing! Please let me know if there’s anything you’d like me to adjust or clarify.
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.
Thanks for reviewing! Please let me know if there’s anything you’d like me to adjust or clarify.
Updated the example to use WeatherContext and typed parameters as suggested. Thanks for the helpful feedback! |
Summary
Added a short section in
context.md
explaining how to useToolContext
, which extendsRunContextWrapper
and gives access to tool metadata such astool_name
,tool_call_id
, andtool_arguments
.Why
This helps developers understand when to use
ToolContext
for advanced cases, without replacing the existingRunContextWrapper
examples.Changes
Notes
This PR updates only the documentation. No code or API changes were made.
Thanks for reviewing!