Skip to main content

Module model

Module model 

Source
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.
MockImplemented
Mock implementation for tests and examples.
Model
Concrete model entry registered with the engine.
ModelConfig
Serializable configuration for constructing a model adapter.
ModelError
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 Client should pass requests to.

Enums§

ModelEffort
Provider-agnostic reasoning/thinking effort requested for a completion.

Traits§

CompletionFeaturesDyn
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 ModelError HTTP status found in the error chain.
request_client_builder
Creates a reqwest client builder with Anda Engine defaults.