Skip to main content

Module streaming

Module streaming 

Source
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§

http
HTTP 流式适配器
providers
LLM 提供商流式格式
sse
Server-Sent Events 解析器
websocket
WebSocket 适配器

Structs§

AbortableStream
可中断的流式响应
CallbackStream
带回调的流式响应
MessageStream
流式消息(兼容旧 API)
StreamHandler
流处理器(兼容旧 API)

Type Aliases§

OnChunkCallback
回调类型