services/llm_tool library
Exposes on-device search as an LLM tool without depending on any LLM SDK.
Classes
- RagSearchTool
- A search tool an LLM can call, described in a provider-neutral shape.
Typedefs
- PromptTokenCounter = int Function(String text)
-
Counts the tokens of
textas the LLM the prompt goes to counts them, for example with its SDK's tokenizer. -
RagToolSearch
= Future<
RagSearchResult> Function(String query, int topK) -
Runs one search for RagSearchTool: the model's
queryandtopK.