Skip to content

Commit d6fc351

Browse files
committed
feat: batch client tool continuations
1 parent 5ab848f commit d6fc351

16 files changed

Lines changed: 875 additions & 111 deletions

apps/website/content/docs/chat/api/api-docs.json

Lines changed: 83 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6309,6 +6309,12 @@
63096309
"description": "",
63106310
"optional": false
63116311
},
6312+
{
6313+
"name": "followUp",
6314+
"type": "boolean",
6315+
"description": "",
6316+
"optional": true
6317+
},
63126318
{
63136319
"name": "handler",
63146320
"type": "(args: any, context: FunctionToolHandlerContext) => unknown",
@@ -6353,6 +6359,12 @@
63536359
"description": "",
63546360
"optional": false
63556361
},
6362+
{
6363+
"name": "followUp",
6364+
"type": "boolean",
6365+
"description": "",
6366+
"optional": true
6367+
},
63566368
{
63576369
"name": "kind",
63586370
"type": "\"ask\"",
@@ -6700,6 +6712,20 @@
67006712
],
67016713
"examples": []
67026714
},
6715+
{
6716+
"name": "ClientToolContinuationOptions",
6717+
"kind": "interface",
6718+
"description": "Execution policy options for browser-executed function tools.",
6719+
"properties": [
6720+
{
6721+
"name": "followUp",
6722+
"type": "boolean",
6723+
"description": "False when the tool result should be recorded without forcing a continuation.",
6724+
"optional": true
6725+
}
6726+
],
6727+
"examples": []
6728+
},
67036729
{
67046730
"name": "ClientToolExecutionGuard",
67056731
"kind": "interface",
@@ -6745,6 +6771,12 @@
67456771
"kind": "interface",
67466772
"description": "Execution policy options for browser-executed function tools.",
67476773
"properties": [
6774+
{
6775+
"name": "followUp",
6776+
"type": "boolean",
6777+
"description": "False when the tool result should be recorded without forcing a continuation.",
6778+
"optional": true
6779+
},
67486780
{
67496781
"name": "idempotent",
67506782
"type": "boolean",
@@ -6824,6 +6856,12 @@
68246856
"type": "ClientToolExecutionGuard",
68256857
"description": "",
68266858
"optional": true
6859+
},
6860+
{
6861+
"name": "settleToolCall",
6862+
"type": "(toolCall: ToolCall, result: ClientToolResult) => void",
6863+
"description": "",
6864+
"optional": true
68276865
}
68286866
],
68296867
"examples": []
@@ -6872,6 +6910,25 @@
68726910
"optional": false
68736911
}
68746912
]
6913+
},
6914+
{
6915+
"name": "settle",
6916+
"signature": "settle(toolCallId: string, result: ClientToolResult): void",
6917+
"description": "Record a client tool's result without continuing the run.",
6918+
"params": [
6919+
{
6920+
"name": "toolCallId",
6921+
"type": "string",
6922+
"description": "",
6923+
"optional": false
6924+
},
6925+
{
6926+
"name": "result",
6927+
"type": "ClientToolResult",
6928+
"description": "",
6929+
"optional": false
6930+
}
6931+
]
68756932
}
68766933
],
68776934
"examples": []
@@ -7114,6 +7171,12 @@
71147171
"description": "",
71157172
"optional": false
71167173
},
7174+
{
7175+
"name": "followUp",
7176+
"type": "boolean",
7177+
"description": "",
7178+
"optional": true
7179+
},
71177180
{
71187181
"name": "handler",
71197182
"type": "(args: StandardSchemaInferOutput<S>, context: FunctionToolHandlerContext) => R | Promise<R>",
@@ -8005,6 +8068,12 @@
80058068
"description": "",
80068069
"optional": false
80078070
},
8071+
{
8072+
"name": "followUp",
8073+
"type": "boolean",
8074+
"description": "",
8075+
"optional": true
8076+
},
80088077
{
80098078
"name": "kind",
80108079
"type": "\"view\"",
@@ -8350,7 +8419,7 @@
83508419
"name": "ask",
83518420
"kind": "function",
83528421
"description": "Interactive (human-in-the-loop) component tool — the model fills the\ncomponent's props from the schema's output; the value the component emits\nback to the framework becomes the tool result sent to the model.\n\nThe component's signal inputs are checked against the schema output type\n(strict-but-flexible: every schema key must be a declared input with an\nassignable type; the component may declare extra inputs the schema doesn't\nfill). Author the component with `ViewProps<typeof schema>` to derive input\nprop types directly from the schema.",
8353-
"signature": "ask(description: string, schema: S, component: AcceptComponent<S, C>): AskToolDef<S, C>",
8422+
"signature": "ask(description: string, schema: S, component: AcceptComponent<S, C>, options: ClientToolContinuationOptions): AskToolDef<S, C>",
83548423
"params": [
83558424
{
83568425
"name": "description",
@@ -8369,6 +8438,12 @@
83698438
"type": "AcceptComponent<S, C>",
83708439
"description": "Angular component whose signal inputs must be compatible with\n the schema output. A type-level error is reported here when they diverge.",
83718440
"optional": false
8441+
},
8442+
{
8443+
"name": "options",
8444+
"type": "ClientToolContinuationOptions",
8445+
"description": "",
8446+
"optional": true
83728447
}
83738448
],
83748449
"returns": {
@@ -9374,7 +9449,7 @@
93749449
"name": "view",
93759450
"kind": "function",
93769451
"description": "Render-only component tool — the model fills the component's props from the\nschema's output; the tool call is auto-acknowledged once the component mounts.\n\nThe component's signal inputs are checked against the schema output type\n(strict-but-flexible: every schema key must be a declared input with an\nassignable type; the component may declare extra inputs the schema doesn't fill).\nAuthor the component with `ViewProps<typeof schema>` as the input type set to\nguarantee the shapes stay aligned.",
9377-
"signature": "view(description: string, schema: S, component: AcceptComponent<S, C>): ViewToolDef<S, C>",
9452+
"signature": "view(description: string, schema: S, component: AcceptComponent<S, C>, options: ClientToolContinuationOptions): ViewToolDef<S, C>",
93789453
"params": [
93799454
{
93809455
"name": "description",
@@ -9393,6 +9468,12 @@
93939468
"type": "AcceptComponent<S, C>",
93949469
"description": "Angular component whose signal inputs must be compatible with\n the schema output. A type-level error is reported here when they diverge.",
93959470
"optional": false
9471+
},
9472+
{
9473+
"name": "options",
9474+
"type": "ClientToolContinuationOptions",
9475+
"description": "",
9476+
"optional": true
93969477
}
93979478
],
93989479
"returns": {

0 commit comments

Comments
 (0)