ContextMessage
public record ContextMessage(String role, String content, boolean isCompaction)
源码Source
io/agentscope/extensions/controlplane/model/ContextSnapshot.java:287–302承载上下文消息数据的记录类型。位于 io.agentscope.extensions.controlplane.model 包。核心成员包括 role、content、isCompaction、of。
One message in the effective context.
记录组件摘要Record Component Summary
| 组件Component | 类型Type | 说明Description |
|---|---|---|
role | String | 执行角色相关操作。 Performs the role operation. |
content | String | 执行内容相关操作。 Performs the content operation. |
isCompaction | boolean | 判断是否压缩。 Returns whether the compaction. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public static ContextMessage of(String role, String content)static | 创建并返回实例。 Creates and returns an instance. |
记录组件详情Record Component Detail
role
String role执行角色相关操作。
Performs the role operation.
源码Source
io/agentscope/extensions/controlplane/model/ContextSnapshot.java:287–302content
String content执行内容相关操作。
Performs the content operation.
源码Source
io/agentscope/extensions/controlplane/model/ContextSnapshot.java:287–302isCompaction
boolean isCompaction判断是否压缩。
Returns whether the compaction.
源码Source
io/agentscope/extensions/controlplane/model/ContextSnapshot.java:287–302方法详情Method Detail
of
public static ContextMessage of(String role, String content)
static
创建并返回实例。
Creates and returns an instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
role | String | 角色(类型 `String`)。The role. |
content | String | 内容(类型 `String`)。The content. |
ContextMessage返回ContextMessage。Returns context message.
源码Source
io/agentscope/extensions/controlplane/model/ContextSnapshot.java:289–291