A consistent view of an Omni.Session at a point in time.
Returned by Omni.Session.get_snapshot/1 and Omni.Session.subscribe/1,2.
Fields:
:id— the session's identifier:title— the session's human-friendly title, ornil:tree— the%Omni.Session.Tree{}of committed conversation history at the snapshot instant:agent— an%Omni.Agent.Snapshot{}capturing the wrapped agent's state, in-flight pending messages, and currently-streaming partial message
To compose the complete view of everything the session knows right now:
committed = Omni.Session.Tree.messages(snapshot.tree)
in_flight = snapshot.agent.pending ++ List.wrap(snapshot.agent.partial)
committed ++ in_flightsnapshot.agent.state.messages mirrors Tree.messages(snapshot.tree)
— treat the tree as the source of truth for committed structure;
agent.pending / agent.partial carry the streaming tail.
Summary
Types
@type t() :: %Omni.Session.Snapshot{ agent: Omni.Agent.Snapshot.t(), id: String.t(), title: String.t() | nil, tree: Omni.Session.Tree.t() }
A Session snapshot.