AS AgentScopeAPI 手册 / API Reference

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
idString标识(类型 `String`)。The id.
parentIdString父级标识(类型 `String`)。The parent id.
timestampInstant时间戳(类型 `Instant`)。The timestamp.
roleString角色(类型 `String`)。The role.
contentString内容(类型 `String`)。The content.
toolCallIdString工具调用标识(类型 `String`)。The tool call id.
blockTypesList<String>块类型(类型 `List`)。The block types.
源码Source io/agentscope/harness/agent/memory/session/SessionEntry.java:94–108

MessageEntry

public MessageEntry(String id, String parentId, Instant timestamp, String role, String content, String toolCallId)

初始化 MessageEntry 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
idString标识(类型 `String`)。The id.
parentIdString父级标识(类型 `String`)。The parent id.
timestampInstant时间戳(类型 `Instant`)。The timestamp.
roleString角色(类型 `String`)。The role.
contentString内容(类型 `String`)。The content.
toolCallIdString工具调用标识(类型 `String`)。The tool call id.
源码Source io/agentscope/harness/agent/memory/session/SessionEntry.java:110–118

MessageEntry

public MessageEntry(String parentId, String role, String content)

初始化 MessageEntry 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
parentIdString父级标识(类型 `String`)。The parent id.
roleString角色(类型 `String`)。The role.
contentString内容(类型 `String`)。The content.
源码Source io/agentscope/harness/agent/memory/session/SessionEntry.java:120–122

方法详情Method Detail

getRole

public String getRole()

获取角色。

Returns the role.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/harness/agent/memory/session/SessionEntry.java:124–126

getContent

public String getContent()

获取内容。

Returns the content.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/harness/agent/memory/session/SessionEntry.java:128–130

getToolCallId

public String getToolCallId()

获取工具调用标识。

Returns the tool call id.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/harness/agent/memory/session/SessionEntry.java:132–134

getBlockTypes

public List<String> getBlockTypes()

获取块类型。

Returns the block types.

返回Returns List<String>
返回列出。Returns list.
源码Source io/agentscope/harness/agent/memory/session/SessionEntry.java:136–138

继承成员Inherited Members

继承自Methods inherited from SessionEntry
基于官方固定版本源码静态生成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.