Observability state and span lifecycle for orchestrator strategies.
Encapsulates all OTel span management, token accumulation, and LLM
message normalization that was previously scattered across Strategy.
Strategy stores a single _obs: %Obs{} | nil field instead of five
separate _obs_* fields.
Summary
Functions
Extracts the agent name for obs span metadata.
Builds observability measurements from an LLM result instruction params. Extracts token usage, finish reason, and output messages from the ReqLLM response structures.
Extracts input messages from a ReqLLM conversation context, normalizing them into plain maps suitable for OTel span attributes.
Returns a fresh Obs struct.
Summarizes the conversation state for span metadata.
Types
@type t() :: %Jido.Composer.Orchestrator.Obs{ agent_span: term() | nil, cumulative_tokens: %{ prompt: non_neg_integer(), completion: non_neg_integer(), total: non_neg_integer() }, iteration_span: term() | nil, llm_span: term() | nil, tool_spans: %{optional(String.t()) => term()} }
Functions
Extracts the agent name for obs span metadata.
Builds observability measurements from an LLM result instruction params. Extracts token usage, finish reason, and output messages from the ReqLLM response structures.
Extracts input messages from a ReqLLM conversation context, normalizing them into plain maps suitable for OTel span attributes.
@spec new() :: t()
Returns a fresh Obs struct.
Summarizes the conversation state for span metadata.