Expand description
Model-provider boundary and provider API adapters.
This crate owns provider-neutral model turns and bidirectional API wire mappings. It does not execute tools or own sessions, memory, or UI concerns.
Structs§
- Anthropic
Model Provider - Anthropic
Provider Config - Configuration for Anthropic’s Messages API. The cache flag only marks the immutable system/tool prefix; it never places task state in a cache block.
- ApiProvider
Config - Common configuration used to construct a concrete API adapter.
- Blend
Provider - A named set of API providers for per-call model selection.
- Chat
GptCredentials - Local credential record for the official open-source Sign in with ChatGPT token-sharing flow. Secrets are deliberately omitted from Debug output.
- Discovered
Model - Metadata describing a model discovered from an upstream provider endpoint.
- Echo
Model - Deterministic model provider used by smoke tests and protocol demonstrations.
- Experiment
Controls - Explicit Chat Completions experiment settings. Unsupported endpoint parameters must produce an error; callers must not silently remove them.
- Gemini
Generate Content Model Provider - Gemini
Provider Config - Configuration for a Gemini GenerateContent endpoint.
- Model
Progress Sink - Model
RunRequest - Model
RunResult - Open
AiChat Codec - Open
AiChat Request - Open
AiChat Response - Open
AiModel Provider - OpenAI-compatible adapter for Structure’s provider-neutral ModelRunRequest.
- Open
AiProvider Config - Configuration for an OpenAI-compatible Chat Completions endpoint.
- Open
AiResponses Codec - Open
AiResponses Model Provider - OpenAI-compatible Responses adapter. It uses stateless continuation: provider output items (including encrypted reasoning) are retained in the event log and replayed verbatim on the next model step.
- Open
AiResponses Request - Provider
Error
Enums§
- ApiModel
Provider - Unified enum dispatch over concrete provider API adapters.
- ApiType
- Provider API dialect selected at the model-provider boundary.
- Model
Progress
Traits§
- ApiCodec
- Bidirectional codec for one provider API dialect.
- Model
Provider
Functions§
- compile_
runtime_ request - Compile the provider-neutral model request into the typed Provider input.
- default_
chatgpt_ models - is_
chat_ completion_ candidate - Filter heuristic for candidate conversational / completion models.
- lock_
chatgpt_ credentials - Serialize credential rotation and revocation across CLI and desktop processes. Keep the returned file alive until the credential transaction has finished.
- sort_
discovered_ models - Sort discovered models prioritizing chat completion candidates, followed by newer creation timestamp and identifier order.