类class
agentscope.pipelinePipelineProtocol
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 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 |
|---|---|---|
inputs | Msg | list[Msg] | UserConfirmResultEvent | UserInterruptEvent | ExternalExecutionResultEvent | 输入消息(类型 `Msg | list[Msg] | UserConfirmResultEvent | UserInterruptEvent | ExternalExecutionResultEvent`)。The inputs. |
AsyncGenerator[AgentEvent | Msg, None]
以异步流的形式返回AgentEvent|消息,None。Returns a stream of agent event msg none.
源码Source
agentscope/pipeline/_base.py:24–32