Expand description
Model provider integration and label-based routing.
This module adapts provider-specific completion APIs to the common
CompletionRequest and AgentOutput contract used by Anda agents.
Built-in providers currently include OpenAI-compatible APIs, Anthropic, and
Google Gemini.
The Models registry maps model labels such as primary, pro,
flash, or lite to concrete Model instances. Labels let agents
request capability tiers without hard-coding provider model names.
Custom providers can implement CompletionFeaturesDyn and be wrapped with
Model::with_completer.
Re-exports§
pub use reqwest;
Modules§
- anthropic
- Anthropic Claude API client implementation for Anda Engine
- gemini
- Gemini API client implementation for Anda Engine
- openai
- OpenAI API client implementation for Anda Engine
Structs§
- AnyHost
- Host matcher that accepts every provider host.
- Mock
Implemented - Mock implementation for tests and examples.
- Model
- Concrete model entry registered with the engine.
- Model
Config - Serializable configuration for constructing a model adapter.
- Model
Error - Error returned by built-in model adapters when the caller can inspect retry semantics after the SDK-level retry has already been attempted.
- Models
- Thread-safe model registry used by the engine.
- NotImplemented
- Placeholder implementation that returns errors for completion requests.
- Proxy
- Configuration of a proxy that a
Clientshould pass requests to.
Enums§
- Model
Effort - Provider-agnostic reasoning/thinking effort requested for a completion.
Traits§
- Completion
Features Dyn - Object-safe completion provider interface.
Functions§
- is_
retryable_ box_ error - Convenience wrapper for callers that keep completion errors as
BoxError. - is_
retryable_ model_ error - Returns true if the error chain carries a retryable model error signal.
- is_
retryable_ status - Statuses that are transient enough for one immediate SDK retry and for an upper-layer delayed retry after the SDK retry has been exhausted.
- model_
error_ retry_ after - Returns the first upstream retry delay found in the error chain.
- model_
error_ status - Returns the first
ModelErrorHTTP status found in the error chain. - request_
client_ builder - Creates a reqwest client builder with Anda Engine defaults.