AS AgentScopeAPI 手册 / API Reference

OllamaRequest

@JsonInclude(JsonInclude.Include.NON_NULL) public class OllamaRequest
源码Source io/agentscope/extensions/model/ollama/dto/OllamaRequest.java:28–203

Ollama 请求,与模型服务通信并返回生成或向量化结果。位于 io.agentscope.extensions.model.ollama.dto 包。核心成员包括 getModel、setModel、getMessages、setMessages、getStream、setStream。

Ollama chat request DTO. Represents the payload sent to the Ollama chat API.

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
Builder类class
构建器,用于构建并配置目标实例。
A class in io.agentscope.extensions.model.ollama.dto that talks to model services and returns generated or embedded output.

构造器摘要Constructor Summary

构造器Constructor说明Description
public OllamaRequest()
初始化 `OllamaRequest` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public String getModel()
获取模型。
Returns the model.
public void setModel(String model)
设置模型。
Sets the model.
public List<OllamaMessage> getMessages()
获取消息。
Returns the messages.
public void setMessages(List<OllamaMessage> messages)
设置消息。
Sets the messages.
public Boolean getStream()
获取流。
Returns the stream.
public void setStream(Boolean stream)
设置流。
Sets the stream.
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 List<OllamaTool> getTools()
获取工具。
Returns the tools.
public void setTools(List<OllamaTool> tools)
设置工具。
Sets the tools.
public Object getToolChoice()
获取工具选项。
Returns the tool choice.
public void setToolChoice(Object toolChoice)
设置工具选项。
Sets the tool choice.
public Object getThink()
获取 `getThink`。
Returns the think.
public void setThink(Object think)
设置 `setThink`。
Sets the think.
public Map<String, Object> getOptions()
获取选项。
Returns the options.
public void setOptions(Map<String, Object> options)
设置选项。
Sets the options.
public static Builder builder()
static
返回构建器实例。
Returns the builder.

构造器详情Constructor Detail

OllamaRequest

public OllamaRequest()

初始化 OllamaRequest 实例。

Creates a new instance.

源码Source io/agentscope/extensions/model/ollama/dto/OllamaRequest.java:73

方法详情Method Detail

getModel

public String getModel()

获取模型。

Returns the model.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaRequest.java:75–77

setModel

public void setModel(String model)

设置模型。

Sets the model.

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

getMessages

public List<OllamaMessage> getMessages()

获取消息。

Returns the messages.

返回Returns List<OllamaMessage>
返回列出。Returns list.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaRequest.java:83–85

setMessages

public void setMessages(List<OllamaMessage> messages)

设置消息。

Sets the messages.

参数Parameters
名称Name类型Type说明Description
messagesList<OllamaMessage>消息列表(类型 `List`)。The messages.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaRequest.java:87–89

getStream

public Boolean getStream()

获取流。

Returns the stream.

返回Returns Boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaRequest.java:91–93

setStream

public void setStream(Boolean stream)

设置流。

Sets the stream.

参数Parameters
名称Name类型Type说明Description
streamBoolean流(类型 `Boolean`)。The stream.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaRequest.java:95–97

getFormat

public Object getFormat()

获取格式。

Returns the format.

返回Returns Object
返回对象。Returns object.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaRequest.java:99–101

setFormat

public void setFormat(Object format)

设置格式。

Sets the format.

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

getKeepAlive

public String getKeepAlive()

获取 getKeepAlive。

Returns the keep alive.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaRequest.java:107–109

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/dto/OllamaRequest.java:111–113

getTools

public List<OllamaTool> getTools()

获取工具。

Returns the tools.

返回Returns List<OllamaTool>
返回列出。Returns list.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaRequest.java:115–117

setTools

public void setTools(List<OllamaTool> tools)

设置工具。

Sets the tools.

参数Parameters
名称Name类型Type说明Description
toolsList<OllamaTool>工具列表(类型 `List`)。The tools.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaRequest.java:119–121

getToolChoice

public Object getToolChoice()

获取工具选项。

Returns the tool choice.

返回Returns Object
返回对象。Returns object.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaRequest.java:123–125

setToolChoice

public void setToolChoice(Object toolChoice)

设置工具选项。

Sets the tool choice.

参数Parameters
名称Name类型Type说明Description
toolChoiceObject工具选项(类型 `Object`)。The tool choice.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaRequest.java:127–129

getThink

public Object getThink()

获取 getThink。

Returns the think.

返回Returns Object
返回对象。Returns object.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaRequest.java:131–133

setThink

public void setThink(Object think)

设置 setThink。

Sets the think.

参数Parameters
名称Name类型Type说明Description
thinkObjectthink(类型 `Object`)。The think.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaRequest.java:135–137

getOptions

public Map<String, Object> getOptions()

获取选项。

Returns the options.

返回Returns Map<String, Object>
返回映射。Returns map.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaRequest.java:139–141

setOptions

public void setOptions(Map<String, Object> options)

设置选项。

Sets the options.

参数Parameters
名称Name类型Type说明Description
optionsMap<String, Object>选项(类型 `Map`)。The options.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaRequest.java:143–145

builder

public static Builder builder()
static

返回构建器实例。

Returns the builder.

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

嵌套类详情Nested Class Detail

Builder

public static class Builder

构建器,用于构建并配置目标实例。位于 io.agentscope.extensions.model.ollama.dto 包。核心成员包括 model、messages、stream、format、keepAlive、tools。

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

基于官方固定版本源码静态生成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.