类class
agentscope.app.channelChannelEvent
class ChannelEvent(BaseModel)
源码Source
agentscope/app/channel/_base.py:57–104渠道事件,描述执行过程中的事件。位于 agentscope.app.channel 包。核心成员包括 message。
content reuses the same TextBlock / DataBlock types as
Msg.content so the pipeline can hand it to the agent without a
conversion step.
属性摘要Property Summary
| 属性Property | 说明Description |
|---|---|
message | 获取消息。 Concatenate all ``TextBlock`` texts (convenience accessor). |
属性摘要Attribute Summary
| 属性Attribute | 类型Type | 说明Description | 值Value |
|---|---|---|---|
channel_id | str | 渠道标识字段。 | — |
channel_user_id | str | 渠道用户标识字段。 | — |
channel_user_name | str | 渠道用户名称字段。 | '' |
chat_id | str | 聊天标识字段。 | — |
chat_name | str | 聊天名称字段。 | '' |
channel_message_id | str | None | 渠道消息标识字段。 | None |
content | list[TextBlock | DataBlock] | 内容字段。 | Field(default_factory=list) |
metadata | dict[str, Any] | 元数据字段。 | Field(default_factory=dict) |
received_at | str | 已接收 at字段。 | Field(default_factory=lambda: datetime.now().isoformat()) |
属性详情Attribute Detail
channel_id
str渠道标识字段。声明为 str。
The channel id field.
源码Source
agentscope/app/channel/_base.py:65channel_user_id
str渠道用户标识字段。声明为 str。
The channel user id field.
源码Source
agentscope/app/channel/_base.py:68channel_user_name
str = ''渠道用户名称字段。声明为 str。
The channel user name field.
源码Source
agentscope/app/channel/_base.py:71chat_id
str聊天标识字段。声明为 str。
The chat id field.
源码Source
agentscope/app/channel/_base.py:75chat_name
str = ''聊天名称字段。声明为 str。
The chat name field.
源码Source
agentscope/app/channel/_base.py:79channel_message_id
str | None = None渠道消息标识字段。声明为 str | None。
The channel message id field.
源码Source
agentscope/app/channel/_base.py:83content
list[TextBlock | DataBlock] = Field(default_factory=list)内容字段。声明为 list[TextBlock | DataBlock]。
The content field.
源码Source
agentscope/app/channel/_base.py:86metadata
dict[str, Any] = Field(default_factory=dict)元数据字段。声明为 dict[str, Any]。
The metadata field.
源码Source
agentscope/app/channel/_base.py:89received_at
str = Field(default_factory=lambda: datetime.now().isoformat())已接收 at字段。声明为 str。
The received at field.
源码Source
agentscope/app/channel/_base.py:93属性详情Property Detail
message
def message() -> str
获取消息。
Concatenate all TextBlock texts (convenience accessor).
str
返回字符串结果。Returns a string.
源码Source
agentscope/app/channel/_base.py:98–104