Skip to main content

Module models

Module models 

Source

Re-exports§

pub use tool_call::FunctionCall;
pub use tool_call::ToolCall;

Modules§

catalog
The data-driven model-capability catalog: one FIRST-MATCH-WINS const table replacing the model-name string gates that were scattered across the adapters (anthropic thinking/temperature/effort tiers, gemini thinking dispatch, ollama’s gpt-oss think-string, openai-compat reasoning-model and vision markers) and the domain’s static context windows.
tool_call
Wire-format tool call type.

Structs§

BackendConfig
Backend connection configuration
ChatMessage
Represents a chat message
ModelCapabilities
Capability flags advertised by a model adapter.
ModelConfig
Unified model configuration
ModelResponse
Response from a model
OllamaOptions
Ollama-specific options (extracted from backend_options)
ProviderProfile
Static description of one OpenAI-compatible provider.
ReasoningChunk
A typed chunk of reasoning content emitted during streaming.
ResponseDebugContext
Correlation ids captured from a provider’s HTTP response headers. Appended (one plain-text line) to the user-facing error message so bug reports to the provider can quote them; deliberately NOT part of Display, which feeds logs and try_extract_error_message.
TokenUsage
Token usage statistics normalized across providers.
UserFacingError
User-facing error information with actionable suggestions

Enums§

BackendError
Backend-specific errors
ChatMessageKind
CompatStyle
User-friendly string form for compat = "..." in config.toml when a fully custom provider needs to declare which profile shape to follow.
ConfigError
Configuration errors
ErrorCategory
Error categories for visual differentiation
FinishReason
Why a model stopped generating, normalized across providers.
MaxTokensParam
Provider-specific spelling for the completion-token budget.
MessageRole
MetaResponseItem
One Meta Responses output item saved for stateless replay. Reasoning items split their encrypted payload from the remaining JSON so the ciphertext can be serialized as base64 bytes. This keeps generic persistence redaction from mistaking a ciphertext for a credential and corrupting the replay state.
ModelError
Top-level error type for all model operations
ProviderContinuation
Opaque provider-owned state that must be replayed with a committed assistant turn. The reducer carries this as inert data; only the matching provider interprets it.
ReasoningCapability
Describes the reasoning controls a model exposes.
ReasoningExtraction
Where reasoning content shows up in a streaming response delta.
ReasoningLevel
Reasoning depth requested for a model call.
ReasoningStrategy
How to put ReasoningLevel onto the wire for a given provider.
StreamEvent
A single event emitted during a streaming model call.
TokenUsageSource
Where a token count came from. Provider-reported counts are the billing/request truth; estimates are only for preflight context diagnostics.

Constants§

PROVIDER_REGISTRY
Built-in provider registry. Lookups are case-insensitive on name. Add a provider here when its quirks fit the existing strategies; add a new ReasoningStrategy variant when a provider needs something the existing ones can’t express.

Traits§

Model
Core trait that all model adapters implement.

Functions§

lookup_provider
Look up a built-in provider by name. Case-insensitive.
nearest_effort
Map a requested reasoning level onto the closest level the model actually supports.

Type Aliases§

Result
Result type alias for model operations
StreamCallback
Callback invoked once per StreamEvent during a chat request.