API

Public API

Core Types

TypeDescription
ConfigTop-level config loaded from TOML
AgentRuns tool-calling loops with model fallback
AgentResponseResult of an agent execution
MessageConversation message (role + content + tool calls)
ResponseRaw LLM response
RoleSystem, User, Assistant, Tool
Error / ResultError handling

Traits

TraitDescription
BackendLLM generation interface (async fn generate)
ToolTool interface (fn name, fn description, fn parameters_schema, async fn execute)

Config Types

TypeDescription
ProviderConfigAPI endpoint, key, models
ModelConfigModel ID, name, reasoning flag, context/token limits
AgentConfigPrimary model, fallbacks, max iterations
InferenceParamsTemperature, top_p, system prompt
ModelRefParsed "provider/model-id" reference

Tool System

TypeDescription
ToolRegistryManages registered tools, executes by name
ToolDefinitionName + description + JSON schema (sent to LLM)
ToolCallRequestLLM's request to call a tool
ToolCallRecordExecution record with timing
ToolResultTool execution result
TokenUsagePrompt/completion/total token counts
TokenCallbackStreaming token callback (Box<dyn Fn(&str)>)