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

ChannelGateway

class ChannelGateway
源码Source agentscope/app/channel/_gateway.py:46–354

渠道网关,把智能体接入外部消息渠道与企业平台。位于 agentscope.app.channel 包。核心成员包括 process。

Route inbound channel events into runs; resume on card clicks. Declared in agentscope.app.channel.

构造器摘要Constructor Summary

构造器Constructor说明Description
def __init__(storage: StorageBase, message_bus: MessageBus, workspace_manager: WorkspaceManagerBase) -> None
初始化 `ChannelGateway` 实例。
Bind storage, the message bus, and the workspace manager.

方法摘要Method Summary

方法Method说明Description
async def process(event: ChannelEvent | ChannelConfirmationResultEvent) -> Noneasync
设置该参数。
Handle one inbound event (message or confirmation decision).

构造器详情Constructor Detail

ChannelGateway

def __init__(storage: StorageBase, message_bus: MessageBus, workspace_manager: WorkspaceManagerBase) -> None

初始化 ChannelGateway 实例。

Bind storage, the message bus, and the workspace manager.

参数Parameters
名称Name类型Type说明Description
storageStorageBase存储(类型 `StorageBase`)。Application storage.
message_busMessageBus消息总线(类型 `MessageBus`)。Application message bus.
workspace_managerWorkspaceManagerBase工作区管理器(类型 `WorkspaceManagerBase`)。Assigns each derived session its workspace under the isolation policy.
源码Source agentscope/app/channel/_gateway.py:49–65

方法详情Method Detail

process

async def process(event: ChannelEvent | ChannelConfirmationResultEvent) -> None
async

设置该参数。

Handle one inbound event (message or confirmation decision).

参数Parameters
名称Name类型Type说明Description
eventChannelEvent | ChannelConfirmationResultEvent事件(类型 `ChannelEvent | ChannelConfirmationResultEvent`)。The inbound message or card-click decision.
返回Returns None
无返回值。No value is returned.
源码Source agentscope/app/channel/_gateway.py:67–86
基于官方固定版本源码静态生成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.