Repository navigation
Introduce generic tool calling explainer - #375
Open
domfarolino wants to merge 1 commit into
Open
domfarolino wants to merge 1 commit into
domfarolino wants to merge 1 commit into
Conversation
| ```js | ||
| window.tools.register({ | ||
| name: "set-profile-picture", | ||
| model: { |
Collaborator
There was a problem hiding this comment.
Suggested change
| model: { | |
| naturalLanguageProperties: { |
| ``` | ||
|
|
||
| The inclusion of `naturalLanguageProperties` directs the browser and other web consumers to expose | ||
| the tool to native or external agents via whatever native mechanism or protocol, while `exposedTo` |
Collaborator
There was a problem hiding this comment.
It's not clear if exposedTo behavior is changing from what we currently in WebMCP spec.
| Specifically, since DOMException and the native JavaScript `Error` types are both "serializable", | ||
| their standardized JSON lowering can include all of the relevant information that the error object | ||
| contains, packaged up into an appropriate JSON representation derived from the serialization. The | ||
| serialization will exclude any internal details (like stack traces). |
Collaborator
There was a problem hiding this comment.
Is it important to distinguish following cases?
await document.modelContext.registerTool({
name: 'fake_operation_error',
description: 'desc',
execute: () => { throw new DOMException('Schema validation failed', 'OperationError') }
});
const [tool] = await document.modelContext.getTools();
await document.modelContext.executeTool(tool);
// throws with a fake OperationError: Schema validation failedvs
await document.modelContext.registerTool({
name: 'true_operation_error',
description: 'desc',
execute: () => { result: 'string instead of number' } ,
outputSchema: {
type: 'object',
properties: { result: { type: "number" }, }
}
});
const [tool] = await document.modelContext.getTools();
await document.modelContext.executeTool(tool);
// throws with a real OperationError: Schema validation failedIf so, we may want to introduce a ToolExecutionError returned by executeTool().
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This proposal includes three concrete API changes to satisfy great feedback from Mozilla, largely captured in #236 and #237.
Please take a look @jakearchibald, @martinthomson, @bvandersloot-mozilla.