Class OllamaChatOptions
java.lang.Object
org.springframework.ai.ollama.api.OllamaChatOptions
- All Implemented Interfaces:
ChatOptions,ModelOptions,StructuredOutputChatOptions,ToolCallingChatOptions
public class OllamaChatOptions
extends Object
implements ToolCallingChatOptions, StructuredOutputChatOptions
Helper class for creating strongly-typed Ollama options.
- Since:
- 0.8.0
- Author:
- Christian Tzolov, Thomas Vitale, Ilayaperumal Gopinathan, Nicolas Krier
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface org.springframework.ai.model.tool.ToolCallingChatOptions
DEFAULT_TOOL_EXECUTION_ENABLED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic OllamaChatOptions.Builderbuilder()copy()booleanfilterNonSupportedFields(Map<String, Object> options) Filter out the non-supported fields from the options.static OllamaChatOptionsfromOptions(OllamaChatOptions fromOptions) getF16KV()getMinP()getModel()getSeed()getStop()getTfsZ()getTopK()getTopP()inthashCode()voidvoidvoidsetFrequencyPenalty(Double frequencyPenalty) voidsetInternalToolExecutionEnabled(Boolean internalToolExecutionEnabled) voidsetKeepAlive(String keepAlive) voidsetLogitsAll(Boolean logitsAll) voidsetLowVRAM(Boolean lowVRAM) voidsetMainGPU(Integer mainGPU) voidsetMaxTokens(Integer maxTokens) voidvoidsetMirostat(Integer mirostat) voidsetMirostatEta(Float mirostatEta) voidsetMirostatTau(Float mirostatTau) voidvoidsetNumBatch(Integer numBatch) voidvoidvoidsetNumKeep(Integer numKeep) voidsetNumPredict(Integer numPredict) voidsetNumThread(Integer numThread) voidsetOutputSchema(String outputSchema) voidsetPenalizeNewline(Boolean penalizeNewline) voidsetPresencePenalty(Double presencePenalty) voidsetRepeatLastN(Integer repeatLastN) voidsetRepeatPenalty(Double repeatPenalty) voidvoidvoidsetStopSequences(List<String> stopSequences) voidsetTemperature(Double temperature) voidvoidsetThinkOption(ThinkOption thinkOption) voidsetToolCallbacks(List<ToolCallback> toolCallbacks) voidsetToolContext(Map<String, Object> toolContext) voidsetToolNames(Set<String> toolNames) voidvoidvoidsetTruncate(Boolean truncate) voidsetTypicalP(Float typicalP) voidsetUseMLock(Boolean useMLock) voidsetUseMMap(Boolean useMMap) voidsetUseNUMA(Boolean useNUMA) voidsetVocabOnly(Boolean vocabOnly) toMap()Convert theOllamaChatOptionsobject to aMapof key/value pairs.
-
Constructor Details
-
OllamaChatOptions
public OllamaChatOptions()
-
-
Method Details
-
builder
-
filterNonSupportedFields
Filter out the non-supported fields from the options.- Parameters:
options- The options to filter.- Returns:
- The filtered options.
-
fromOptions
-
getModel
- Specified by:
getModelin interfaceChatOptions
-
setModel
-
getFormat
-
setFormat
-
getKeepAlive
-
setKeepAlive
-
getUseNUMA
-
setUseNUMA
-
getNumCtx
-
setNumCtx
-
getNumBatch
-
setNumBatch
-
getNumGPU
-
setNumGPU
-
getMainGPU
-
setMainGPU
-
getLowVRAM
-
setLowVRAM
-
getF16KV
-
setF16KV
-
getLogitsAll
-
setLogitsAll
-
getVocabOnly
-
setVocabOnly
-
getUseMMap
-
setUseMMap
-
getUseMLock
-
setUseMLock
-
getNumThread
-
setNumThread
-
getNumKeep
-
setNumKeep
-
getSeed
-
setSeed
-
getMaxTokens
- Specified by:
getMaxTokensin interfaceChatOptions
-
setMaxTokens
-
getNumPredict
-
setNumPredict
-
getTopK
- Specified by:
getTopKin interfaceChatOptions
-
setTopK
-
getTopP
- Specified by:
getTopPin interfaceChatOptions
-
setTopP
-
getMinP
-
setMinP
-
getTfsZ
-
setTfsZ
-
getTypicalP
-
setTypicalP
-
getRepeatLastN
-
setRepeatLastN
-
getTemperature
- Specified by:
getTemperaturein interfaceChatOptions
-
setTemperature
-
getRepeatPenalty
-
setRepeatPenalty
-
getPresencePenalty
- Specified by:
getPresencePenaltyin interfaceChatOptions
-
setPresencePenalty
-
getFrequencyPenalty
- Specified by:
getFrequencyPenaltyin interfaceChatOptions
-
setFrequencyPenalty
-
getMirostat
-
setMirostat
-
getMirostatTau
-
setMirostatTau
-
getMirostatEta
-
setMirostatEta
-
getPenalizeNewline
-
setPenalizeNewline
-
getStopSequences
- Specified by:
getStopSequencesin interfaceChatOptions
-
setStopSequences
-
getStop
-
setStop
-
getTruncate
-
setTruncate
-
getThinkOption
-
setThinkOption
-
getToolCallbacks
- Specified by:
getToolCallbacksin interfaceToolCallingChatOptions
-
setToolCallbacks
- Specified by:
setToolCallbacksin interfaceToolCallingChatOptions
-
getToolNames
- Specified by:
getToolNamesin interfaceToolCallingChatOptions
-
setToolNames
- Specified by:
setToolNamesin interfaceToolCallingChatOptions
-
getInternalToolExecutionEnabled
- Specified by:
getInternalToolExecutionEnabledin interfaceToolCallingChatOptions
-
setInternalToolExecutionEnabled
- Specified by:
setInternalToolExecutionEnabledin interfaceToolCallingChatOptions
-
getToolContext
- Specified by:
getToolContextin interfaceToolCallingChatOptions
-
setToolContext
- Specified by:
setToolContextin interfaceToolCallingChatOptions
-
getOutputSchema
- Specified by:
getOutputSchemain interfaceStructuredOutputChatOptions
-
setOutputSchema
- Specified by:
setOutputSchemain interfaceStructuredOutputChatOptions
-
toMap
Convert theOllamaChatOptionsobject to aMapof key/value pairs.- Returns:
- The
Mapof key/value pairs.
-
copy
- Specified by:
copyin interfaceChatOptions
-
equals
-
hashCode
public int hashCode()
-