Think currently automatically merges loaded extension tools into the top-level tool set:
const extensionTools = this.extensionManager?.getTools() ?? {}
In some applications, it would be useful to expose extension tools only inside execute / codemode instead of making them directly callable as top-level tools.
Example desired usage:
execute: createExecuteTool({
ctx: this.ctx,
tools: {
...domainTools,
...extensionManager.getTools(),
},
})
This makes dynamically loaded extensions behave more like a programmable plugin library: the model calls them through codemode when composing code, without expanding the top-level tool space for every turn.
Could Think provide an official way to control extension tool exposure, for example:
extensionToolExposure: "top-level" | "codemode" | "both" | "manual"
or a simpler opt-out:
exposeExtensionToolsAsTopLevel: false
The default could stay unchanged for compatibility.
Motivation:
- reduce top-level tool count
- prevent dynamic extensions from bloating the tool space
- encourage composing extension capabilities through code
- let applications decide where extension tools are exposed
Think currently automatically merges loaded extension tools into the top-level tool set:
In some applications, it would be useful to expose extension tools only inside
execute/ codemode instead of making them directly callable as top-level tools.Example desired usage:
This makes dynamically loaded extensions behave more like a programmable plugin library: the model calls them through codemode when composing code, without expanding the top-level tool space for every turn.
Could Think provide an official way to control extension tool exposure, for example:
or a simpler opt-out:
exposeExtensionToolsAsTopLevel: falseThe default could stay unchanged for compatibility.
Motivation: