Skip to main content

Module tool_search

Module tool_search 

Source
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§

ToolSearch
The tool_search tool over a session’s tools.
ToolSearchExtension
The built-in extension that registers tool_search, inactive until named by --tools, defaultTools or 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 tool is this crate’s tool_search.
rank
Okapi BM25 (k1 1.2, b 0.75) over documents: the best limit names with a positive score. Ties keep document order.
tokenize
Lowercase terms split at camelCase boundaries and non-alphanumerics, without stop words.