java.lang.Object
org.springframework.ai.session.compaction.EventText

public final class EventText extends Object
One line of text for an event or a message: what compaction counts tokens on, and what a summarizer puts in its prompt. A plain user, assistant or system message renders as "Role: text"; an AssistantMessage with tool calls as "Assistant [tool calls: name(args), ...]", after its text when it has one; a ToolResponseMessage as "Tool [responses: name -> data, ...]"; an event without a message as an empty string, since it is not sent to the model.
Since:
2.1.0
Author:
Christian Tzolov
  • Method Details

    • of

      public static String of(SessionEvent event)
      The text of an event; empty for an event that carries no message.
    • of

      public static String of(Message message)
      The text of a message.