Skip to main content

Module models

Module models 

Source

Re-exports§

pub use tool_call::FunctionCall;
pub use tool_call::ToolCall;
pub use tools::Tool;
pub use tools::ToolFunction;
pub use tools::ToolRegistry;

Modules§

tool_call
Tool call parsing and conversion to AgentAction
tools
Ollama Tools API support for native function calling

Structs§

BackendConfig
Backend connection configuration
ChatMessage
Represents a chat message
ModelCapabilities
Capability flags advertised by a model adapter.
ModelConfig
Unified model configuration
ModelFactory
Model factory - creates model instances.
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.
TokenUsage
Token usage statistics
UserFacingError
User-facing error information with actionable suggestions

Enums§

BackendError
Backend-specific errors
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
MessageRole
ModelError
Top-level error type for all model operations
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.

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.