Class OllamaOptions
java.lang.Object
org.springframework.ai.ollama.api.OllamaOptions
- All Implemented Interfaces:
ChatOptions,EmbeddingOptions,FunctionCallingOptions,ModelOptions,ToolCallingChatOptions
Helper class for creating strongly-typed Ollama options.
- Since:
- 0.8.0
- Author:
- Christian Tzolov, Thomas Vitale, Ilayaperumal Gopinathan
- 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 OllamaOptions.Builderbuilder()copy()booleanfilterNonSupportedFields(Map<String, Object> options) Filter out the non-supported fields from the options.static OllamaOptionsfromOptions(OllamaOptions fromOptions) getF16KV()Deprecated.Deprecated.getModel()Deprecated.getSeed()getStop()getTfsZ()getTopK()getTopP()inthashCode()voidvoidvoidsetFrequencyPenalty(Double frequencyPenalty) voidsetFunctionCallbacks(List<FunctionCallback> functionCallbacks) Deprecated.voidsetFunctions(Set<String> functions) Deprecated.voidsetInternalToolExecutionEnabled(Boolean internalToolExecutionEnabled) voidsetKeepAlive(String keepAlive) voidsetLogitsAll(Boolean logitsAll) voidsetLowVRAM(Boolean lowVRAM) voidsetMainGPU(Integer mainGPU) voidsetMaxTokens(Integer maxTokens) voidsetMirostat(Integer mirostat) voidsetMirostatEta(Float mirostatEta) voidsetMirostatTau(Float mirostatTau) voidvoidsetNumBatch(Integer numBatch) voidvoidvoidsetNumKeep(Integer numKeep) voidsetNumPredict(Integer numPredict) voidsetNumThread(Integer numThread) voidsetPenalizeNewline(Boolean penalizeNewline) voidsetPresencePenalty(Double presencePenalty) voidsetProxyToolCalls(Boolean proxyToolCalls) Deprecated.voidsetRepeatLastN(Integer repeatLastN) voidsetRepeatPenalty(Double repeatPenalty) voidvoidvoidsetStopSequences(List<String> stopSequences) voidsetTemperature(Double temperature) voidvoidsetToolCallbacks(List<FunctionCallback> 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 theOllamaOptionsobject to aMapof key/value pairs.
-
Constructor Details
-
OllamaOptions
public OllamaOptions()
-
-
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- Specified by:
getModelin interfaceEmbeddingOptions
-
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
-
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
-
getToolCallbacks
- Specified by:
getToolCallbacksin interfaceToolCallingChatOptions
-
setToolCallbacks
- Specified by:
setToolCallbacksin interfaceToolCallingChatOptions
-
getToolNames
- Specified by:
getToolNamesin interfaceToolCallingChatOptions
-
setToolNames
- Specified by:
setToolNamesin interfaceToolCallingChatOptions
-
isInternalToolExecutionEnabled
- Specified by:
isInternalToolExecutionEnabledin interfaceToolCallingChatOptions
-
setInternalToolExecutionEnabled
- Specified by:
setInternalToolExecutionEnabledin interfaceToolCallingChatOptions
-
getFunctionCallbacks
Deprecated.- Specified by:
getFunctionCallbacksin interfaceFunctionCallingOptions
-
setFunctionCallbacks
Deprecated.- Specified by:
setFunctionCallbacksin interfaceFunctionCallingOptions
-
getFunctions
Deprecated.- Specified by:
getFunctionsin interfaceFunctionCallingOptions
-
setFunctions
Deprecated.- Specified by:
setFunctionsin interfaceFunctionCallingOptions
-
getDimensions
- Specified by:
getDimensionsin interfaceEmbeddingOptions
-
getProxyToolCalls
Deprecated.- Specified by:
getProxyToolCallsin interfaceFunctionCallingOptions
-
setProxyToolCalls
Deprecated.- Specified by:
setProxyToolCallsin interfaceFunctionCallingOptions
-
getToolContext
- Specified by:
getToolContextin interfaceFunctionCallingOptions
-
setToolContext
- Specified by:
setToolContextin interfaceFunctionCallingOptions
-
toMap
Convert theOllamaOptionsobject to aMapof key/value pairs.- Returns:
- The
Mapof key/value pairs.
-
copy
- Specified by:
copyin interfaceChatOptions
-
equals
-
hashCode
public int hashCode()
-