RemoteEventCodec
public final class RemoteEventCodec
源码Source
io/agentscope/harness/agent/subagent/protocol/RemoteEventCodec.java:46–334远程事件编解码器,支持智能体之间的发现、委派与协作。位于 io.agentscope.harness.agent.subagent.protocol 包。核心成员包括 fromAgentEvent、toAgentEvent、matchesDetail。
Bidirectional mapping between internal AgentEvents and stable RemoteAgentEvent
wire DTOs.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public static Optional<RemoteAgentEvent> fromAgentEvent(AgentEvent event)static | 设置来自智能体事件。 Maps an internal agent event to a protocol DTO (without seq/taskId — those are assigned by
the server event bus). |
public static Optional<AgentEvent> toAgentEvent(RemoteAgentEvent remote)static | 设置到智能体事件。 Maps a protocol DTO back to an internal `AgentEvent`. |
public static boolean matchesDetail(RemoteEventType type, String detail)static | 执行 `matchesDetail` 方法。 Whether this event type should be emitted for the given detail level. |
public static boolean matchesDetail(RemoteAgentEvent event, String detail)static | 执行 `matchesDetail` 方法。 Detail check for a whole DTO; equivalent to `#matchesDetail(RemoteEventType, String)`. |
方法详情Method Detail
fromAgentEvent
public static Optional<RemoteAgentEvent> fromAgentEvent(AgentEvent event)
static
设置来自智能体事件。
Maps an internal agent event to a protocol DTO (without seq/taskId — those are assigned by the server event bus).
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
event | AgentEvent | 事件(类型 `AgentEvent`)。The event. |
Optional<RemoteAgentEvent>返回可选。Returns optional.
源码Source
io/agentscope/harness/agent/subagent/protocol/RemoteEventCodec.java:68–79toAgentEvent
public static Optional<AgentEvent> toAgentEvent(RemoteAgentEvent remote)
static
设置到智能体事件。
Maps a protocol DTO back to an internal AgentEvent.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
remote | RemoteAgentEvent | 远程(类型 `RemoteAgentEvent`)。The remote. |
Optional<AgentEvent>返回可选。Returns optional.
源码Source
io/agentscope/harness/agent/subagent/protocol/RemoteEventCodec.java:153–208matchesDetail
public static boolean matchesDetail(RemoteEventType type, String detail)
static
执行 matchesDetail 方法。
Whether this event type should be emitted for the given detail level.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
type | RemoteEventType | 类型(类型 `RemoteEventType`)。event type |
detail | String | 详情(类型 `String`)。see `RemoteStreamDetail` |
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/harness/agent/subagent/protocol/RemoteEventCodec.java:223–233matchesDetail
public static boolean matchesDetail(RemoteAgentEvent event, String detail)
static
执行 matchesDetail 方法。
Detail check for a whole DTO; equivalent to #matchesDetail(RemoteEventType, String).
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
event | RemoteAgentEvent | 事件(类型 `RemoteAgentEvent`)。The event. |
detail | String | 详情(类型 `String`)。The detail. |
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/harness/agent/subagent/protocol/RemoteEventCodec.java:236–238