AS AgentScopeAPI 手册 / API Reference
类class agentscope.app.channel

ChannelEvent

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_idstr
渠道标识字段。
—
channel_user_idstr
渠道用户标识字段。
—
channel_user_namestr
渠道用户名称字段。
''
chat_idstr
聊天标识字段。
—
chat_namestr
聊天名称字段。
''
channel_message_idstr | None
渠道消息标识字段。
None
contentlist[TextBlock | DataBlock]
内容字段。
Field(default_factory=list)
metadatadict[str, Any]
元数据字段。
Field(default_factory=dict)
received_atstr
已接收 at字段。
Field(default_factory=lambda: datetime.now().isoformat())

属性详情Attribute Detail

channel_id

str

渠道标识字段。声明为 str。

The channel id field.

源码Source agentscope/app/channel/_base.py:65

channel_user_id

str

渠道用户标识字段。声明为 str。

The channel user id field.

源码Source agentscope/app/channel/_base.py:68

channel_user_name

str = ''

渠道用户名称字段。声明为 str。

The channel user name field.

源码Source agentscope/app/channel/_base.py:71

chat_id

str

聊天标识字段。声明为 str。

The chat id field.

源码Source agentscope/app/channel/_base.py:75

chat_name

str = ''

聊天名称字段。声明为 str。

The chat name field.

源码Source agentscope/app/channel/_base.py:79

channel_message_id

str | None = None

渠道消息标识字段。声明为 str | None。

The channel message id field.

源码Source agentscope/app/channel/_base.py:83

content

list[TextBlock | DataBlock] = Field(default_factory=list)

内容字段。声明为 list[TextBlock | DataBlock]。

The content field.

源码Source agentscope/app/channel/_base.py:86

metadata

dict[str, Any] = Field(default_factory=dict)

元数据字段。声明为 dict[str, Any]。

The metadata field.

源码Source agentscope/app/channel/_base.py:89

received_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).

返回Returns str
返回字符串结果。Returns a string.
源码Source agentscope/app/channel/_base.py:98–104
基于官方固定版本源码静态生成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.