Expand description
§aimux-core
Core abstractions for the aimux toolkit.
Architecture (aligned with Vercel AI SDK V4):
User-facing API Provider-facing trait
────────────── ─────────────────────
generate_text() ──► LanguageModel::do_generate()
stream_text() ──► LanguageModel::do_stream()
embed() ──► EmbeddingModel::do_embed()
generate_image() ──► ImageModel::do_generate()
... ──► ...Users call the free operation functions; providers implement the do_*
methods that perform one provider attempt.
Re-exports§
pub use embedding_model::EmbeddingModel;pub use error::AiMuxError;pub use error::ApiCallError;pub use error::RetryError;pub use error::RetryErrorReason;pub use files_model::Files;pub use image_model::ImageModel;pub use language_model::LanguageModel;pub use provider::Provider;pub use reranking_model::RerankingModel;pub use search_model::SearchModel;pub use speech_model::SpeechModel;pub use transcription_model::TranscriptionModel;pub use video_model::VideoModel;
Modules§
- composite
- Composite-model shared infrastructure (RFC-0021 / RFC-0022).
- content
- Content parts shared between user-facing and provider-facing messages.
- embedding_
model - The
EmbeddingModeltrait — the provider-facing interface for text embeddings. - error
- Error types for aimux-core.
- files_
model - The
Filestrait — the provider-facing interface for file management. - generate
- User-facing API:
generate_textandstream_text. - image_
model - The
ImageModeltrait — the provider-facing interface for image generation. - json_
repair - JSON repair and partial-JSON parsing helpers.
- language_
model - The
LanguageModeltrait — the provider-facing interface. - language_
model_ message - Provider-facing message types.
- math
- Math helpers ported from the Vercel AI SDK TypeScript
utilpackage. - message
- User-facing message types.
- moa
MoaModel— Mixture-of-Agents single-fanout aggregation (RFC-0022).- model_
catalogue - Model catalogue types (RFC-0027).
- model_
id - Model identifier helpers.
- openai_
output - OpenAI Chat Completions output format.
- options
CallOptions— the provider-facing options passed todo_generate/do_stream.- parse_
tool_ call - Parse and validate provider tool calls at the Core boundary.
- prelude
- Convenience re-exports.
- provider
- The
Providertrait — a factory that createsLanguageModelinstances. - recording
- RFC-0023: 调用上下文录制(P1 — 数据模型 + Recorder trait + 门控 + JsonlRecorder)。
- replay
- RFC-0023 回放(P3 — mock 响应回放;P4 — 请求回放)。
- reranking_
model - The
RerankingModeltrait — the provider-facing interface for reranking. - result
- Result types for
do_generateanddo_stream. - retry
- Operation-level retry, aligned with the AI SDK retry utilities.
- router
RouterModel— a composite model that routes each call to one child and optionally falls back (RFC-0021).- search_
model - The
SearchModeltrait — the provider-facing interface for web search. - session
- Session aggregation (RFC-0024): session_id 归组基础设施.
- shared
- Shared V4 value types used across all non-chat model traits.
- speech_
model - The
SpeechModeltrait — the provider-facing interface for text-to-speech. - stream_
part StreamPart— the individual chunk types emitted bydo_stream.- tool
- Tool / function-calling types.
- trace
- Cache-hit probing infrastructure (RFC-0015) — layer ① of the three-layer split: probe itself. Collects fingerprints, judges verdicts, stores hashes, and exposes query APIs. Business logic (alerts / CLI / reports) lives outside this module.
- transcription_
model - The
TranscriptionModeltrait — the provider-facing interface for speech-to-text. - types
- Shared value types: FinishReason, Usage, Warning, ResponseMetadata.
- util
- Utility functions ported from the Vercel AI SDK TypeScript
utilpackage. - video_
model - The
VideoModeltrait — the provider-facing interface for video generation.
Structs§
- Abort
Signal - A cancellation signal analogous to the Web
AbortSignal.