Class McpClientConfig.BuilderBase<BUILDER extends McpClientConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends McpClientConfig>

java.lang.Object
io.helidon.integrations.langchain4j.McpClientConfig.BuilderBase<BUILDER,PROTOTYPE>
Type Parameters:
BUILDER - type of the builder extending this abstract builder
PROTOTYPE - type of the prototype interface that would be built by Prototype.Builder.buildPrototype()
All Implemented Interfaces:
Prototype.Builder<BUILDER,PROTOTYPE>, ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>, ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Direct Known Subclasses:
McpClientConfig.Builder
Enclosing interface:
McpClientConfig

public abstract static class McpClientConfig.BuilderBase<BUILDER extends McpClientConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends McpClientConfig> extends Object implements ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for McpClientConfig.
  • Constructor Details

    • BuilderBase

      protected BuilderBase()
      Protected to support extensibility.
  • Method Details

    • from

      public BUILDER from(McpClientConfig prototype)
      Update this builder from an existing prototype instance. This method disables automatic service discovery.
      Parameters:
      prototype - existing prototype to update this builder from
      Returns:
      updated builder instance
    • from

      public BUILDER from(McpClientConfig.BuilderBase<?,?> builder)
      Update this builder from an existing prototype builder instance.
      Parameters:
      builder - existing builder prototype to update this builder from
      Returns:
      updated builder instance
    • config

      @Deprecated public BUILDER config(Config config)
      Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.
      Specified by:
      config in interface ConfigBuilderSupport.ConfiguredBuilder<BUILDER extends McpClientConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends McpClientConfig>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      Returns:
      updated builder instance
    • config

      public BUILDER config(Config config)
      Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.
      Specified by:
      config in interface ConfigBuilderSupport.ConfiguredBuilder<BUILDER extends McpClientConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends McpClientConfig>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      Returns:
      updated builder instance
    • sseUri

      public BUILDER sseUri(URI sseUri)
      The initial URI where to connect to the server and request a SSE channel.
      Parameters:
      sseUri - sse uri
      Returns:
      updated builder instance
      See Also:
    • clearClientName

      public BUILDER clearClientName()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • clientName

      public BUILDER clientName(String clientName)
      Sets the name that the client will use to identify itself to the MCP server in the initialization message. Overwrites the default client name from langchain4j.
      Parameters:
      clientName - client name
      Returns:
      updated builder instance
      See Also:
    • clearClientVersion

      public BUILDER clearClientVersion()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • clientVersion

      public BUILDER clientVersion(String clientVersion)
      Sets the version string that the client will use to identify itself to the MCP server in the initialization message. Overwrites the default client version from langchain4j.
      Parameters:
      clientVersion - client version
      Returns:
      updated builder instance
      See Also:
    • clearKey

      public BUILDER clearKey()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • key

      public BUILDER key(String key)
      Sets a unique identifier for the client. If none is provided, a UUID will be automatically generated. This key is later used to identify the client in the service registry.
      Parameters:
      key - client key
      Returns:
      updated builder instance
      See Also:
    • clearProtocolVersion

      public BUILDER clearProtocolVersion()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • protocolVersion

      public BUILDER protocolVersion(String protocolVersion)
      Sets the protocol version that the client will advertise in the initialization message. Overwrites the default version from langchain4j.
      Parameters:
      protocolVersion - protocol version
      Returns:
      updated builder instance
      See Also:
    • clearInitializationTimeout

      public BUILDER clearInitializationTimeout()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • initializationTimeout

      public BUILDER initializationTimeout(Duration initializationTimeout)
      Sets the timeout for initializing the client. Overwrites the default timeout for initializing from langchain4j.
      Parameters:
      initializationTimeout - initialization timout
      Returns:
      updated builder instance
      See Also:
    • clearToolExecutionTimeout

      public BUILDER clearToolExecutionTimeout()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • toolExecutionTimeout

      public BUILDER toolExecutionTimeout(Duration toolExecutionTimeout)
      Sets the timeout for tool execution. This value applies to each tool execution individually. A value of zero means no timeout. Overwrites the default timeout for tool execution from langchain4j.
      Parameters:
      toolExecutionTimeout - tool execution timout
      Returns:
      updated builder instance
      See Also:
    • clearResourcesTimeout

      public BUILDER clearResourcesTimeout()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • resourcesTimeout

      public BUILDER resourcesTimeout(Duration resourcesTimeout)
      Sets the timeout for resource-related operations (listing resources as well as reading the contents of a resource). A value of zero means no timeout. Overwrites the default timeout for resource-related operations from langchain4j.
      Parameters:
      resourcesTimeout - resources timeout
      Returns:
      updated builder instance
      See Also:
    • clearPromptsTimeout

      public BUILDER clearPromptsTimeout()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • promptsTimeout

      public BUILDER promptsTimeout(Duration promptsTimeout)
      The timeout for prompt-related operations (listing prompts as well as rendering the contents of a prompt). A value of zero means no timeout. Overwrites the default timeout for prompt-related operations from langchain4j.
      Parameters:
      promptsTimeout - prompts timeout
      Returns:
      updated builder instance
      See Also:
    • clearPingTimeout

      public BUILDER clearPingTimeout()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • pingTimeout

      public BUILDER pingTimeout(Duration pingTimeout)
      The timeout to apply when waiting for a ping response. Overwrites the default timeout when waiting for a ping response from langchain4j.
      Parameters:
      pingTimeout - ping timeout
      Returns:
      updated builder instance
      See Also:
    • clearReconnectInterval

      public BUILDER clearReconnectInterval()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • reconnectInterval

      public BUILDER reconnectInterval(Duration reconnectInterval)
      The delay before attempting to reconnect after a failed connection. Overwrites the default reconnect interval from langchain4j.
      Parameters:
      reconnectInterval - reconnect interval
      Returns:
      updated builder instance
      See Also:
    • clearToolExecutionTimeoutErrorMessage

      public BUILDER clearToolExecutionTimeoutErrorMessage()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • toolExecutionTimeoutErrorMessage

      public BUILDER toolExecutionTimeoutErrorMessage(String toolExecutionTimeoutErrorMessage)
      The error message to return when a tool execution times out. Overwrites the default error message from langchain4j.
      Parameters:
      toolExecutionTimeoutErrorMessage - time out error message
      Returns:
      updated builder instance
      See Also:
    • clearLogRequests

      public BUILDER clearLogRequests()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • logRequests

      public BUILDER logRequests(boolean logRequests)
      Whether to log request traffic.
      Parameters:
      logRequests - log request traffic
      Returns:
      updated builder instance
      See Also:
    • clearLogResponses

      public BUILDER clearLogResponses()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • logResponses

      public BUILDER logResponses(boolean logResponses)
      Whether to log response traffic.
      Parameters:
      logResponses - log response traffic
      Returns:
      updated builder instance
      See Also:
    • sseUri

      public Optional<URI> sseUri()
      The initial URI where to connect to the server and request a SSE channel.
      Returns:
      the sse uri
    • clientName

      public Optional<String> clientName()
      Sets the name that the client will use to identify itself to the MCP server in the initialization message. Overwrites the default client name from langchain4j.
      Returns:
      the client name
    • clientVersion

      public Optional<String> clientVersion()
      Sets the version string that the client will use to identify itself to the MCP server in the initialization message. Overwrites the default client version from langchain4j.
      Returns:
      the client version
    • key

      public Optional<String> key()
      Sets a unique identifier for the client. If none is provided, a UUID will be automatically generated. This key is later used to identify the client in the service registry.
      Returns:
      the key
    • protocolVersion

      public Optional<String> protocolVersion()
      Sets the protocol version that the client will advertise in the initialization message. Overwrites the default version from langchain4j.
      Returns:
      the protocol version
    • initializationTimeout

      public Optional<Duration> initializationTimeout()
      Sets the timeout for initializing the client. Overwrites the default timeout for initializing from langchain4j.
      Returns:
      the initialization timeout
    • toolExecutionTimeout

      public Optional<Duration> toolExecutionTimeout()
      Sets the timeout for tool execution. This value applies to each tool execution individually. A value of zero means no timeout. Overwrites the default timeout for tool execution from langchain4j.
      Returns:
      the tool execution timeout
    • resourcesTimeout

      public Optional<Duration> resourcesTimeout()
      Sets the timeout for resource-related operations (listing resources as well as reading the contents of a resource). A value of zero means no timeout. Overwrites the default timeout for resource-related operations from langchain4j.
      Returns:
      the resources timeout
    • promptsTimeout

      public Optional<Duration> promptsTimeout()
      The timeout for prompt-related operations (listing prompts as well as rendering the contents of a prompt). A value of zero means no timeout. Overwrites the default timeout for prompt-related operations from langchain4j.
      Returns:
      the prompts timeout
    • pingTimeout

      public Optional<Duration> pingTimeout()
      The timeout to apply when waiting for a ping response. Overwrites the default timeout when waiting for a ping response from langchain4j.
      Returns:
      the ping timeout
    • reconnectInterval

      public Optional<Duration> reconnectInterval()
      The delay before attempting to reconnect after a failed connection. Overwrites the default reconnect interval from langchain4j.
      Returns:
      the reconnect interval
    • toolExecutionTimeoutErrorMessage

      public Optional<String> toolExecutionTimeoutErrorMessage()
      The error message to return when a tool execution times out. Overwrites the default error message from langchain4j.
      Returns:
      the tool execution timeout error message
    • logRequests

      public Optional<Boolean> logRequests()
      Whether to log request traffic.
      Returns:
      the log requests
    • logResponses

      public Optional<Boolean> logResponses()
      Whether to log response traffic.
      Returns:
      the log responses
    • config

      public Optional<Config> config()
      If this instance was configured, this would be the config instance used.
      Returns:
      config node used to configure this builder, or empty if not configured
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • preBuildPrototype

      protected void preBuildPrototype()
      Handles providers and decorators.
    • validatePrototype

      protected void validatePrototype()
      Validates required properties.