Interface ChatModelConfig
public interface ChatModelConfig
-
Method Summary
Modifier and TypeMethodDescriptionWhether chat model requests should be loggedWhether chat model responses should be loggedDeprecated.Using the fault tolerance mechanisms built in Langchain4j is not recommended.The maximum number of tokens to generate in the completion.Model name to useThe custom text sequences that will cause the model to stop generatingWhat sampling temperature to use, between 0.0 and 1.0.topK()Reduces the probability of generating nonsense.topP()Double (0.0-1.0).
-
Method Details
-
modelName
Model name to use -
temperature
What sampling temperature to use, between 0.0 and 1.0. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.It is generally recommended to set this or the
top-kproperty but not both. -
maxTokens
The maximum number of tokens to generate in the completion.The token count of your prompt plus
max_tokenscannot exceed the model's context length -
topP
Double (0.0-1.0). Nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.It is generally recommended to set this or the
temperatureproperty but not both. -
topK
Reduces the probability of generating nonsense. A higher value (e.g. 100) will give more diverse answers, while a lower value (e.g. 10) will be more conservative -
maxRetries
Deprecated.Using the fault tolerance mechanisms built in Langchain4j is not recommended. If possible, use MicroProfile Fault Tolerance instead.The maximum number of times to retry. 1 means exactly one attempt, with retrying disabled. -
stopSequences
The custom text sequences that will cause the model to stop generating -
logRequests
@ConfigDocDefault("false") @WithDefault("${quarkus.langchain4j.anthropic.log-requests}") Optional<Boolean> logRequests()Whether chat model requests should be logged -
logResponses
@ConfigDocDefault("false") @WithDefault("${quarkus.langchain4j.anthropic.log-responses}") Optional<Boolean> logResponses()Whether chat model responses should be logged
-