Skip to main content

Module tool_router

Module tool_router 

Source
Expand description

FunctionGemma-powered hybrid tool-call router.

Sits between the primary LLM response and the tool-extraction step in the session agentic loop. When the primary LLM returns text-only output that describes tool calls without using structured ContentPart::ToolCall entries, the router passes the text + available tool definitions through a local FunctionGemma model (via Candle) and emits properly-formatted ContentPart::ToolCall entries.

Feature-gated: this module only compiles when the functiongemma cargo feature is enabled. The binary size is unaffected in default builds.

Structsยง

ToolCallRouter
Hybrid tool-call router backed by a local FunctionGemma model.
ToolRouterConfig
Environment-variable driven configuration for the tool-call router.