You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/proposal.md
+21-18Lines changed: 21 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,27 +54,30 @@ Handling tool calls in the main thread with the option of delegating to workers
54
54
### modelContext
55
55
The `window.navigator.modelContext` interface is introduced for the site to declare functionality that can be used by an AI Agent. Access to these tools is arbitrated by the browser.
56
56
57
-
The `modelContext`'s `registerTool()`and `unregisterTool()` methods are used to add and remove tools from the agent's context.
57
+
The `modelContext`'s `registerTool()`method is used to add and remove tools from the agent's context.
58
58
59
59
```js
60
-
window.navigator.modelContext.registerTool({
61
-
execute:
62
-
({ text }, agent) => {
63
-
// Add todo item and update UI.
64
-
return/* structured content response */
65
-
},
66
-
name:"add-todo",
67
-
description:"Add a new todo item to the list",
68
-
inputSchema: {
69
-
type:"object",
70
-
properties: {
71
-
text: { type:"string", description:"The text of the todo item" }
72
-
},
73
-
required: ["text"]
74
-
},
75
-
});
60
+
constaddTodoTool= {
61
+
execute: ({ text }, agent) => {
62
+
// Add todo item and update UI.
63
+
return/* structured content response */
64
+
},
65
+
name:"add-todo",
66
+
description:"Add a new todo item to the list",
67
+
inputSchema: {
68
+
type:"object",
69
+
properties: {
70
+
text: { type:"string", description:"The text of the todo item" }
0 commit comments