Based Mdels

Agent Loop docs

API reference

This reference covers the main public interfaces. Start with the top-level package for common imports, or use the lower-level modules when you need direct control of clients, tools, observers, or conversation results.

ModulePurpose
agentloopErgonomic re-exports
agentloop.agentHigh-level agent and tool decorator
agentloop.collectorSummaryCollector, the loop's per-conversation usage and tool counter
agentloop.configSettings and client construction
agentloop.errorsException hierarchy
agentloop.loopCore conversation loop
agentloop.observerLifecycle callbacks
agentloop.summaryConversation outcomes, usage, timing, and limits
agentloop.eventsOrdered JSONL event traces
agentloop.metricsOpenTelemetry counters and histograms
agentloop.providerShared request, response, and client types
agentloop.retryRetry policy and wrapper
agentloop.stallRepeatTracker, used for SummaryOptions.stall_threshold reporting
agentloop.toolingRegistry and tool execution
agentloop.tracingOpenTelemetry observer and setup
agentloop.transcriptConversation messages and parts
agentloop.providersBuilt-in provider integrations

The provider index compares the built-in adapters and links to their constructors. The custom providers guide explains how to implement LLMClient.

Pydantic models in this package validate construction. Models described as frozen reject attribute assignment after construction.