Skip to main content

Module client

Module client 

Source
Expand description

统一客户端接口:提供协议驱动的 AI 模型交互入口。

Unified client interface for AI-Protocol runtime.

Developer-friendly goal: keep the public surface small and predictable. Implementation details are split into submodules under src/client/.

Modules§

builder
chat
core
核心客户端实现:管理协议加载、传输、流水线及弹性策略。
endpoint
Endpoint resolution and service calls
error_classification
错误分类逻辑:将 HTTP 状态码和提供商错误映射到 V2 标准错误码。
signals
types

Structs§

AiClient
Unified AI client that works with any provider through protocol configuration.
AiClientBuilder
Builder for creating clients with custom configuration.
CallStats
Per-call statistics for observability and model selection.
CancelHandle
Handle to cancel an in-flight streaming request.
ChatBatchRequest
Batch chat request parameters (developer-friendly, small surface).
ChatRequestBuilder
Builder for chat requests.
ClientMetrics
Snapshot of cumulative client metrics for monitoring and routing.
PolicyEngine
Internal policy engine that unifies retry / fallback behavior.
SignalsSnapshot
A lightweight, provider-agnostic snapshot of runtime “signals” for orchestration.
UnifiedResponse
Unified response format.

Enums§

Decision
Internal decision for how to proceed after a failed attempt.

Traits§

EndpointExt

Functions§

classify_error_from_response
Classify an error from HTTP status and optional response body.