Expand description
§ai-lib-core
AI-Protocol 执行层:协议加载、客户端、流水线、传输与核心类型。策略模块见 ai-lib-contact / 聚合 crate ai-lib-rust。
Execution-layer runtime for AI-Protocol (protocol, client, pipeline, transport, types).
On wasm32 targets, only protocol parsing, drivers, types, and structured helpers are built
(no async client, transport, or pipeline). See PT-072 / ai-lib-wasm.
Re-exports§
pub use client::CallStats;pub use client::CancelHandle;pub use client::ChatBatchRequest;pub use client::ClientMetrics;pub use client::EndpointExt;pub use client::AiClient;pub use client::AiClientBuilder;pub use feedback::FeedbackEvent;pub use feedback::FeedbackSink;pub use types::events::StreamingEvent;pub use types::execution_result::ExecutionMetadata;pub use types::execution_result::ExecutionResult;pub use types::execution_result::ExecutionUsage;pub use types::message::Message;pub use types::message::MessageRole;pub use types::tool::ToolCall;pub use error::Error;pub use error::ErrorContext;pub use error_code::StandardErrorCode;
Modules§
- client
- 统一客户端接口:提供协议驱动的 AI 模型交互入口。
- drivers
- Provider 驱动抽象层 — 通过 trait 实现多厂商 API 适配的动态分发
- error
- 错误处理模块:提供统一的错误类型和结构化错误上下文。
- error_
code - V2 标准错误码:定义 13 个规范错误码及其重试/回退语义。
- feedback
- 核心反馈类型:提供 FeedbackSink trait 和多种反馈事件(始终编译)。
- pipeline
- 流水线处理模块:实现流式响应处理的核心算子执行引擎。
- protocol
- 协议规范层:负责加载、验证和管理 AI-Protocol 规范文件。
- registry
- 能力注册表 — 根据 Manifest 声明动态加载和管理运行时模块
- structured
- Structured output module for ai-lib-rust.
- transport
- types
- 类型系统模块:定义基于 AI-Protocol 规范的核心数据类型。
- utils
- Utility modules
Type Aliases§
- BoxStream
- A unified pinned, boxed stream that emits
PipeResult<T> - Pipe
Result - A specialized Result for pipeline operations
- Result
- Result type alias for the library