类class
agentscope.eventCustomEvent
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 |
|---|---|---|---|
type | Literal[EventType.CUSTOM] | 类型字段。 | EventType.CUSTOM |
name | 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. | — |
value | dict | 值字段。 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:562name
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, withreply_id,tool_call_id,progress,totalandmessageinvalue. Not part of the final tool result.
源码Source
agentscope/event/_event.py:564value
dict = Field(default_factory=dict)值字段。声明为 dict。
Arbitrary JSON-serializable payload whose schema depends
on name. May be empty.
源码Source
agentscope/event/_event.py:566