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

      @Deprecated(since="4.4.0", forRemoval=true) public BUILDER sseUri(URI sseUri)
      Deprecated, for removal: This API element is subject to removal in a future version.
      This option is deprecated, use uri instead
      The initial URI where to connect to the server and request an SSE channel.
      Parameters:
      sseUri - sse uri
      Returns:
      updated builder instance
      See Also:
    • uri

      public BUILDER uri(URI uri)
      The URL of the MCP server.
      Parameters:
      uri - mcp server uri
      Returns:
      updated builder instance
      See Also:
    • clearClientName

      public BUILDER clearClientName()
      Clear existing value of clientName.
      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 clientVersion.
      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 key.
      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 protocolVersion.
      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 initializationTimeout.
      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 timeout
      Returns:
      updated builder instance
      See Also:
    • clearToolExecutionTimeout

      public BUILDER clearToolExecutionTimeout()
      Clear existing value of toolExecutionTimeout.
      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 seconds means no timeout. Overwrites the default timeout for tool execution from langchain4j.
      Parameters:
      toolExecutionTimeout - tool execution timeout
      Returns:
      updated builder instance
      See Also:
    • clearResourcesTimeout

      public BUILDER clearResourcesTimeout()
      Clear existing value of resourcesTimeout.
      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 seconds 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 promptsTimeout.
      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 seconds 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 pingTimeout.
      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 reconnectInterval.
      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 toolExecutionTimeoutErrorMessage.
      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 logRequests.
      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 logResponses.
      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

      @Deprecated(since="4.4.0", forRemoval=true) public Optional<URI> sseUri()
      Deprecated, for removal: This API element is subject to removal in a future version.
      This option is deprecated, use uri instead
      The initial URI where to connect to the server and request an SSE channel.
      Returns:
      sse uri
    • uri

      public Optional<URI> uri()
      The URL of the MCP server.
      Returns:
      mcp server 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:
      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:
      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:
      client 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:
      protocol version
    • initializationTimeout

      public Optional<Duration> initializationTimeout()
      Sets the timeout for initializing the client. Overwrites the default timeout for initializing from langchain4j.
      Returns:
      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 seconds means no timeout. Overwrites the default timeout for tool execution from langchain4j.
      Returns:
      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 seconds means no timeout. Overwrites the default timeout for resource-related operations from langchain4j.
      Returns:
      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 seconds means no timeout. Overwrites the default timeout for prompt-related operations from langchain4j.
      Returns:
      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:
      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:
      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:
      time out error message
    • logRequests

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

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

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

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

      protected void validatePrototype()
      Validates required properties.
    • config

      protected Optional<Config> config()
      Configuration used to configure this instance.
      Returns:
      config instance