类class
agentscope.app.channelChannelGateway
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 |
|---|---|---|
storage | StorageBase | 存储(类型 `StorageBase`)。Application storage. |
message_bus | MessageBus | 消息总线(类型 `MessageBus`)。Application message bus. |
workspace_manager | WorkspaceManagerBase | 工作区管理器(类型 `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 |
|---|---|---|
event | ChannelEvent | ChannelConfirmationResultEvent | 事件(类型 `ChannelEvent | ChannelConfirmationResultEvent`)。The inbound message or card-click decision. |
None
无返回值。No value is returned.
源码Source
agentscope/app/channel/_gateway.py:67–86