What a turn shows the model of the chat so far (spec §6.6): the user
messages and the final assistant answers of earlier turns, newest kept
first, up to agent_history_chars. Tool calls and tool results of earlier
turns are left out — after a loss of rights the model must not see old
data — and so are notices, but for one kind: the outcome of a confirmation
card (PhoenixKitAgent.Confirmations) goes in as a user message with the
module's own fixed phrase in the user's language — "[confirmation] done:
Summary
Functions
The model messages for a turn: the earlier messages of the chat (oldest
first: user and assistant messages, the notices of confirmation cards
and the cards, tool messages needs_confirmation) and then current, the
new user message, which is always kept. The earlier ones are kept from the
newest back while the characters of all kept messages stay within limit;
the first that does not fit ends the window. attachments are the chat's
ready attachments.
The phrase the model reads for the outcome of a confirmation card of the
tool action (the name the model knows it by), or for a card still
"waiting", in the current Gettext locale; nil for anything else.
The content of a user message: its text, then each attachment — the text it
carries (cut to its share of limit), or, for a picture the model is shown
as pixels, a line that names it (the pixels themselves go with the message of
their own turn only).
Types
Functions
@spec build( [PhoenixKitAgent.Schemas.Message.t()], [PhoenixKitAgent.Schemas.Attachment.t()], entry(), pos_integer() ) :: [entry()]
The model messages for a turn: the earlier messages of the chat (oldest
first: user and assistant messages, the notices of confirmation cards
and the cards, tool messages needs_confirmation) and then current, the
new user message, which is always kept. The earlier ones are kept from the
newest back while the characters of all kept messages stay within limit;
the first that does not fit ends the window. attachments are the chat's
ready attachments.
The phrase the model reads for the outcome of a confirmation card of the
tool action (the name the model knows it by), or for a card still
"waiting", in the current Gettext locale; nil for anything else.
@spec user_content( String.t(), [PhoenixKitAgent.Schemas.Attachment.t()], pos_integer() ) :: String.t()
The content of a user message: its text, then each attachment — the text it
carries (cut to its share of limit), or, for a picture the model is shown
as pixels, a line that names it (the pixels themselves go with the message of
their own turn only).