Function: toolSearch()
toolSearch(
options):Promise<ToolSearchPlan>
Defined in: packages/core/src/tools/tool-search.ts:229
Build the tool presentation for one request.
Parameters
options
ToolSearchOptions & object
Returns
Promise<ToolSearchPlan>
Example
const plan = await toolSearch({ tools, model, alwaysActive: ['ask_user'] });
const bot = new Baleybot({ name, goal, model, tools: plan.tools });
await bot.process(input, { prepareStep: plan.prepareStep });
Baleybot does this itself when given toolSearch options, and keeps the
plan in step with its skills: active skills' tools load from the first step,
a skill loaded mid-call loads its tools on the next step (activate), and an
unloaded skill's tools return to on-demand loading (deactivate).
Standalone, call activate yourself and pass plan.references to the
transport (Baleybot passes it to its AI SDK stream).