Expand description
Resolve agent -> model -> provider; build Rig agent.
Modules§
- retry
- Transient-error retry wrapper around a
CompletionModel.
Structs§
- Mistralrs
Weights - Weight-source spec for a mistralrs-backed model. Lifted off
[models.<name>]at resolve time. Only one ofmodel_id/model_pathis meaningful in any given instance; validation enforces that, butmistralrs::loadis also defensive. - Outrig
Prompt Hook - Per-request hook that traces every tool call to stderr and stops the agent
loop after
maxcalls. Cloned by rig per request; shared atomics keep a single turn’s calls counting against the same max. - Resolved
Agent - Fully-resolved view of one agent: every knob the agent loop needs to build a Rig client and run a turn.
Enums§
- LlmResolve
Error - Failures that surface while walking
agents -> models -> providersor constructing the Rig client. Wrapped intocrate::error::OutrigErrorat the top level via#[from]. - Resolved
Provider - Runtime-shaped provider view – mirrors the config
LlmProviderenum, but with the env-var-backedApiKeyRefalready resolved to a plainStringfor the OpenAi variant. Variants are kept in sync withLlmProvider’s. - RigAgent
- Runtime-dispatched Rig agent. The OpenAi-backed and mistralrs-backed
CompletionModelimpls produce concretely differentAgent<M>types (Rig’s trait carries associated types, so a single concreteRigAgentcan’t carry both). Callers (the agent loop) match on the variant.
Constants§
- DEFAULT_
REQUEST_ TIMEOUT_ SECS - Default per-request HTTP timeout for OpenAi-style providers when
request-timeout-secsis unset (seedoc/reference/config.md). Generous enough not to truncate long reasoning completions, and above typical proxy timeouts so a client-side timeout never races a still-in-flight server request. - DEFAULT_
TOOL_ RESULT_ MAX_ BYTES - Default byte ceiling applied to each individual MCP tool result before it is handed to Rig and appended to model-visible chat history.
- MAX_
TOOL_ CALLS - Hard max on tool calls per turn. The hook below trips this; rig’s own
max_turnsis set to the same value as a defense in depth, so whichever fires first surfaces a controllable message.
Functions§
- build_
agent - Build a Rig
Agentready to receive a turn. Preamble, sampling params, and the dynamic-tool list come fromresolvedplus the caller-supplied MCP-backed adapters. Thecache_rootargument is the directory into which the mistralrs HF-download path stages model files; it’s ignored for OpenAi providers. - resolve_
agent - Walk
cfg.agents -> models -> providersto resolve every knob the agent loop needs. Bails with a descriptive error if a reference is dangling or the api-key env var is unset. - resolve_
agent_ with_ device_ override - resolve_
agent_ with_ overrides