Documentation
¶
Overview ¶
Package stream provides event streaming for real-time observability.
Index ¶
Constants ¶
View Source
const ( EventNodeStart = "node_start" EventNodeEnd = "node_end" EventEdgeTransition = "edge_transition" EventToolCall = "tool_call" EventToolResult = "tool_result" EventModelCall = "model_call" EventModelResponse = "model_response" EventCheckpoint = "checkpoint" EventInterrupt = "interrupt" EventCompleted = "completed" EventError = "error" EventCustom = "custom" )
Standard event types published during graph and agent execution.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
Broker manages SSE subscribers.
func (*Broker) SSEHandler ¶
func (b *Broker) SSEHandler(subscriptionID string) http.HandlerFunc
SSEHandler returns an HTTP handler that streams events to the client.
func (*Broker) Unsubscribe ¶
Unsubscribe removes a subscription.
type StreamConfig ¶ added in v0.3.0
type StreamConfig struct {
Mode StreamMode
}
StreamConfig holds configuration for how events are filtered and delivered.
func DefaultStreamConfig ¶ added in v0.3.0
func DefaultStreamConfig() StreamConfig
DefaultStreamConfig returns a config that streams all events (debug mode).
func (StreamConfig) ShouldInclude ¶ added in v0.3.0
func (c StreamConfig) ShouldInclude(eventType string) bool
ShouldInclude returns true if the given event type passes the mode's filter. ModeDebug includes all events.
type StreamMode ¶ added in v0.3.0
type StreamMode string
StreamMode defines which events are included in a stream subscription.
const ( // ModeValues streams full state after each node execution. ModeValues StreamMode = "values" // ModeUpdates streams only changed state keys after each node. ModeUpdates StreamMode = "updates" // ModeCustom streams only user-emitted custom events. ModeCustom StreamMode = "custom" // ModeMessages streams LLM token-level events (model_call, model_response). ModeMessages StreamMode = "messages" // ModeDebug streams all internal execution details. ModeDebug StreamMode = "debug" )
Click to show internal directories.
Click to hide internal directories.