AS AgentScopeAPI 手册 / API Reference

OllamaMessage

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

Ollama 消息,与模型服务通信并返回生成或向量化结果。位于 io.agentscope.extensions.model.ollama.dto 包。核心成员包括 getRole、setRole、getContent、setContent、getThinking、setThinking。

Ollama chat message DTO. Represents a message in the conversation history.

构造器摘要Constructor Summary

构造器Constructor说明Description
public OllamaMessage()
初始化 `OllamaMessage` 实例。
Creates a new instance.
public OllamaMessage(String role, String content)
初始化 `OllamaMessage` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public String getRole()
获取角色。
Returns the role.
public void setRole(String role)
设置角色。
Sets the role.
public String getContent()
获取内容。
Returns the content.
public void setContent(String content)
设置内容。
Sets the content.
public String getThinking()
获取 `getThinking`。
Returns the thinking.
public void setThinking(String thinking)
设置 `setThinking`。
Sets the thinking.
public List<String> getImages()
获取 `getImages`。
Returns the images.
public void setImages(List<String> images)
设置 `setImages`。
Sets the images.
public List<OllamaToolCall> getToolCalls()
获取工具调用。
Returns the tool calls.
public void setToolCalls(List<OllamaToolCall> toolCalls)
设置工具调用。
Sets the tool calls.
public String getToolCallId()
获取工具调用标识。
Returns the tool call id.
public void setToolCallId(String toolCallId)
设置工具调用标识。
Sets the tool call id.
public String getName()
获取名称。
Returns the name.
public void setName(String name)
设置名称。
Sets the name.

构造器详情Constructor Detail

OllamaMessage

public OllamaMessage()

初始化 OllamaMessage 实例。

Creates a new instance.

源码Source io/agentscope/extensions/model/ollama/dto/OllamaMessage.java:67

OllamaMessage

public OllamaMessage(String role, String content)

初始化 OllamaMessage 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
roleString角色(类型 `String`)。The role.
contentString内容(类型 `String`)。The content.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaMessage.java:69–72

方法详情Method Detail

getRole

public String getRole()

获取角色。

Returns the role.

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

setRole

public void setRole(String role)

设置角色。

Sets the role.

参数Parameters
名称Name类型Type说明Description
roleString角色(类型 `String`)。The role.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaMessage.java:78–80

getContent

public String getContent()

获取内容。

Returns the content.

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

setContent

public void setContent(String content)

设置内容。

Sets the content.

参数Parameters
名称Name类型Type说明Description
contentString内容(类型 `String`)。The content.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaMessage.java:86–88

getThinking

public String getThinking()

获取 getThinking。

Returns the thinking.

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

setThinking

public void setThinking(String thinking)

设置 setThinking。

Sets the thinking.

参数Parameters
名称Name类型Type说明Description
thinkingStringthinking(类型 `String`)。The thinking.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaMessage.java:94–96

getImages

public List<String> getImages()

获取 getImages。

Returns the images.

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

setImages

public void setImages(List<String> images)

设置 setImages。

Sets the images.

参数Parameters
名称Name类型Type说明Description
imagesList<String>images(类型 `List`)。The images.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaMessage.java:102–104

getToolCalls

public List<OllamaToolCall> getToolCalls()

获取工具调用。

Returns the tool calls.

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

setToolCalls

public void setToolCalls(List<OllamaToolCall> toolCalls)

设置工具调用。

Sets the tool calls.

参数Parameters
名称Name类型Type说明Description
toolCallsList<OllamaToolCall>工具调用(类型 `List`)。The tool calls.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaMessage.java:110–112

getToolCallId

public String getToolCallId()

获取工具调用标识。

Returns the tool call id.

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

setToolCallId

public void setToolCallId(String toolCallId)

设置工具调用标识。

Sets the tool call id.

参数Parameters
名称Name类型Type说明Description
toolCallIdString工具调用标识(类型 `String`)。The tool call id.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaMessage.java:118–120

getName

public String getName()

获取名称。

Returns the name.

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

setName

public void setName(String name)

设置名称。

Sets the name.

参数Parameters
名称Name类型Type说明Description
nameString名称(类型 `String`)。The name.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaMessage.java:126–128
基于官方固定版本源码静态生成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.