Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 26 additions & 6 deletions apps/website/content/docs/chat/api/api-docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -6305,7 +6305,7 @@
},
{
"name": "handler",
"type": "(args: any) => unknown",
"type": "(args: any, context: FunctionToolHandlerContext) => unknown",
"description": "",
"optional": false
},
Expand Down Expand Up @@ -6976,7 +6976,7 @@
},
{
"name": "handler",
"type": "(args: StandardSchemaInferOutput<S>) => R | Promise<R>",
"type": "(args: StandardSchemaInferOutput<S>, context: FunctionToolHandlerContext) => R | Promise<R>",
"description": "",
"optional": false
},
Expand All @@ -6995,6 +6995,20 @@
],
"examples": []
},
{
"name": "FunctionToolHandlerContext",
"kind": "interface",
"description": "Runtime context passed to browser-executed function tool handlers.",
"properties": [
{
"name": "signal",
"type": "AbortSignal",
"description": "Aborts when the client tool execution should stop without resolving.",
"optional": false
}
],
"examples": []
},
{
"name": "Message",
"kind": "interface",
Expand Down Expand Up @@ -8144,7 +8158,7 @@
"name": "action",
"kind": "function",
"description": "Declare an async function tool the model can call; its resolved return value\nbecomes the tool result shipped back to the model.",
"signature": "action(description: string, schema: S, handler: (args: StandardSchemaInferOutput<S>) => R | Promise<R>): FunctionToolDef<S, R>",
"signature": "action(description: string, schema: S, handler: (args: StandardSchemaInferOutput<S>, context: FunctionToolHandlerContext) => R | Promise<R>): FunctionToolDef<S, R>",
"params": [
{
"name": "description",
Expand All @@ -8160,8 +8174,8 @@
},
{
"name": "handler",
"type": "(args: StandardSchemaInferOutput<S>) => R | Promise<R>",
"description": "Runs in the browser when the model calls the tool; its return\n type `R` is carried on the resulting FunctionToolDef.",
"type": "(args: StandardSchemaInferOutput<S>, context: FunctionToolHandlerContext) => R | Promise<R>",
"description": "Runs in the browser when the model calls the tool. The second\n argument carries an `AbortSignal`; its return type `R` is carried on the\n resulting FunctionToolDef.",
"optional": false
}
],
Expand Down Expand Up @@ -8500,7 +8514,7 @@
"name": "executeFunctionTool",
"kind": "function",
"description": "Validate args, run the handler, and normalize the outcome to a ClientToolResult.",
"signature": "executeFunctionTool(def: AnyFunctionToolDef, rawArgs: unknown): Promise<ClientToolResult>",
"signature": "executeFunctionTool(def: AnyFunctionToolDef, rawArgs: unknown, context: FunctionToolHandlerContext): Promise<ClientToolResult>",
"params": [
{
"name": "def",
Expand All @@ -8513,6 +8527,12 @@
"type": "unknown",
"description": "",
"optional": false
},
{
"name": "context",
"type": "FunctionToolHandlerContext",
"description": "",
"optional": true
}
],
"returns": {
Expand Down
Loading
Loading