Skip to main content

Module normalized

Module normalized 

Source
Expand description

Normalized event types for streaming LLM responses.

This module defines a unified event model that abstracts over different LLM protocols (Chat Completions, Responses API) and provides consistent streaming events for the client UI.

§Event Types

The NormalizedEvent enum covers all possible streaming events:

  • Message deltas for incremental text output
  • Tool call lifecycle (delta, complete, result)
  • Extended model capabilities (thinking, reasoning, citations, memory)
  • Stream lifecycle (start, done, error)

§Example

use universal_agent_runtime::normalized::{NormalizedEvent, sse_event};

let event = NormalizedEvent::MessageDelta {
    text: "Hello".to_string(),
};
let sse = sse_event(&event);
assert!(sse.contains("message.delta"));

Structs§

Citation
Citation reference for source attribution.

Enums§

NormalizedEvent
Normalized streaming events emitted by the LLM orchestrator.
RuntimeStepKind
Lifecycle phase of a runtime step.

Functions§

agui_sse_event
Convert a NormalizedEvent to an AG-UI compatible SSE event.
dual_sse_event
Emit both normalized and AG-UI events for a single NormalizedEvent.
event_name
Get the SSE event name for a NormalizedEvent.
sse_event
Convert a NormalizedEvent to an SSE-formatted string.