Skip to main content

build_agent

Function build_agent 

Source
pub async fn build_agent(
    resolved: &ResolvedAgent,
    tools: Vec<McpToolAdapter>,
    cache_root: &Path,
) -> Result<RigAgent>
Expand description

Build a Rig Agent ready to receive a turn. Preamble, sampling params, and the dynamic-tool list come from resolved plus the caller-supplied MCP-backed adapters. The cache_root argument is the directory into which the mistralrs HF-download path stages model files; it’s ignored for OpenAi providers.

The function is async because the mistralrs arm has to load (and on first use, download) a multi-gigabyte model. The OpenAi arm is sync-in- async, free.