AS AgentScopeAPI 手册 / API Reference

CustomEvent

public class CustomEvent extends AgentEvent
源码Source 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.

参数Parameters
名称Name类型Type说明Description
idString标识(类型 `String`)。The id.
createdAtString已创建 At(类型 `String`)。The created at.
nameString名称(类型 `String`)。The name.
valueMap<String, Object>值(类型 `Map`)。The value.
源码Source io/agentscope/core/event/CustomEvent.java:44–53

CustomEvent

public CustomEvent(String name, Map<String, Object> value)

初始化 CustomEvent 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
nameString名称(类型 `String`)。The name.
valueMap<String, Object>值(类型 `Map`)。The value.
源码Source io/agentscope/core/event/CustomEvent.java:55–58

CustomEvent

public CustomEvent(String name)

初始化 CustomEvent 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
nameString名称(类型 `String`)。The name.
源码Source io/agentscope/core/event/CustomEvent.java:60–62

方法详情Method Detail

getType

public AgentEventType getType()

获取类型。

Returns the type.

返回Returns AgentEventType
返回AgentEventType。Returns agent event type.
源码Source io/agentscope/core/event/CustomEvent.java:64–67

getName

public String getName()

返回种类的通知。

Returns the kind of notification.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/event/CustomEvent.java:72–74

getValue

public Map<String, Object> getValue()

获取值。

Returns the arbitrary JSON-serializable payload whose schema depends on #getName().

返回Returns Map<String, Object>
返回映射。Returns map.
源码Source io/agentscope/core/event/CustomEvent.java:79–81

继承成员Inherited Members

基于官方固定版本源码静态生成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.