Class Builder

java.lang.Object
com.alibaba.cloud.ai.graph.agent.Builder
Direct Known Subclasses:
DefaultBuilder

public abstract class Builder extends Object
  • Field Details

    • name

      protected String name
    • description

      protected String description
    • instruction

      protected String instruction
    • systemPrompt

      protected String systemPrompt
    • model

      protected org.springframework.ai.chat.model.ChatModel model
    • chatOptions

      protected org.springframework.ai.chat.prompt.ChatOptions chatOptions
    • chatClient

      protected org.springframework.ai.chat.client.ChatClient chatClient
    • tools

      protected List<org.springframework.ai.tool.ToolCallback> tools
    • toolCallbackProviders

      protected List<org.springframework.ai.tool.ToolCallbackProvider> toolCallbackProviders
    • toolNames

      protected List<String> toolNames
    • resolver

      protected org.springframework.ai.tool.resolution.ToolCallbackResolver resolver
    • toolExecutionExceptionProcessor

      protected org.springframework.ai.tool.execution.ToolExecutionExceptionProcessor toolExecutionExceptionProcessor
    • toolContext

      protected Map<String,Object> toolContext
    • releaseThread

      protected boolean releaseThread
    • saver

      protected BaseCheckpointSaver saver
    • compileConfig

      protected CompileConfig compileConfig
    • hooks

      protected List<Hook> hooks
    • interceptors

      protected List<Interceptor> interceptors
    • modelInterceptors

      protected List<ModelInterceptor> modelInterceptors
    • toolInterceptors

      protected List<ToolInterceptor> toolInterceptors
    • includeContents

      protected boolean includeContents
    • returnReasoningContents

      protected boolean returnReasoningContents
    • outputKey

      protected String outputKey
    • outputKeyStrategy

      protected KeyStrategy outputKeyStrategy
    • inputSchema

      protected String inputSchema
    • inputType

      protected Type inputType
    • outputSchema

      protected String outputSchema
    • outputType

      protected Class<?> outputType
    • observationRegistry

      protected io.micrometer.observation.ObservationRegistry observationRegistry
    • customObservationConvention

      protected org.springframework.ai.chat.client.observation.ChatClientObservationConvention customObservationConvention
    • advisorObservationConvention

      protected org.springframework.ai.chat.client.advisor.observation.AdvisorObservationConvention advisorObservationConvention
    • enableLogging

      protected boolean enableLogging
    • stateSerializer

      protected StateSerializer stateSerializer
    • executor

      protected Executor executor
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • name

      public Builder name(String name)
    • chatClient

      @Deprecated public Builder chatClient(org.springframework.ai.chat.client.ChatClient chatClient)
      Deprecated.
    • model

      public Builder model(org.springframework.ai.chat.model.ChatModel model)
    • chatOptions

      public Builder chatOptions(org.springframework.ai.chat.prompt.ChatOptions chatOptions)
    • tools

      public Builder tools(List<org.springframework.ai.tool.ToolCallback> tools)
    • tools

      public Builder tools(org.springframework.ai.tool.ToolCallback... tools)
    • methodTools

      public Builder methodTools(Object... toolObjects)
    • toolCallbackProviders

      public Builder toolCallbackProviders(org.springframework.ai.tool.ToolCallbackProvider... toolCallbackProviders)
    • toolNames

      public Builder toolNames(String... toolNames)
    • resolver

      public Builder resolver(org.springframework.ai.tool.resolution.ToolCallbackResolver resolver)
    • toolExecutionExceptionProcessor

      public Builder toolExecutionExceptionProcessor(org.springframework.ai.tool.execution.ToolExecutionExceptionProcessor toolExecutionExceptionProcessor)
    • toolContext

      public Builder toolContext(Map<String,Object> toolContext)
    • releaseThread

      public Builder releaseThread(boolean releaseThread)
    • saver

      public Builder saver(BaseCheckpointSaver saver)
    • compileConfig

      public Builder compileConfig(CompileConfig compileConfig)
    • description

      public Builder description(String description)
    • instruction

      public Builder instruction(String instruction)
    • systemPrompt

      public Builder systemPrompt(String systemPrompt)
    • outputKey

      public Builder outputKey(String outputKey)
    • outputKeyStrategy

      public Builder outputKeyStrategy(KeyStrategy outputKeyStrategy)
    • inputSchema

      public Builder inputSchema(String inputSchema)
    • inputType

      public Builder inputType(Type inputType)
    • outputSchema

      public Builder outputSchema(String outputSchema)
    • outputType

      public Builder outputType(Class<?> outputType)
    • includeContents

      public Builder includeContents(boolean includeContents)
    • returnReasoningContents

      public Builder returnReasoningContents(boolean returnReasoningContents)
    • hooks

      public Builder hooks(List<? extends Hook> hooks)
    • hooks

      public Builder hooks(Hook... hooks)
    • interceptors

      public Builder interceptors(List<? extends Interceptor> interceptors)
    • interceptors

      public Builder interceptors(Interceptor... interceptors)
    • observationRegistry

      public Builder observationRegistry(io.micrometer.observation.ObservationRegistry observationRegistry)
    • customObservationConvention

      public Builder customObservationConvention(org.springframework.ai.chat.client.observation.ChatClientObservationConvention customObservationConvention)
    • advisorObservationConvention

      public Builder advisorObservationConvention(org.springframework.ai.chat.client.advisor.observation.AdvisorObservationConvention advisorObservationConvention)
    • enableLogging

      public Builder enableLogging(boolean enableLogging)
    • stateSerializer

      public Builder stateSerializer(StateSerializer stateSerializer)
      Sets the state serializer for the agent.
      Parameters:
      stateSerializer - the state serializer to use
      Returns:
      this builder instance
    • stateSerializer

      @Deprecated public Builder stateSerializer(SpringAIStateSerializer stateSerializer)
      Deprecated.
      Sets the state serializer for the agent.
      Parameters:
      stateSerializer - the SpringAI state serializer to use
      Returns:
      this builder instance
    • executor

      public Builder executor(Executor executor)
      Sets the executor for parallel nodes.

      This executor will be used for all parallel nodes in the agent's execution graph. When a parallel node is executed, it will use this executor to run the parallel branches concurrently.

      Parameters:
      executor - the Executor to use for parallel nodes
      Returns:
      this builder instance
    • buildConfig

      protected CompileConfig buildConfig()
    • build

      public abstract ReactAgent build()