OllamaMessage
@JsonInclude(JsonInclude.Include.NON_NULL) public class OllamaMessage
源码Source
io/agentscope/extensions/model/ollama/dto/OllamaMessage.java:28–129Ollama 消息,与模型服务通信并返回生成或向量化结果。位于 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:67OllamaMessage
public OllamaMessage(String role, String content)
初始化 OllamaMessage 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
role | String | 角色(类型 `String`)。The role. |
content | String | 内容(类型 `String`)。The content. |
源码Source
io/agentscope/extensions/model/ollama/dto/OllamaMessage.java:69–72方法详情Method Detail
getRole
public String getRole()
获取角色。
Returns the role.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/extensions/model/ollama/dto/OllamaMessage.java:74–76setRole
public void setRole(String role)
设置角色。
Sets the role.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
role | String | 角色(类型 `String`)。The role. |
源码Source
io/agentscope/extensions/model/ollama/dto/OllamaMessage.java:78–80getContent
public String getContent()
获取内容。
Returns the content.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/extensions/model/ollama/dto/OllamaMessage.java:82–84setContent
public void setContent(String content)
设置内容。
Sets the content.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
content | String | 内容(类型 `String`)。The content. |
源码Source
io/agentscope/extensions/model/ollama/dto/OllamaMessage.java:86–88getThinking
public String getThinking()
获取 getThinking。
Returns the thinking.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/extensions/model/ollama/dto/OllamaMessage.java:90–92setThinking
public void setThinking(String thinking)
设置 setThinking。
Sets the thinking.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
thinking | String | thinking(类型 `String`)。The thinking. |
源码Source
io/agentscope/extensions/model/ollama/dto/OllamaMessage.java:94–96getImages
public List<String> getImages()
获取 getImages。
Returns the images.
List<String>返回列出。Returns list.
源码Source
io/agentscope/extensions/model/ollama/dto/OllamaMessage.java:98–100setImages
public void setImages(List<String> images)
设置 setImages。
Sets the images.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
images | List<String> | images(类型 `List`)。The images. |
源码Source
io/agentscope/extensions/model/ollama/dto/OllamaMessage.java:102–104getToolCalls
public List<OllamaToolCall> getToolCalls()
获取工具调用。
Returns the tool calls.
List<OllamaToolCall>返回列出。Returns list.
源码Source
io/agentscope/extensions/model/ollama/dto/OllamaMessage.java:106–108setToolCalls
public void setToolCalls(List<OllamaToolCall> toolCalls)
设置工具调用。
Sets the tool calls.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
toolCalls | List<OllamaToolCall> | 工具调用(类型 `List`)。The tool calls. |
源码Source
io/agentscope/extensions/model/ollama/dto/OllamaMessage.java:110–112getToolCallId
public String getToolCallId()
获取工具调用标识。
Returns the tool call id.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/extensions/model/ollama/dto/OllamaMessage.java:114–116setToolCallId
public void setToolCallId(String toolCallId)
设置工具调用标识。
Sets the tool call id.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
toolCallId | String | 工具调用标识(类型 `String`)。The tool call id. |
源码Source
io/agentscope/extensions/model/ollama/dto/OllamaMessage.java:118–120getName
public String getName()
获取名称。
Returns the name.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/extensions/model/ollama/dto/OllamaMessage.java:122–124setName
public void setName(String name)
设置名称。
Sets the name.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
name | String | 名称(类型 `String`)。The name. |
源码Source
io/agentscope/extensions/model/ollama/dto/OllamaMessage.java:126–128