Package dev.langchain4j.model.ollama
Class OllamaChatRequestParameters.Builder
java.lang.Object
dev.langchain4j.model.chat.request.DefaultChatRequestParameters.Builder<OllamaChatRequestParameters.Builder>
dev.langchain4j.model.ollama.OllamaChatRequestParameters.Builder
- Enclosing class:
OllamaChatRequestParameters
public static class OllamaChatRequestParameters.Builder
extends DefaultChatRequestParameters.Builder<OllamaChatRequestParameters.Builder>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Controls how long the model will stay loaded into memory following the requestAlternative to thetopP
, and aims to ensure a balance of quality and variety.Enable Mirostat sampling for controlling perplexity.mirostatEta
(Double mirostatEta) Influences how quickly the algorithm responds to feedback from the generated text.mirostatTau
(Double mirostatTau) Controls the balance between coherence and diversity of the output.overrideWith
(ChatRequestParameters parameters) repeatLastN
(Integer repeatLastN) repeatPenalty
(Double repeatPenalty) Methods inherited from class dev.langchain4j.model.chat.request.DefaultChatRequestParameters.Builder
frequencyPenalty, maxOutputTokens, modelName, presencePenalty, responseFormat, responseFormat, stopSequences, stopSequences, temperature, toolChoice, toolSpecifications, toolSpecifications, topK, topP
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
overrideWith
- Overrides:
overrideWith
in classDefaultChatRequestParameters.Builder<OllamaChatRequestParameters.Builder>
-
mirostat
Enable Mirostat sampling for controlling perplexity.Default: 0, 0 = disabled, 1 = Mirostat, 2 = Mirostat 2.0
- Returns:
- builder
-
mirostatEta
Influences how quickly the algorithm responds to feedback from the generated text.A lower learning rate will result in slower adjustments, while a higher learning rate will make the algorithm more responsive.
Default: 0.1
- Returns:
- builder
-
mirostatTau
Controls the balance between coherence and diversity of the output.A lower value will result in more focused and coherent text.
Default: 5.0
- Returns:
- builder
-
numCtx
-
repeatLastN
-
repeatPenalty
-
seed
-
minP
Alternative to thetopP
, and aims to ensure a balance of quality and variety. The parameter p represents the minimum probability for a token to be considered, relative to the probability of the most likely token.For example, with p=0.05 and the most likely token having a probability of 0.9, logits with a value less than 0.045 are filtered out.
Default: 0.0
- Returns:
- builder
-
keepAlive
Controls how long the model will stay loaded into memory following the requestDefault: 5m
- Returns:
- builder
-
build
- Overrides:
build
in classDefaultChatRequestParameters.Builder<OllamaChatRequestParameters.Builder>
-