Expand description
The tool_search tool: a BM25 ranker over the metadata of tools that are
not declared to the model (codemode and deferred exposure), which
activates the matches for the next model call. Port of
extensions/tool-search in pi v1.0.0.
Structs§
- Tool
Search - The
tool_searchtool over a session’s tools. - Tool
Search Extension - The built-in extension that registers
tool_search, inactive until named by--tools,defaultToolsor another extension.
Constants§
- DEFAULT_
LIMIT - Matches loaded when the call gives no limit.
- DESCRIPTION
- The description, which does not list the searchable tools so it stays the same while tools are registered.
- TOOL_
SEARCH_ TOOL_ NAME - The tool’s name.
Functions§
- document
- A tool’s search text: its name, the name with
_as spaces, the description, schema text, and its namespace. - is_
tool_ search - Whether
toolis this crate’stool_search. - rank
- Okapi BM25 (k1 1.2, b 0.75) over
documents: the bestlimitnames with a positive score. Ties keep document order. - tokenize
- Lowercase terms split at camelCase boundaries and non-alphanumerics, without stop words.