SuperPi.Event.History (super_pi v0.1.0)

Copy Markdown View Source

The visible messages of a conversation in a neutral shape, for protocols that must replay history: the AG-UI MESSAGES_SNAPSHOT (a reconnect, or a compaction) and the ACP session/load.

Each message is a map with "id", "role" ("user", "assistant" or "tool") and "text" (the joined text blocks). An assistant message may have "tool_calls" (a list of %{"id", "name", "arguments"}), a tool message has "tool_call_id", "name" and "is_error". Entries that are not messages (compactions, system state) are left out. A compaction summary appears as an assistant message, because the entries that it replaces are no longer visible.

Summary

Functions

agui_messages(conversation_id)

@spec agui_messages(integer()) :: [map()]

The AG-UI form of messages/1.

messages(conversation_id)

@spec messages(integer()) :: [map()]