类 PreReasoningEvent


public final class PreReasoningEvent extends ReasoningEvent
Event fired before LLM reasoning.

Modifiable: Yes - setInputMessages(List)

Context:

Use Cases:

  • Inject hints or additional context into the prompt
  • Filter or modify existing messages
  • Add system instructions dynamically
  • Log reasoning input
  • 构造器详细资料

    • PreReasoningEvent

      public PreReasoningEvent(Agent agent, String modelName, GenerateOptions generateOptions, List<Msg> inputMessages)
      Constructor for PreReasoningEvent.
      参数:
      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 (must not be null)
      抛出:
      NullPointerException - if agent, modelName, or inputMessages is null
  • 方法详细资料

    • getInputMessages

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

      public void setInputMessages(List<Msg> inputMessages)
      Modify the messages to send to LLM.
      参数:
      inputMessages - The new message list (must not be null)
      抛出:
      NullPointerException - if inputMessages is null
    • 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 reasoning call.

      This allows hooks to override the default generation options, for example to set a specific tool_choice for structured output.

      参数:
      generateOptions - The custom generation options