Package dev.langchain4j.model.ollama
Class OllamaLanguageModel.OllamaLanguageModelBuilder
java.lang.Object
dev.langchain4j.model.ollama.OllamaLanguageModel.OllamaLanguageModelBuilder
- Enclosing class:
OllamaLanguageModel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
customHeaders
(Map<String, String> customHeaders) Deprecated, for removal: This API element is subject to removal in a future version.httpClientBuilder
(HttpClientBuilder httpClientBuilder) Sets theHttpClientBuilder
that will be used to create theHttpClient
that will be used to communicate with Ollama.logRequests
(Boolean logRequests) logResponses
(Boolean logResponses) maxRetries
(Integer maxRetries) numPredict
(Integer numPredict) repeatPenalty
(Double repeatPenalty) responseFormat
(ResponseFormat responseFormat) temperature
(Double temperature)
-
Constructor Details
-
OllamaLanguageModelBuilder
public OllamaLanguageModelBuilder()
-
-
Method Details
-
httpClientBuilder
public OllamaLanguageModel.OllamaLanguageModelBuilder httpClientBuilder(HttpClientBuilder httpClientBuilder) Sets theHttpClientBuilder
that will be used to create theHttpClient
that will be used to communicate with Ollama.NOTE:
timeout(Duration)
overrides timeouts set on theHttpClientBuilder
. -
baseUrl
-
modelName
-
temperature
-
topK
-
topP
-
repeatPenalty
-
seed
-
numPredict
-
numCtx
-
stop
-
format
@Deprecated(forRemoval=true, since="1.0.0-beta5") public OllamaLanguageModel.OllamaLanguageModelBuilder format(String format) Deprecated, for removal: This API element is subject to removal in a future version.Please useresponseFormat(ResponseFormat)
instead. For example:responseFormat(ResponseFormat.JSON)
.
Instead of using JSON mode, consider using structured outputs with JSON schema instead, see more info here. -
responseFormat
-
timeout
-
maxRetries
-
logRequests
-
logResponses
-
customHeaders
public OllamaLanguageModel.OllamaLanguageModelBuilder customHeaders(Map<String, String> customHeaders) -
build
-
responseFormat(ResponseFormat)
instead.