Support sending any variable to a tool's execute
function.
#3938
Labels
enhancement
New feature or request
execute
function.
#3938
Feature Description
Similar to #3468
When working on agents or tools that require retrieving, saving, or working with a session, you might need to use dynamic IDs or data that were sent with the original API call but not included as an option or argument on the tool call. It would be great if you can extend
ToolExecutionOptions
and send in your own variables to be used when thetool.execute
function is running.To keep it type safe, you can define a type for the variables you're going to send and add the type as a generic type parameter. So an example might look like:
Then in the API route, you could send in the dynamic data with the tools
This is a pretty basic example, a feature like this would be more useful for agentic workloads where your agents need access to dynamic data, like
chatId
oruserId
for example.Use Cases
No response
Additional context
There is a workaround where you have a function that takes the dynamic data as arguments which then creates the tool. It's doable but becomes harder to manage as your toolset grows.
The text was updated successfully, but these errors were encountered: