类 PreSummaryEvent


public final class PreSummaryEvent extends SummaryEvent
Event fired before summary generation when max iterations is reached.

Modifiable: Yes - setInputMessages(List), setGenerateOptions(GenerateOptions)

Context:

Use Cases:

  • Inject additional context into the summary prompt
  • Modify the summary system instructions
  • Change generation parameters for summary
  • Log summary generation input
  • 构造器详细资料

    • PreSummaryEvent

      public PreSummaryEvent(Agent agent, String modelName, GenerateOptions generateOptions, List<Msg> inputMessages, int maxIterations, int currentIteration)
      Constructor for PreSummaryEvent.
      参数:
      agent - The agent instance (must not be null)
      modelName - The model name (must not be null)
      generateOptions - The generation options (may be null)
      inputMessages - The messages to send to LLM for summary (must not be null)
      maxIterations - The maximum iterations configured for the agent
      currentIteration - The current iteration count when summary triggered
      抛出:
      NullPointerException - if agent, modelName, or inputMessages is null
  • 方法详细资料

    • getInputMessages

      public List<Msg> getInputMessages()
      Get the messages that will be sent to LLM for summary generation.
      返回:
      The input messages
    • setInputMessages

      public void setInputMessages(List<Msg> inputMessages)
      Modify the messages to send to LLM for summary.
      参数:
      inputMessages - The new message list (must not be null)
      抛出:
      NullPointerException - if inputMessages is null
    • getMaxIterations

      public int getMaxIterations()
      Get the maximum iterations configured for the agent.
      返回:
      The maximum iterations
    • getCurrentIteration

      public int getCurrentIteration()
      Get the current iteration count when summary was triggered.
      返回:
      The current iteration count
    • getEffectiveGenerateOptions

      public GenerateOptions getEffectiveGenerateOptions()
      Get the effective generation options.

      Returns the overridden options if set via setGenerateOptions(GenerateOptions), otherwise returns the original options from the parent class.

      返回:
      The effective generation options
    • setGenerateOptions

      public void setGenerateOptions(GenerateOptions generateOptions)
      Set custom generation options for this summary call.

      This allows hooks to override the default generation options.

      参数:
      generateOptions - The custom generation options