-
Notifications
You must be signed in to change notification settings - Fork 497
Closed
Labels
Description
To optimize latency we are hooking up to streaming tool call parameter items from the model to frontload some processing (e.g. if tool arguments have an array we could process items from this array as they stream in). To correlate this processing back to tool call function invocation happening later we would need tool call id which is currently not exposed to tool call function.
Could we please expose call id as a third FunctionTool.invoke argument?
export type FunctionTool<
Context = UnknownContext,
TParameters extends ToolInputParameters = undefined,
Result = unknown,
> = {
...
/**
* The function to invoke when the tool is called.
*/
invoke: (
runContext: RunContext<Context>,
input: string,
callId: string,
) => Promise<string | Result>;
...
};
I am happy to draft a PR, but wanted to discuss first. Thanks!