Class AnthropicChatModelConfig

java.lang.Object
com.tangosol.io.AbstractEvolvable
com.oracle.coherence.rag.config.AbstractConfig
com.oracle.coherence.rag.model.anthropic.config.AnthropicChatModelConfig
All Implemented Interfaces:
Evolvable, PortableObject

public class AnthropicChatModelConfig extends AbstractConfig implements PortableObject
Configuration class for Anthropic chat model.

Encapsulates configuration parameters that control how Anthropic chat models are used within the Coherence RAG framework.

Since:
25.09
Author:
Aleks Seovic/ Tim Middleton 2025.08.05
  • Field Details

    • IMPLEMENTATION_VERSION

      public static final int IMPLEMENTATION_VERSION
      The implementation version for this class.
      See Also:
  • Constructor Details

    • AnthropicChatModelConfig

      public AnthropicChatModelConfig()
      Default constructor for POF and JSON serialization.
  • Method Details

    • getBaseUrl

      public String getBaseUrl()
      Gets the Anthropic API base URL.
      Returns:
      the base URL to use for API requests
    • setBaseUrl

      public AnthropicChatModelConfig setBaseUrl(String baseUrl)
      Sets the Anthropic API base URL.
      Parameters:
      baseUrl - the base URL to use for API requests
      Returns:
      this config instance for method chaining
    • getApiKey

      public String getApiKey()
      Gets the Anthropic API key.
      Returns:
      the API key
    • setApiKey

      public AnthropicChatModelConfig setApiKey(String apiKey)
      Sets the Anthropic API key.
      Parameters:
      apiKey - the API key
      Returns:
      this config instance for method chaining
    • getOrganizationId

      public String getOrganizationId()
      Gets the organization ID.
      Returns:
      the organization ID
    • setOrganizationId

      public AnthropicChatModelConfig setOrganizationId(String organizationId)
      Sets the organization ID.
      Parameters:
      organizationId - the organization ID
      Returns:
      this config instance for method chaining
    • getModelName

      public String getModelName()
      Gets the model name to be used by the chat model.
      Returns:
      the model name
    • setModelName

      public AnthropicChatModelConfig setModelName(String modelName)
      Sets the model name to be used by the chat model.
      Parameters:
      modelName - the model name
      Returns:
      this config instance for method chaining
    • getTemperature

      public Double getTemperature()
      Gets the temperature value that affects randomness in response generation.
      Returns:
      the temperature
    • setTemperature

      public AnthropicChatModelConfig setTemperature(Double temperature)
      Sets the temperature value that affects randomness in response generation.
      Parameters:
      temperature - the temperature to use
      Returns:
      this config instance for method chaining
    • getTopP

      public Double getTopP()
      Gets the top-p (nucleus sampling) value.
      Returns:
      the top-p value
    • setTopP

      public AnthropicChatModelConfig setTopP(Double topP)
      Sets the top-p (nucleus sampling) value.
      Parameters:
      topP - the top-p value to use
      Returns:
      this config instance for method chaining
    • getTopK

      public Integer getTopK()
      Gets the top-k sampling value.
      Returns:
      the top-k sampling value
    • setTopK

      public AnthropicChatModelConfig setTopK(Integer topK)
      Sets the top-k sampling value.
      Parameters:
      topK - the top-k value to use
      Returns:
      this config instance for method chaining
    • getMaxTokens

      public Integer getMaxTokens()
      Gets the maximum number of tokens to generate.
      Returns:
      the maximum token count
    • setMaxTokens

      public AnthropicChatModelConfig setMaxTokens(Integer maxTokens)
      Sets the maximum number of tokens to generate.
      Parameters:
      maxTokens - the maximum token count
      Returns:
      this config instance for method chaining
    • getTimeout

      public Duration getTimeout()
      Gets the request timeout duration.
      Returns:
      the timeout duration
    • setTimeout

      public AnthropicChatModelConfig setTimeout(Duration timeout)
      Sets the request timeout duration.
      Parameters:
      timeout - the timeout duration
      Returns:
      this config instance for method chaining
    • getMaxRetries

      public Integer getMaxRetries()
      Gets the maximum number of retry attempts.
      Returns:
      the retry count
    • setMaxRetries

      public AnthropicChatModelConfig setMaxRetries(Integer maxRetries)
      Sets the maximum number of retry attempts.
      Parameters:
      maxRetries - the retry count
      Returns:
      this config instance for method chaining
    • isLogRequests

      public Boolean isLogRequests()
      Returns whether API requests should be logged.
      Returns:
      true if request logging is enabled
    • setLogRequests

      public AnthropicChatModelConfig setLogRequests(Boolean logRequests)
      Enables or disables logging of API requests.
      Parameters:
      logRequests - whether to log requests
      Returns:
      this config instance for method chaining
    • isLogResponses

      public Boolean isLogResponses()
      Returns whether API responses should be logged.
      Returns:
      true if response logging is enabled
    • setLogResponses

      public AnthropicChatModelConfig setLogResponses(Boolean logResponses)
      Enables or disables logging of API responses.
      Parameters:
      logResponses - whether to log responses
      Returns:
      this config instance for method chaining
    • toBuilder

      public dev.langchain4j.model.anthropic.AnthropicChatModel.AnthropicChatModelBuilder toBuilder()
      Converts this configuration to a strongly-typed builder instance.
      Returns:
      a configured AnthropicChatModel.AnthropicChatModelBuilder
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

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

      public int getImplVersion()
      Description copied from class: AbstractEvolvable
      Determine the serialization version supported by the implementing class.
      Specified by:
      getImplVersion in interface Evolvable
      Overrides:
      getImplVersion in class AbstractConfig
      Returns:
      the serialization version supported by this object
    • readExternal

      public void readExternal(PofReader in) throws IOException
      Description copied from interface: PortableObject
      Restore the contents of a user type instance by reading its state using the specified PofReader object.
      Specified by:
      readExternal in interface PortableObject
      Parameters:
      in - the PofReader from which to read the object's state
      Throws:
      IOException - if an I/O error occurs
    • writeExternal

      public void writeExternal(PofWriter out) throws IOException
      Description copied from interface: PortableObject
      Save the contents of a POF user type instance by writing its state using the specified PofWriter object.
      Specified by:
      writeExternal in interface PortableObject
      Parameters:
      out - the PofWriter to which to write the object's state
      Throws:
      IOException - if an I/O error occurs