When registering and executing tools, I often see boilerplate code that requires an extra call to getTools().
await document.modelContext.registerTool({
name: "tool",
description: "A tool",
execute: () => {},
});
const [tool] = await document.modelContext.getTools();
await document.modelContext.executeTool(tool, "{}");
Could we simplify this workflow by having registerTool() return the registered tool object directly? That way, we can pass it straight into executeTool() without the extra lookup step (which is not required by the way).
const tool = await document.modelContext.registerTool({
name: "tool",
description: "A tool",
execute: () => {},
});
await document.modelContext.executeTool(tool, "{}");
When registering and executing tools, I often see boilerplate code that requires an extra call to
getTools().Could we simplify this workflow by having
registerTool()return the registered tool object directly? That way, we can pass it straight intoexecuteTool()without the extra lookup step (which is not required by the way).