Class PromptedConversationSummarizer

java.lang.Object
com.axelor.ai.chat.plugin.PromptedConversationSummarizer
All Implemented Interfaces:
ConversationSummarizer

public class PromptedConversationSummarizer extends Object implements ConversationSummarizer
Summarizes by asking a model, on whatever provider the conversation already uses.

The agent's utility model is preferred when it has one — summarizing is a cheap job and does not need the conversation's own model.

  • Method Details

    • summarize

      public String summarize(List<UIMessage> messages, ChatRequest request, AiModel model)
      Specified by:
      summarize in interface ConversationSummarizer
      Parameters:
      messages - the stretch leaving the window, oldest first
      model - the conversation's model, for a summarizer that has no model of its own
      Returns:
      the summary, or null when one could not be produced — the caller then trims without it