Normandy.Components.StreamEvent (normandy v2.2.0)

View Source

What a Normandy.Agents.BaseAgent.stream/3 callback receives, in stream order.

typedata
:message_start%{id: String.t() | nil, model: String.t() | nil}
:text_deltathe new text
:thinking_deltathe new thinking text
:tool_use_start%{id: String.t(), name: String.t()}; the input arrives later
:tool_resultthe %Normandy.Components.ToolResult{} of a finished tool call
:guardrail_violation%{stage: :output, mode: :accumulate | :incremental, violations: list()}
:message_stopnil

With tools, one stream/3 call streams several model messages, each from :message_start to :message_stop, with :tool_result events between them. With max_tool_concurrency > 1, :tool_result events arrive in completion order.

Summary

Types

t()

@type t() :: %Normandy.Components.StreamEvent{data: term(), type: type()}

type()

@type type() ::
  :message_start
  | :text_delta
  | :thinking_delta
  | :tool_use_start
  | :tool_result
  | :guardrail_violation
  | :message_stop