class LittleGhost::StreamEvent
StreamEvent gives every provider and interface the same language for live agent output. Consumers can handle text, reasoning, tools, usage, retries, and completion without branching on a provider SDK.
Providers emit events such as :message_start, :text_delta, :reasoning_delta, :tool_call_start, :tool_call_delta, :tool_call_stop, :usage, :model_retry, and :message_stop. The terminal event carries a ModelResponse in data[:response]. An :agent_stream event wraps a copied, frozen Agent event with an AgentStreamSource when a Run exposes nested work.
event = LittleGhost::StreamEvent.build(:text_delta, text: "Hello") event.type # => :text_delta event.data[:text] # => "Hello"
Attributes
The frozen outer payload Hash. Nested values are retained and must not be mutated by callers.
The event kind, such as :text_delta, :usage, or :message_stop.
Public Class Methods
# File lib/little_ghost/stream_event.rb, line 38
Creates an event with a symbol type and frozen outer payload Hash.