AS AgentScopeAPI 手册 / API Reference
类class agentscope.pipeline

PipelineProtocol

class PipelineProtocol(Protocol)
源码Source agentscope/pipeline/_base.py:15–32

流水线协议,把复杂任务拆分为可执行步骤并驱动流程。位于 agentscope.pipeline 包,继承自 Protocol。核心成员包括 reply_stream。

Declared as a plain def returning an async generator rather than an async def: such a function is called, not awaited, and an async def here would be satisfied by neither Agent nor any pipeline.

方法摘要Method Summary

方法Method说明Description
def reply_stream(inputs: Msg | list[Msg] | UserConfirmResultEvent | UserInterruptEvent | ExternalExecutionResultEvent)…
流式回复输入消息,并逐个产出事件或消息。
Reply to the given inputs and stream what happens.

方法详情Method Detail

reply_stream

def reply_stream(inputs: Msg | list[Msg] | UserConfirmResultEvent | UserInterruptEvent | ExternalExecutionResultEvent) -> AsyncGenerator[AgentEvent | Msg, None]

流式回复输入消息,并逐个产出事件或消息。

Reply to the given inputs and stream what happens.

参数Parameters
名称Name类型Type说明Description
inputsMsg | list[Msg] | UserConfirmResultEvent | UserInterruptEvent | ExternalExecutionResultEvent输入消息(类型 `Msg | list[Msg] | UserConfirmResultEvent | UserInterruptEvent | ExternalExecutionResultEvent`)。The inputs.
返回Returns AsyncGenerator[AgentEvent | Msg, None]
以异步流的形式返回AgentEvent|消息,None。Returns a stream of agent event msg none.
源码Source agentscope/pipeline/_base.py:24–32
基于官方固定版本源码静态生成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.