CustomEvent
public class CustomEvent extends AgentEvent
io/agentscope/core/event/CustomEvent.java:39–82自定义事件,描述执行过程中的事件。位于 io.agentscope.core.event 包,继承自 AgentEvent。核心成员包括 getType、getName、getValue、CustomEvent。
Generic extensible event for signals that don't fit a specific AgentEvent subtype.
Used by service-layer middleware to notify front-end subscribers about state changes (task progress, team membership, permission updates, etc.) without polluting the core agent event enum with application-specific types.
Front-end implementations should handle unknown #getName() values gracefully — skip
with no error.
Well-known name values:
-
"state_updated"— agent state (tasks / permission) changed during a tool call -
"team_updated"— team membership changed (member added / team created or dissolved)
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public CustomEvent(String id, String createdAt, String name, Map<String, Object> value) | 初始化 `CustomEvent` 实例。 Creates a new instance. |
public CustomEvent(String name, Map<String, Object> value) | 初始化 `CustomEvent` 实例。 Creates a new instance. |
public CustomEvent(String name) | 初始化 `CustomEvent` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public AgentEventType getType() | 获取类型。 Returns the type. |
public String getName() | 返回种类的通知。 Returns the kind of notification. |
public Map<String, Object> getValue() | 获取值。 Returns the arbitrary JSON-serializable payload whose schema depends on `#getName()`. |
构造器详情Constructor Detail
CustomEvent
public CustomEvent(String id, String createdAt, String name, Map<String, Object> value)
初始化 CustomEvent 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
id | String | 标识(类型 `String`)。The id. |
createdAt | String | 已创建 At(类型 `String`)。The created at. |
name | String | 名称(类型 `String`)。The name. |
value | Map<String, Object> | 值(类型 `Map`)。The value. |
io/agentscope/core/event/CustomEvent.java:44–53CustomEvent
public CustomEvent(String name, Map<String, Object> value)
初始化 CustomEvent 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
name | String | 名称(类型 `String`)。The name. |
value | Map<String, Object> | 值(类型 `Map`)。The value. |
io/agentscope/core/event/CustomEvent.java:55–58CustomEvent
public CustomEvent(String name)
初始化 CustomEvent 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
name | String | 名称(类型 `String`)。The name. |
io/agentscope/core/event/CustomEvent.java:60–62方法详情Method Detail
getType
public AgentEventType getType()
获取类型。
Returns the type.
AgentEventTypeio/agentscope/core/event/CustomEvent.java:64–67getName
public String getName()
返回种类的通知。
Returns the kind of notification.
Stringio/agentscope/core/event/CustomEvent.java:72–74getValue
public Map<String, Object> getValue()
获取值。
Returns the arbitrary JSON-serializable payload whose schema depends on #getName().
Map<String, Object>io/agentscope/core/event/CustomEvent.java:79–81