Skip to main content

Module message_stream

Module message_stream 

Source
Expand description

Enhanced Message Stream Handler

Implements streaming message processing with delta events, error handling, and abort control.

Based on Anthropic API standard event model.

Structs§

Citation
Citation reference
EnhancedMessageStream
Enhanced message stream handler
MessageState
Message state accumulated from stream events
StreamCallbacks
Stream callbacks for event handling
StreamOptions
Stream options for timeout and abort control
TextContentBlock
Text content block
ThinkingContentBlock
Thinking content block
TokenUsage
Token usage information
ToolUseContentBlock
Tool use content block

Enums§

ContentBlock
Union content block type
ContentBlockType
Content block types
DeltaType
Delta types for content updates
StreamError
Stream error types
StreamEventType
Anthropic API standard stream event types

Functions§

parse_tolerant_json
Tolerant JSON parser that auto-fixes incomplete JSON