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
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe implementation version for this class. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for POF and JSON serialization. -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets the Anthropic API key.Gets the Anthropic API base URL.intDetermine the serialization version supported by the implementing class.Gets the maximum number of retry attempts.Gets the maximum number of tokens to generate.Gets the model name to be used by the chat model.Gets the organization ID.Gets the temperature value that affects randomness in response generation.Gets the request timeout duration.getTopK()Gets the top-k sampling value.getTopP()Gets the top-p (nucleus sampling) value.inthashCode()Returns whether API requests should be logged.Returns whether API responses should be logged.voidRestore the contents of a user type instance by reading its state using the specified PofReader object.Sets the Anthropic API key.setBaseUrl(String baseUrl) Sets the Anthropic API base URL.setLogRequests(Boolean logRequests) Enables or disables logging of API requests.setLogResponses(Boolean logResponses) Enables or disables logging of API responses.setMaxRetries(Integer maxRetries) Sets the maximum number of retry attempts.setMaxTokens(Integer maxTokens) Sets the maximum number of tokens to generate.setModelName(String modelName) Sets the model name to be used by the chat model.setOrganizationId(String organizationId) Sets the organization ID.setTemperature(Double temperature) Sets the temperature value that affects randomness in response generation.setTimeout(Duration timeout) Sets the request timeout duration.Sets the top-k sampling value.Sets the top-p (nucleus sampling) value.dev.langchain4j.model.anthropic.AnthropicChatModel.AnthropicChatModelBuilderConverts this configuration to a strongly-typed builder instance.toString()voidwriteExternal(PofWriter out) Save the contents of a POF user type instance by writing its state using the specified PofWriter object.Methods inherited from class com.oracle.coherence.rag.config.AbstractConfig
apply, getDataVersionMethods inherited from class com.tangosol.io.AbstractEvolvable
getFutureData, setDataVersion, setFutureData
-
Field Details
-
IMPLEMENTATION_VERSION
public static final int IMPLEMENTATION_VERSIONThe implementation version for this class.- See Also:
-
-
Constructor Details
-
AnthropicChatModelConfig
public AnthropicChatModelConfig()Default constructor for POF and JSON serialization.
-
-
Method Details
-
getBaseUrl
Gets the Anthropic API base URL.- Returns:
- the base URL to use for API requests
-
setBaseUrl
Sets the Anthropic API base URL.- Parameters:
baseUrl- the base URL to use for API requests- Returns:
- this config instance for method chaining
-
getApiKey
-
setApiKey
Sets the Anthropic API key.- Parameters:
apiKey- the API key- Returns:
- this config instance for method chaining
-
getOrganizationId
-
setOrganizationId
Sets the organization ID.- Parameters:
organizationId- the organization ID- Returns:
- this config instance for method chaining
-
getModelName
Gets the model name to be used by the chat model.- Returns:
- the model name
-
setModelName
Sets the model name to be used by the chat model.- Parameters:
modelName- the model name- Returns:
- this config instance for method chaining
-
getTemperature
Gets the temperature value that affects randomness in response generation.- Returns:
- the temperature
-
setTemperature
Sets the temperature value that affects randomness in response generation.- Parameters:
temperature- the temperature to use- Returns:
- this config instance for method chaining
-
getTopP
-
setTopP
Sets the top-p (nucleus sampling) value.- Parameters:
topP- the top-p value to use- Returns:
- this config instance for method chaining
-
getTopK
-
setTopK
Sets the top-k sampling value.- Parameters:
topK- the top-k value to use- Returns:
- this config instance for method chaining
-
getMaxTokens
Gets the maximum number of tokens to generate.- Returns:
- the maximum token count
-
setMaxTokens
Sets the maximum number of tokens to generate.- Parameters:
maxTokens- the maximum token count- Returns:
- this config instance for method chaining
-
getTimeout
-
setTimeout
Sets the request timeout duration.- Parameters:
timeout- the timeout duration- Returns:
- this config instance for method chaining
-
getMaxRetries
-
setMaxRetries
Sets the maximum number of retry attempts.- Parameters:
maxRetries- the retry count- Returns:
- this config instance for method chaining
-
isLogRequests
Returns whether API requests should be logged.- Returns:
- true if request logging is enabled
-
setLogRequests
Enables or disables logging of API requests.- Parameters:
logRequests- whether to log requests- Returns:
- this config instance for method chaining
-
isLogResponses
Returns whether API responses should be logged.- Returns:
- true if response logging is enabled
-
setLogResponses
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
-
hashCode
-
toString
-
getImplVersion
public int getImplVersion()Description copied from class:AbstractEvolvableDetermine the serialization version supported by the implementing class.- Specified by:
getImplVersionin interfaceEvolvable- Overrides:
getImplVersionin classAbstractConfig- Returns:
- the serialization version supported by this object
-
readExternal
Description copied from interface:PortableObjectRestore the contents of a user type instance by reading its state using the specified PofReader object.- Specified by:
readExternalin interfacePortableObject- Parameters:
in- the PofReader from which to read the object's state- Throws:
IOException- if an I/O error occurs
-
writeExternal
Description copied from interface:PortableObjectSave the contents of a POF user type instance by writing its state using the specified PofWriter object.- Specified by:
writeExternalin interfacePortableObject- Parameters:
out- the PofWriter to which to write the object's state- Throws:
IOException- if an I/O error occurs
-