AS AgentScopeAPI 手册 / API Reference
类class agentscope.event

CustomEvent

class CustomEvent(EventBase)
源码Source agentscope/event/_event.py:533–567

自定义事件,描述执行过程中的事件。位于 agentscope.event 包,继承自 EventBase。

Used by service-layer middleware to notify front-end subscribers about state changes (task progress, team membership, permission updates, …) without polluting the core agent event enum with application-specific types.

Front-end implementations should handle unknown name values gracefully — skip with no error.

属性摘要Attribute Summary

属性Attribute类型Type说明Description值Value
typeLiteral[EventType.CUSTOM]
类型字段。
EventType.CUSTOM
namestr
名称字段。
Identifies the kind of notification. Well-known values: - ``"state_updated"`` — agent state (tasks / permission) changed during a tool call. - ``"team_updated"`` — team membership changed (member added / team created or dissolved). - ``"mcp_progress"`` — transient MCP tool progress, with ``reply_id``, ``tool_call_id``, ``progress``, ``total`` and ``message`` in ``value``. Not part of the final tool result.
—
valuedict
值字段。
Arbitrary JSON-serializable payload whose schema depends on ``name``. May be empty.
Field(default_factory=dict)

属性详情Attribute Detail

type

Literal[EventType.CUSTOM] = EventType.CUSTOM

类型字段。声明为 Literal[EventType.CUSTOM]。

The type field.

源码Source agentscope/event/_event.py:562

name

str

名称字段。声明为 str。

Identifies the kind of notification. Well-known values:

  • "state_updated" — agent state (tasks / permission) changed during a tool call.
  • "team_updated" — team membership changed (member added / team created or dissolved).
  • "mcp_progress" — transient MCP tool progress, with reply_id, tool_call_id, progress, total and message in value. Not part of the final tool result.
源码Source agentscope/event/_event.py:564

value

dict = Field(default_factory=dict)

值字段。声明为 dict。

Arbitrary JSON-serializable payload whose schema depends on name. May be empty.

源码Source agentscope/event/_event.py:566

继承成员Inherited Members

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