Class OllamaChatOptions.AbstractBuilder<B extends OllamaChatOptions.AbstractBuilder<B>>
java.lang.Object
org.springframework.ai.chat.prompt.DefaultChatOptionsBuilder<B>
org.springframework.ai.model.tool.DefaultToolCallingChatOptions.Builder<B>
org.springframework.ai.ollama.api.OllamaChatOptions.AbstractBuilder<B>
- All Implemented Interfaces:
Cloneable,ChatOptions.Builder<B>,StructuredOutputChatOptions.Builder<B>,ToolCallingChatOptions.Builder<B>
- Direct Known Subclasses:
OllamaChatOptions.Builder
- Enclosing class:
- OllamaChatOptions
protected abstract static class OllamaChatOptions.AbstractBuilder<B extends OllamaChatOptions.AbstractBuilder<B>>
extends DefaultToolCallingChatOptions.Builder<B>
implements StructuredOutputChatOptions.Builder<B>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected @Nullable Booleanprotected @Nullable Objectprotected @Nullable Stringprotected @Nullable Booleanprotected @Nullable Booleanprotected @Nullable Integerprotected @Nullable Doubleprotected @Nullable Integerprotected @Nullable Floatprotected @Nullable Floatprotected @Nullable Integerprotected @Nullable Integerprotected @Nullable Integerprotected @Nullable Integerprotected @Nullable Integerprotected @Nullable Booleanprotected @Nullable Integerprotected @Nullable Doubleprotected @Nullable Integerprotected @Nullable Floatprotected @Nullable ThinkOptionprotected @Nullable Booleanprotected @Nullable Floatprotected @Nullable Booleanprotected @Nullable Booleanprotected @Nullable Booleanprotected @Nullable BooleanFields inherited from class org.springframework.ai.model.tool.DefaultToolCallingChatOptions.Builder
toolCallbacks, toolContextFields inherited from class org.springframework.ai.chat.prompt.DefaultChatOptionsBuilder
frequencyPenalty, maxTokens, model, presencePenalty, stopSequences, temperature, topK, topP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build theChatOptions.combineWith(ChatOptions.Builder<?> other) Mutate this builder by taking allother's values that are non-null, retainingthisother values.Disable thinking mode for the model.Enable thinking mode for the model.mirostatEta(@Nullable Float mirostatEta) mirostatTau(@Nullable Float mirostatTau) model(@Nullable OllamaModel model) numPredict(@Nullable Integer numPredict) outputSchema(@Nullable String outputSchema) penalizeNewline(@Nullable Boolean penalizeNewline) repeatLastN(@Nullable Integer repeatLastN) repeatPenalty(@Nullable Double repeatPenalty) Set thinking level to "high" (for GPT-OSS model).thinkLow()Set thinking level to "low" (for GPT-OSS model).Set thinking level to "medium" (for GPT-OSS model).thinkOption(@Nullable ThinkOption thinkOption) Set the think option explicitly.Methods inherited from class org.springframework.ai.model.tool.DefaultToolCallingChatOptions.Builder
clone, toolCallbacks, toolCallbacks, toolContext, toolContextMethods inherited from class org.springframework.ai.chat.prompt.DefaultChatOptionsBuilder
frequencyPenalty, maxTokens, model, presencePenalty, self, stopSequences, temperature, topK, topPMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.ai.chat.prompt.ChatOptions.Builder
cloneMethods inherited from interface org.springframework.ai.model.tool.ToolCallingChatOptions.Builder
frequencyPenalty, maxTokens, model, presencePenalty, stopSequences, temperature, topK, topP
-
Field Details
-
useNUMA
-
numCtx
-
numBatch
-
numGPU
-
mainGPU
-
lowVRAM
-
f16KV
-
logitsAll
-
vocabOnly
-
useMMap
-
useMLock
-
numThread
-
numKeep
-
seed
-
minP
-
tfsZ
-
typicalP
-
repeatLastN
-
repeatPenalty
-
mirostat
-
mirostatTau
-
mirostatEta
-
penalizeNewline
-
format
-
keepAlive
-
truncate
-
thinkOption
-
-
Constructor Details
-
AbstractBuilder
protected AbstractBuilder()
-
-
Method Details
-
combineWith
Description copied from interface:ChatOptions.BuilderMutate this builder by taking allother's values that are non-null, retainingthisother values.- Specified by:
combineWithin interfaceChatOptions.Builder<B extends OllamaChatOptions.AbstractBuilder<B>>- Overrides:
combineWithin classDefaultToolCallingChatOptions.Builder<B extends OllamaChatOptions.AbstractBuilder<B>>
-
model
-
numPredict
-
stop
-
format
-
keepAlive
-
truncate
-
useNUMA
-
numCtx
-
numBatch
-
numGPU
-
mainGPU
-
lowVRAM
-
f16KV
-
logitsAll
-
vocabOnly
-
useMMap
-
useMLock
-
numThread
-
numKeep
-
seed
-
minP
-
tfsZ
-
typicalP
-
repeatLastN
-
repeatPenalty
-
mirostat
-
mirostatTau
-
mirostatEta
-
penalizeNewline
-
enableThinking
Enable thinking mode for the model. The model will include its reasoning process in the response's thinking field.Supported by models: Qwen 3, DeepSeek-v3.1, DeepSeek R1
- Returns:
- this builder
- See Also:
-
disableThinking
Disable thinking mode for the model.- Returns:
- this builder
- See Also:
-
thinkLow
Set thinking level to "low" (for GPT-OSS model).GPT-OSS requires one of: low, medium, high. Boolean enable/disable is not supported for this model.
- Returns:
- this builder
- See Also:
-
thinkMedium
Set thinking level to "medium" (for GPT-OSS model).- Returns:
- this builder
- See Also:
-
thinkHigh
Set thinking level to "high" (for GPT-OSS model).- Returns:
- this builder
- See Also:
-
thinkOption
Set the think option explicitly. UseenableThinking(),disableThinking(),thinkLow(),thinkMedium(), orthinkHigh()for more convenient alternatives.- Parameters:
thinkOption- the think option- Returns:
- this builder
-
outputSchema
- Specified by:
outputSchemain interfaceStructuredOutputChatOptions.Builder<B extends OllamaChatOptions.AbstractBuilder<B>>
-
build
Description copied from interface:ChatOptions.BuilderBuild theChatOptions.- Specified by:
buildin interfaceChatOptions.Builder<B extends OllamaChatOptions.AbstractBuilder<B>>- Specified by:
buildin interfaceToolCallingChatOptions.Builder<B extends OllamaChatOptions.AbstractBuilder<B>>- Overrides:
buildin classDefaultToolCallingChatOptions.Builder<B extends OllamaChatOptions.AbstractBuilder<B>>- Returns:
- the Chat options.
-