MessageEntry
public static final class MessageEntry extends SessionEntry
源码Source
io/agentscope/harness/agent/memory/session/SessionEntry.java:85–139消息条目,在多次调用之间保存和恢复会话与记忆数据。位于 io.agentscope.harness.agent.memory.session 包,继承自 SessionEntry。核心成员包括 getRole、getContent、getToolCallId、getBlockTypes、MessageEntry。
A message entry wrapping a conversation turn (user/assistant/system), or a placeholder when the message had no renderable text/tool blocks (e.g. image-only).
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public MessageEntry(String id, String parentId, Instant timestamp, String role, String content, String toolCallId, List<String> blockTypes) | 初始化 `MessageEntry` 实例。 Creates a new instance. |
public MessageEntry(String id, String parentId, Instant timestamp, String role, String content, String toolCallId) | 初始化 `MessageEntry` 实例。 Creates a new instance. |
public MessageEntry(String parentId, String role, String content) | 初始化 `MessageEntry` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public String getRole() | 获取角色。 Returns the role. |
public String getContent() | 获取内容。 Returns the content. |
public String getToolCallId() | 获取工具调用标识。 Returns the tool call id. |
public List<String> getBlockTypes() | 获取块类型。 Returns the block types. |
构造器详情Constructor Detail
MessageEntry
public MessageEntry(String id, String parentId, Instant timestamp, String role, String content, String toolCallId, List<String> blockTypes)
初始化 MessageEntry 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
id | String | 标识(类型 `String`)。The id. |
parentId | String | 父级标识(类型 `String`)。The parent id. |
timestamp | Instant | 时间戳(类型 `Instant`)。The timestamp. |
role | String | 角色(类型 `String`)。The role. |
content | String | 内容(类型 `String`)。The content. |
toolCallId | String | 工具调用标识(类型 `String`)。The tool call id. |
blockTypes | List<String> | 块类型(类型 `List`)。The block types. |
源码Source
io/agentscope/harness/agent/memory/session/SessionEntry.java:94–108MessageEntry
public MessageEntry(String id, String parentId, Instant timestamp, String role, String content, String toolCallId)
初始化 MessageEntry 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
id | String | 标识(类型 `String`)。The id. |
parentId | String | 父级标识(类型 `String`)。The parent id. |
timestamp | Instant | 时间戳(类型 `Instant`)。The timestamp. |
role | String | 角色(类型 `String`)。The role. |
content | String | 内容(类型 `String`)。The content. |
toolCallId | String | 工具调用标识(类型 `String`)。The tool call id. |
源码Source
io/agentscope/harness/agent/memory/session/SessionEntry.java:110–118MessageEntry
public MessageEntry(String parentId, String role, String content)
初始化 MessageEntry 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
parentId | String | 父级标识(类型 `String`)。The parent id. |
role | String | 角色(类型 `String`)。The role. |
content | String | 内容(类型 `String`)。The content. |
源码Source
io/agentscope/harness/agent/memory/session/SessionEntry.java:120–122方法详情Method Detail
getRole
public String getRole()
获取角色。
Returns the role.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/harness/agent/memory/session/SessionEntry.java:124–126getContent
public String getContent()
获取内容。
Returns the content.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/harness/agent/memory/session/SessionEntry.java:128–130getToolCallId
public String getToolCallId()
获取工具调用标识。
Returns the tool call id.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/harness/agent/memory/session/SessionEntry.java:132–134getBlockTypes
public List<String> getBlockTypes()
获取块类型。
Returns the block types.
List<String>返回列出。Returns list.
源码Source
io/agentscope/harness/agent/memory/session/SessionEntry.java:136–138