AS AgentScopeAPI 手册 / API Reference

OllamaOptions

@JsonInclude(Include.NON_NULL) public class OllamaOptions
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:41–1350

Ollama 选项,保存相关配置项。位于 io.agentscope.extensions.model.ollama.options 包。核心成员包括 builder、fromOptions、fromGenerateOptions、toGenerateOptions、getModel、setModel。

AgentScope implementation of Ollama model configuration options. Provides a strongly-typed builder for setting model parameters such as temperature, context size, and penalties.

This class maps to the Ollama API parameters for model creation and inference. It supports both advanced model loading parameters (like GPU offloading, memory management) and runtime generation options (like sampling parameters, penalties).

The class provides utility methods for conversion to/from generic GenerateOptions, allowing seamless integration with AgentScope's general model interface.

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
ParamKey枚举enum
定义参数键相关取值的枚举。
Keys for Ollama parameters.
Builder类class
构建器,用于构建并配置目标实例。
A class in io.agentscope.extensions.model.ollama.options that talks to model services and returns generated or embedded output.

方法摘要Method Summary

方法Method说明Description
public static Builder builder()
static
返回构建器实例。
Returns the builder.
public static OllamaOptions fromOptions(OllamaOptions fromOptions)
static
设置来自选项。
Performs the from options operation.
public static OllamaOptions fromGenerateOptions(GenerateOptions genOptions)
static
转换泛型`GenerateOptions`到`OllamaOptions`。
Converts generic `GenerateOptions` to `OllamaOptions`.
public GenerateOptions toGenerateOptions()
转换此`OllamaOptions`到泛型`GenerateOptions`。
Converts this `OllamaOptions` to generic `GenerateOptions`.
public String getModel()
获取模型。
Returns the model.
public void setModel(String model)
设置模型。
Sets the model.
public Object getFormat()
获取格式。
Returns the format.
public void setFormat(Object format)
设置格式。
Sets the format.
public String getKeepAlive()
获取 `getKeepAlive`。
Returns the keep alive.
public void setKeepAlive(String keepAlive)
设置 `setKeepAlive`。
Sets the keep alive.
public Boolean getUseNUMA()
获取使用 NUMA。
Returns the use NUMA.
public void setUseNUMA(Boolean useNUMA)
设置使用 NUMA。
Sets the use NUMA.
public Integer getNumCtx()
获取 `getNumCtx`。
Returns the num ctx.
public void setNumCtx(Integer numCtx)
设置 `setNumCtx`。
Sets the num ctx.
public Integer getNumBatch()
获取 `getNumBatch`。
Returns the num batch.
public void setNumBatch(Integer numBatch)
设置 `setNumBatch`。
Sets the num batch.
public Integer getNumGPU()
获取 `getNumGPU`。
Returns the num GPU.
public void setNumGPU(Integer numGPU)
设置 `setNumGPU`。
Sets the num GPU.
public Integer getMainGPU()
获取主 GPU。
Returns the main GPU.
public void setMainGPU(Integer mainGPU)
设置主 GPU。
Sets the main GPU.
public Boolean getLowVRAM()
获取 `getLowVRAM`。
Returns the low VRAM.
public void setLowVRAM(Boolean lowVRAM)
设置 `setLowVRAM`。
Sets the low VRAM.
public Boolean getF16KV()
获取F 16 KV。
Returns the f 16 KV.
public void setF16KV(Boolean f16kv)
设置F 16 KV。
Sets the f 16 KV.
public Boolean getLogitsAll()
获取 `getLogitsAll`。
Returns the logits all.
public void setLogitsAll(Boolean logitsAll)
设置 `setLogitsAll`。
Sets the logits all.
public Boolean getVocabOnly()
获取 `getVocabOnly`。
Returns the vocab only.
public void setVocabOnly(Boolean vocabOnly)
设置 `setVocabOnly`。
Sets the vocab only.
public Boolean getUseMMap()
获取使用 M 映射。
Returns the use m map.
public void setUseMMap(Boolean useMMap)
设置使用 M 映射。
Sets the use m map.
public Boolean getUseMLock()
获取使用 M 锁。
Returns the use m lock.
public void setUseMLock(Boolean useMLock)
设置使用 M 锁。
Sets the use m lock.
public Integer getNumThread()
获取 `getNumThread`。
Returns the num thread.
public void setNumThread(Integer numThread)
设置 `setNumThread`。
Sets the num thread.
public Integer getNumKeep()
获取 `getNumKeep`。
Returns the num keep.
public void setNumKeep(Integer numKeep)
设置 `setNumKeep`。
Sets the num keep.
public Integer getSeed()
获取预置。
Returns the seed.
public void setSeed(Integer seed)
设置预置。
Sets the seed.
public Integer getMaxTokens()
获取最大令牌数。
Returns the max tokens.
public void setMaxTokens(Integer maxTokens)
设置最大令牌数。
Sets the max tokens.
public Integer getNumPredict()
获取 `getNumPredict`。
Returns the num predict.
public void setNumPredict(Integer numPredict)
设置 `setNumPredict`。
Sets the num predict.
public Integer getTopK()
获取 `getTopK`。
Returns the top k.
public void setTopK(Integer topK)
设置 `setTopK`。
Sets the top k.
public Double getTopP()
获取 `getTopP`。
Returns the top p.
public void setTopP(Double topP)
设置 `setTopP`。
Sets the top p.
public Double getMinP()
获取最小 P。
Returns the min p.
public void setMinP(Double minP)
设置最小 P。
Sets the min p.
public Float getTfsZ()
获取 `getTfsZ`。
Returns the tfs z.
public void setTfsZ(Float tfsZ)
设置 `setTfsZ`。
Sets the tfs z.
public Float getTypicalP()
获取 `getTypicalP`。
Returns the typical p.
public void setTypicalP(Float typicalP)
设置 `setTypicalP`。
Sets the typical p.
public Integer getRepeatLastN()
获取 `getRepeatLastN`。
Returns the repeat last n.
public void setRepeatLastN(Integer repeatLastN)
设置 `setRepeatLastN`。
Sets the repeat last n.
public Double getTemperature()
获取 `getTemperature`。
Returns the temperature.
public void setTemperature(Double temperature)
设置 `setTemperature`。
Sets the temperature.
public Double getRepeatPenalty()
获取 `getRepeatPenalty`。
Returns the repeat penalty.
public void setRepeatPenalty(Double repeatPenalty)
设置 `setRepeatPenalty`。
Sets the repeat penalty.
public Double getPresencePenalty()
获取 `getPresencePenalty`。
Returns the presence penalty.
public void setPresencePenalty(Double presencePenalty)
设置 `setPresencePenalty`。
Sets the presence penalty.
public Double getFrequencyPenalty()
获取 `getFrequencyPenalty`。
Returns the frequency penalty.
public void setFrequencyPenalty(Double frequencyPenalty)
设置 `setFrequencyPenalty`。
Sets the frequency penalty.
public Integer getMirostat()
获取 `getMirostat`。
Returns the mirostat.
public void setMirostat(Integer mirostat)
设置 `setMirostat`。
Sets the mirostat.
public Float getMirostatTau()
获取 `getMirostatTau`。
Returns the mirostat tau.
public void setMirostatTau(Float mirostatTau)
设置 `setMirostatTau`。
Sets the mirostat tau.
public Float getMirostatEta()
获取 `getMirostatEta`。
Returns the mirostat eta.
public void setMirostatEta(Float mirostatEta)
设置 `setMirostatEta`。
Sets the mirostat eta.
public Boolean getPenalizeNewline()
获取 `getPenalizeNewline`。
Returns the penalize newline.
public void setPenalizeNewline(Boolean penalizeNewline)
设置 `setPenalizeNewline`。
Sets the penalize newline.
public List<String> getStopSequences()
获取 `getStopSequences`。
Returns the stop sequences.
public void setStopSequences(List<String> stopSequences)
设置 `setStopSequences`。
Sets the stop sequences.
public List<String> getStop()
获取停止。
Returns the stop.
public void setStop(List<String> stop)
设置停止。
Sets the stop.
public Boolean getTruncate()
获取 `getTruncate`。
Returns the truncate.
public void setTruncate(Boolean truncate)
设置 `setTruncate`。
Sets the truncate.
public ThinkOption getThinkOption()
获取 `getThinkOption`。
Returns the think option.
public void setThinkOption(ThinkOption thinkOption)
设置 `setThinkOption`。
Sets the think option.
public ExecutionConfig getExecutionConfig()
获取执行配置。
Returns the execution config.
public void setExecutionConfig(ExecutionConfig executionConfig)
设置执行配置。
Sets the execution config.
public Map<String, Object> toMap()
返回到映射。
Serializes the `OllamaOptions` into a `Map` representation.
public OllamaOptions copy()
返回 `copy` 结果。
Returns the copy.
public OllamaOptions merge(GenerateOptions other)
设置该参数。
Merges the given `GenerateOptions` into a new instance, with the given options taking precedence.
public OllamaOptions merge(OllamaOptions other)
设置该参数。
Merges the given options into a new instance, with the given options taking precedence.
public Builder toBuilder()
返回到构建器。
Returns the to builder.
public boolean equals(Object o)
设置该参数。
Performs the equals operation.
public int hashCode()
返回 `hashCode` 结果。
Returns the hash code.

方法详情Method Detail

builder

public static Builder builder()
static

返回构建器实例。

Returns the builder.

返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:306–308

fromOptions

public static OllamaOptions fromOptions(OllamaOptions fromOptions)
static

设置来自选项。

Performs the from options operation.

参数Parameters
名称Name类型Type说明Description
fromOptionsOllamaOptions来自选项(类型 `OllamaOptions`)。The from options.
返回Returns OllamaOptions
返回OllamaOptions。Returns Ollama options.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:310–349

fromGenerateOptions

public static OllamaOptions fromGenerateOptions(GenerateOptions genOptions)
static

转换泛型GenerateOptions到OllamaOptions。

Converts generic GenerateOptions to OllamaOptions.

参数Parameters
名称Name类型Type说明Description
genOptionsGenerateOptions泛型选项到转换。The generic options to convert.
返回Returns OllamaOptions
返回OllamaOptions。A configured `OllamaOptions` instance.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:360–401

toGenerateOptions

public GenerateOptions toGenerateOptions()

转换此OllamaOptions到泛型GenerateOptions。

Converts this OllamaOptions to generic GenerateOptions.

返回Returns GenerateOptions
返回GenerateOptions。A configured `GenerateOptions` instance.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:408–455

getModel

public String getModel()

获取模型。

Returns the model.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:597–599

setModel

public void setModel(String model)

设置模型。

Sets the model.

参数Parameters
名称Name类型Type说明Description
modelString模型实例(类型 `String`)。The model.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:601–603

getFormat

public Object getFormat()

获取格式。

Returns the format.

返回Returns Object
返回对象。Returns object.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:605–607

setFormat

public void setFormat(Object format)

设置格式。

Sets the format.

参数Parameters
名称Name类型Type说明Description
formatObject格式(类型 `Object`)。The format.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:609–611

getKeepAlive

public String getKeepAlive()

获取 getKeepAlive。

Returns the keep alive.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:613–615

setKeepAlive

public void setKeepAlive(String keepAlive)

设置 setKeepAlive。

Sets the keep alive.

参数Parameters
名称Name类型Type说明Description
keepAliveStringkeep Alive(类型 `String`)。The keep alive.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:617–619

getUseNUMA

public Boolean getUseNUMA()

获取使用 NUMA。

Returns the use NUMA.

返回Returns Boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:621–623

setUseNUMA

public void setUseNUMA(Boolean useNUMA)

设置使用 NUMA。

Sets the use NUMA.

参数Parameters
名称Name类型Type说明Description
useNUMABoolean使用 NUMA(类型 `Boolean`)。The use NUMA.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:625–627

getNumCtx

public Integer getNumCtx()

获取 getNumCtx。

Returns the num ctx.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:629–631

setNumCtx

public void setNumCtx(Integer numCtx)

设置 setNumCtx。

Sets the num ctx.

参数Parameters
名称Name类型Type说明Description
numCtxIntegernum Ctx(类型 `Integer`)。The num ctx.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:633–635

getNumBatch

public Integer getNumBatch()

获取 getNumBatch。

Returns the num batch.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:637–639

setNumBatch

public void setNumBatch(Integer numBatch)

设置 setNumBatch。

Sets the num batch.

参数Parameters
名称Name类型Type说明Description
numBatchIntegernum Batch(类型 `Integer`)。The num batch.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:641–643

getNumGPU

public Integer getNumGPU()

获取 getNumGPU。

Returns the num GPU.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:645–647

setNumGPU

public void setNumGPU(Integer numGPU)

设置 setNumGPU。

Sets the num GPU.

参数Parameters
名称Name类型Type说明Description
numGPUIntegernum GPU(类型 `Integer`)。The num GPU.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:649–651

getMainGPU

public Integer getMainGPU()

获取主 GPU。

Returns the main GPU.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:653–655

setMainGPU

public void setMainGPU(Integer mainGPU)

设置主 GPU。

Sets the main GPU.

参数Parameters
名称Name类型Type说明Description
mainGPUInteger主 GPU(类型 `Integer`)。The main GPU.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:657–659

getLowVRAM

public Boolean getLowVRAM()

获取 getLowVRAM。

Returns the low VRAM.

返回Returns Boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:661–663

setLowVRAM

public void setLowVRAM(Boolean lowVRAM)

设置 setLowVRAM。

Sets the low VRAM.

参数Parameters
名称Name类型Type说明Description
lowVRAMBooleanlow VRAM(类型 `Boolean`)。The low VRAM.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:665–667

getF16KV

public Boolean getF16KV()

获取F 16 KV。

Returns the f 16 KV.

返回Returns Boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:669–671

setF16KV

public void setF16KV(Boolean f16kv)

设置F 16 KV。

Sets the f 16 KV.

参数Parameters
名称Name类型Type说明Description
f16kvBooleanf 16 kv(类型 `Boolean`)。The f 16 kv.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:673–675

getLogitsAll

public Boolean getLogitsAll()

获取 getLogitsAll。

Returns the logits all.

返回Returns Boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:677–679

setLogitsAll

public void setLogitsAll(Boolean logitsAll)

设置 setLogitsAll。

Sets the logits all.

参数Parameters
名称Name类型Type说明Description
logitsAllBooleanlogits 所有(类型 `Boolean`)。The logits all.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:681–683

getVocabOnly

public Boolean getVocabOnly()

获取 getVocabOnly。

Returns the vocab only.

返回Returns Boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:685–687

setVocabOnly

public void setVocabOnly(Boolean vocabOnly)

设置 setVocabOnly。

Sets the vocab only.

参数Parameters
名称Name类型Type说明Description
vocabOnlyBooleanvocab Only(类型 `Boolean`)。The vocab only.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:689–691

getUseMMap

public Boolean getUseMMap()

获取使用 M 映射。

Returns the use m map.

返回Returns Boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:693–695

setUseMMap

public void setUseMMap(Boolean useMMap)

设置使用 M 映射。

Sets the use m map.

参数Parameters
名称Name类型Type说明Description
useMMapBoolean使用 M 映射(类型 `Boolean`)。The use m map.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:697–699

getUseMLock

public Boolean getUseMLock()

获取使用 M 锁。

Returns the use m lock.

返回Returns Boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:701–703

setUseMLock

public void setUseMLock(Boolean useMLock)

设置使用 M 锁。

Sets the use m lock.

参数Parameters
名称Name类型Type说明Description
useMLockBoolean使用 M 锁(类型 `Boolean`)。The use m lock.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:705–707

getNumThread

public Integer getNumThread()

获取 getNumThread。

Returns the num thread.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:709–711

setNumThread

public void setNumThread(Integer numThread)

设置 setNumThread。

Sets the num thread.

参数Parameters
名称Name类型Type说明Description
numThreadIntegernum 会话线程(类型 `Integer`)。The num thread.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:713–715

getNumKeep

public Integer getNumKeep()

获取 getNumKeep。

Returns the num keep.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:717–719

setNumKeep

public void setNumKeep(Integer numKeep)

设置 setNumKeep。

Sets the num keep.

参数Parameters
名称Name类型Type说明Description
numKeepIntegernum Keep(类型 `Integer`)。The num keep.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:721–723

getSeed

public Integer getSeed()

获取预置。

Returns the seed.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:725–727

setSeed

public void setSeed(Integer seed)

设置预置。

Sets the seed.

参数Parameters
名称Name类型Type说明Description
seedInteger预置(类型 `Integer`)。The seed.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:729–731

getMaxTokens

public Integer getMaxTokens()

获取最大令牌数。

Returns the max tokens.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:733–735

setMaxTokens

public void setMaxTokens(Integer maxTokens)

设置最大令牌数。

Sets the max tokens.

参数Parameters
名称Name类型Type说明Description
maxTokensInteger最大令牌数(类型 `Integer`)。The max tokens.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:737–739

getNumPredict

public Integer getNumPredict()

获取 getNumPredict。

Returns the num predict.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:741–743

setNumPredict

public void setNumPredict(Integer numPredict)

设置 setNumPredict。

Sets the num predict.

参数Parameters
名称Name类型Type说明Description
numPredictIntegernum Predict(类型 `Integer`)。The num predict.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:745–747

getTopK

public Integer getTopK()

获取 getTopK。

Returns the top k.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:749–751

setTopK

public void setTopK(Integer topK)

设置 setTopK。

Sets the top k.

参数Parameters
名称Name类型Type说明Description
topKIntegertop K(类型 `Integer`)。The top k.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:753–755

getTopP

public Double getTopP()

获取 getTopP。

Returns the top p.

返回Returns Double
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:757–759

setTopP

public void setTopP(Double topP)

设置 setTopP。

Sets the top p.

参数Parameters
名称Name类型Type说明Description
topPDoubletop P(类型 `Double`)。The top p.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:761–763

getMinP

public Double getMinP()

获取最小 P。

Returns the min p.

返回Returns Double
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:765–767

setMinP

public void setMinP(Double minP)

设置最小 P。

Sets the min p.

参数Parameters
名称Name类型Type说明Description
minPDouble最小 P(类型 `Double`)。The min p.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:769–771

getTfsZ

public Float getTfsZ()

获取 getTfsZ。

Returns the tfs z.

返回Returns Float
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:773–775

setTfsZ

public void setTfsZ(Float tfsZ)

设置 setTfsZ。

Sets the tfs z.

参数Parameters
名称Name类型Type说明Description
tfsZFloattfs Z(类型 `Float`)。The tfs z.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:777–779

getTypicalP

public Float getTypicalP()

获取 getTypicalP。

Returns the typical p.

返回Returns Float
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:781–783

setTypicalP

public void setTypicalP(Float typicalP)

设置 setTypicalP。

Sets the typical p.

参数Parameters
名称Name类型Type说明Description
typicalPFloattypical P(类型 `Float`)。The typical p.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:785–787

getRepeatLastN

public Integer getRepeatLastN()

获取 getRepeatLastN。

Returns the repeat last n.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:789–791

setRepeatLastN

public void setRepeatLastN(Integer repeatLastN)

设置 setRepeatLastN。

Sets the repeat last n.

参数Parameters
名称Name类型Type说明Description
repeatLastNIntegerrepeat 最后 N(类型 `Integer`)。The repeat last n.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:793–795

getTemperature

public Double getTemperature()

获取 getTemperature。

Returns the temperature.

返回Returns Double
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:797–799

setTemperature

public void setTemperature(Double temperature)

设置 setTemperature。

Sets the temperature.

参数Parameters
名称Name类型Type说明Description
temperatureDoubletemperature(类型 `Double`)。The temperature.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:801–803

getRepeatPenalty

public Double getRepeatPenalty()

获取 getRepeatPenalty。

Returns the repeat penalty.

返回Returns Double
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:805–807

setRepeatPenalty

public void setRepeatPenalty(Double repeatPenalty)

设置 setRepeatPenalty。

Sets the repeat penalty.

参数Parameters
名称Name类型Type说明Description
repeatPenaltyDoublerepeat Penalty(类型 `Double`)。The repeat penalty.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:809–811

getPresencePenalty

public Double getPresencePenalty()

获取 getPresencePenalty。

Returns the presence penalty.

返回Returns Double
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:813–815

setPresencePenalty

public void setPresencePenalty(Double presencePenalty)

设置 setPresencePenalty。

Sets the presence penalty.

参数Parameters
名称Name类型Type说明Description
presencePenaltyDouble在线状态 Penalty(类型 `Double`)。The presence penalty.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:817–819

getFrequencyPenalty

public Double getFrequencyPenalty()

获取 getFrequencyPenalty。

Returns the frequency penalty.

返回Returns Double
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:821–823

setFrequencyPenalty

public void setFrequencyPenalty(Double frequencyPenalty)

设置 setFrequencyPenalty。

Sets the frequency penalty.

参数Parameters
名称Name类型Type说明Description
frequencyPenaltyDoublefrequency Penalty(类型 `Double`)。The frequency penalty.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:825–827

getMirostat

public Integer getMirostat()

获取 getMirostat。

Returns the mirostat.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:829–831

setMirostat

public void setMirostat(Integer mirostat)

设置 setMirostat。

Sets the mirostat.

参数Parameters
名称Name类型Type说明Description
mirostatIntegermirostat(类型 `Integer`)。The mirostat.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:833–835

getMirostatTau

public Float getMirostatTau()

获取 getMirostatTau。

Returns the mirostat tau.

返回Returns Float
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:837–839

setMirostatTau

public void setMirostatTau(Float mirostatTau)

设置 setMirostatTau。

Sets the mirostat tau.

参数Parameters
名称Name类型Type说明Description
mirostatTauFloatmirostat Tau(类型 `Float`)。The mirostat tau.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:841–843

getMirostatEta

public Float getMirostatEta()

获取 getMirostatEta。

Returns the mirostat eta.

返回Returns Float
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:845–847

setMirostatEta

public void setMirostatEta(Float mirostatEta)

设置 setMirostatEta。

Sets the mirostat eta.

参数Parameters
名称Name类型Type说明Description
mirostatEtaFloatmirostat Eta(类型 `Float`)。The mirostat eta.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:849–851

getPenalizeNewline

public Boolean getPenalizeNewline()

获取 getPenalizeNewline。

Returns the penalize newline.

返回Returns Boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:853–855

setPenalizeNewline

public void setPenalizeNewline(Boolean penalizeNewline)

设置 setPenalizeNewline。

Sets the penalize newline.

参数Parameters
名称Name类型Type说明Description
penalizeNewlineBooleanpenalize Newline(类型 `Boolean`)。The penalize newline.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:857–859

getStopSequences

public List<String> getStopSequences()

获取 getStopSequences。

Returns the stop sequences.

返回Returns List<String>
返回列出。Returns list.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:861–863

setStopSequences

public void setStopSequences(List<String> stopSequences)

设置 setStopSequences。

Sets the stop sequences.

参数Parameters
名称Name类型Type说明Description
stopSequencesList<String>停止 Sequences(类型 `List`)。The stop sequences.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:865–867

getStop

public List<String> getStop()

获取停止。

Returns the stop.

返回Returns List<String>
返回列出。Returns list.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:869–871

setStop

public void setStop(List<String> stop)

设置停止。

Sets the stop.

参数Parameters
名称Name类型Type说明Description
stopList<String>停止(类型 `List`)。The stop.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:873–875

getTruncate

public Boolean getTruncate()

获取 getTruncate。

Returns the truncate.

返回Returns Boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:877–879

setTruncate

public void setTruncate(Boolean truncate)

设置 setTruncate。

Sets the truncate.

参数Parameters
名称Name类型Type说明Description
truncateBooleantruncate(类型 `Boolean`)。The truncate.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:881–883

getThinkOption

public ThinkOption getThinkOption()

获取 getThinkOption。

Returns the think option.

返回Returns ThinkOption
返回ThinkOption。Returns think option.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:885–887

setThinkOption

public void setThinkOption(ThinkOption thinkOption)

设置 setThinkOption。

Sets the think option.

参数Parameters
名称Name类型Type说明Description
thinkOptionThinkOptionthink 选项(类型 `ThinkOption`)。The think option.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:889–891

getExecutionConfig

public ExecutionConfig getExecutionConfig()

获取执行配置。

Returns the execution config.

返回Returns ExecutionConfig
返回ExecutionConfig。Returns execution config.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:893–895

setExecutionConfig

public void setExecutionConfig(ExecutionConfig executionConfig)

设置执行配置。

Sets the execution config.

参数Parameters
名称Name类型Type说明Description
executionConfigExecutionConfig执行配置(类型 `ExecutionConfig`)。The execution config.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:897–899

toMap

public Map<String, Object> toMap()

返回到映射。

Serializes the OllamaOptions into a Map representation.

返回Returns Map<String, Object>
返回映射。A map containing the configured options.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:905–907

copy

public OllamaOptions copy()

返回 copy 结果。

Returns the copy.

返回Returns OllamaOptions
返回OllamaOptions。Returns Ollama options.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:909–911

merge

public OllamaOptions merge(GenerateOptions other)

设置该参数。

Merges the given GenerateOptions into a new instance, with the given options taking precedence.

参数Parameters
名称Name类型Type说明Description
otherGenerateOptionsother(类型 `GenerateOptions`)。The options to merge (can be null).
返回Returns OllamaOptions
一种新的已合并`OllamaOptions`实例。A new merged `OllamaOptions` instance.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:922–927

merge

public OllamaOptions merge(OllamaOptions other)

设置该参数。

Merges the given options into a new instance, with the given options taking precedence.

参数Parameters
名称Name类型Type说明Description
otherOllamaOptionsother(类型 `OllamaOptions`)。The options to merge (can be null).
返回Returns OllamaOptions
一种新的已合并`OllamaOptions`实例。A new merged `OllamaOptions` instance.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:935–981

toBuilder

public Builder toBuilder()

返回到构建器。

Returns the to builder.

返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:983–1021

equals

public boolean equals(Object o)

设置该参数。

Performs the equals operation.

参数Parameters
名称Name类型Type说明Description
oObjecto(类型 `Object`)。The o.
返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:1025–1069

hashCode

public int hashCode()

返回 hashCode 结果。

Returns the hash code.

返回Returns int
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/options/OllamaOptions.java:1071–1109

嵌套类详情Nested Class Detail

ParamKey

public enum ParamKey

定义参数键相关取值的枚举。位于 io.agentscope.extensions.model.ollama.options 包。核心成员包括 getKey、NUMA、NUM_CTX、NUM_BATCH、NUM_GPU、MAIN_GPU。

Keys for Ollama parameters.

Builder

public static final class Builder

构建器,用于构建并配置目标实例。位于 io.agentscope.extensions.model.ollama.options 包。核心成员包括 model、format、keepAlive、truncate、executionConfig、useNUMA。

A class in io.agentscope.extensions.model.ollama.options that talks to model services and returns generated or embedded output. Declared in io.agentscope.extensions.model.ollama.options.

基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.