Expand description
流式处理模块
SSE、WebSocket、HTTP 等流式响应处理。
§模块结构
sse: SSE 解析器和事件处理websocket: WebSocket 适配器http: HTTP 流式适配器providers: LLM 提供商特定的流式格式
Re-exports§
pub use http::HttpAdapter;pub use http::HttpConfig;pub use http::HttpRequest;pub use http::HttpResponseStream;pub use http::SseStream;pub use providers::ContentBlockType;pub use providers::ContentDelta;pub use providers::StreamEvent;pub use providers::StreamProvider;pub use providers::StreamState;pub use providers::StreamUsage;pub use sse::SseEvent;pub use sse::SseParser;pub use websocket::WebSocketAdapter;pub use websocket::WebSocketConfig;pub use websocket::WebSocketMessage;pub use websocket::WebSocketMessageStream;pub use providers::AnthropicStreamEvent;pub use providers::OllamaStreamChunk;pub use providers::OpenAiStreamChunk;
Modules§
Structs§
- Abortable
Stream - 可中断的流式响应
- Callback
Stream - 带回调的流式响应
- Message
Stream - 流式消息(兼容旧 API)
- Stream
Handler - 流处理器(兼容旧 API)
Type Aliases§
- OnChunk
Callback - 回调类型