Class ToolCallAdvisor.Builder

java.lang.Object
org.springframework.ai.chat.client.advisor.ToolCallAdvisor.Builder
Enclosing class:
ToolCallAdvisor

public static final class ToolCallAdvisor.Builder extends Object
Builder for creating instances of ToolCallAdvisor.
  • Method Details

    • toolCallingManager

      public ToolCallAdvisor.Builder toolCallingManager(org.springframework.ai.model.tool.ToolCallingManager toolCallingManager)
      Sets the ToolCallingManager to be used by the advisor.
      Parameters:
      toolCallingManager - the ToolCallingManager instance
      Returns:
      this Builder instance for method chaining
    • advisorOrder

      public ToolCallAdvisor.Builder advisorOrder(int advisorOrder)
      Sets the order of the advisor in the advisor chain.
      Parameters:
      advisorOrder - the order value, must be between HIGHEST_PRECEDENCE and LOWEST_PRECEDENCE
      Returns:
      this Builder instance for method chaining
    • build

      public ToolCallAdvisor build()
      Builds and returns a new ToolCallAdvisor instance with the configured properties.
      Returns:
      a new ToolCallAdvisor instance
      Throws:
      IllegalArgumentException - if toolCallingManager is null or advisorOrder is out of valid range