类 Pipelines
java.lang.Object
io.agentscope.core.pipeline.Pipelines
Utility class providing functional-style pipeline operations.
This class provides static methods offering convenient ways to execute agent
pipelines without creating explicit pipeline objects.
These methods are stateless and suitable for one-time use, while the
class-based Pipeline implementations are better for reusable configurations.
-
方法概要
修饰符和类型方法说明compose(SequentialPipeline first, SequentialPipeline second) Compose two sequential pipelines into a single pipeline.static FanoutPipelinecreateFanout(List<AgentBase> agents) Create a reusable fanout pipeline with concurrent execution.static FanoutPipelinecreateFanoutSequential(List<AgentBase> agents) Create a reusable fanout pipeline with sequential execution.static SequentialPipelinecreateSequential(List<AgentBase> agents) Create a reusable sequential pipeline.Execute agents in a fanout pipeline with concurrent execution and no input.Execute agents in a fanout pipeline with concurrent execution.Execute agents in a fanout pipeline with concurrent execution and structured output.Execute agents in a fanout pipeline with concurrent execution, structured output, and no input.fanoutSequential(List<AgentBase> agents) Execute agents in a fanout pipeline with sequential execution and no input.fanoutSequential(List<AgentBase> agents, Msg input) Execute agents in a fanout pipeline with sequential execution.fanoutSequential(List<AgentBase> agents, Msg input, Class<?> structuredOutputClass) Execute agents in a fanout pipeline with sequential execution and structured output.fanoutSequential(List<AgentBase> agents, Class<?> structuredOutputClass) Execute agents in a fanout pipeline with sequential execution, structured output, and no input.static reactor.core.publisher.Mono<Msg> sequential(List<AgentBase> agents) Execute agents in a sequential pipeline with no initial input.static reactor.core.publisher.Mono<Msg> sequential(List<AgentBase> agents, Msg input) Execute agents in a sequential pipeline.static reactor.core.publisher.Mono<Msg> sequential(List<AgentBase> agents, Msg input, Class<?> structuredOutputClass) Execute agents in a sequential pipeline with structured output.static reactor.core.publisher.Mono<Msg> sequential(List<AgentBase> agents, Class<?> structuredOutputClass) Execute agents in a sequential pipeline with structured output and no initial input.
-
方法详细资料
-
sequential
Execute agents in a sequential pipeline. The output of each agent becomes the input of the next agent.- 参数:
agents- List of agents to execute sequentiallyinput- Initial input message- 返回:
- Mono containing the final result
-
sequential
Execute agents in a sequential pipeline with no initial input.- 参数:
agents- List of agents to execute sequentially- 返回:
- Mono containing the final result
-
sequential
public static reactor.core.publisher.Mono<Msg> sequential(List<AgentBase> agents, Msg input, Class<?> structuredOutputClass) Execute agents in a sequential pipeline with structured output.- 参数:
agents- List of agents to execute sequentiallyinput- Initial input messagestructuredOutputClass- The class type for structured output- 返回:
- Mono containing the final result with structured output
-
sequential
public static reactor.core.publisher.Mono<Msg> sequential(List<AgentBase> agents, Class<?> structuredOutputClass) Execute agents in a sequential pipeline with structured output and no initial input.- 参数:
agents- List of agents to execute sequentiallystructuredOutputClass- The class type for structured output- 返回:
- Mono containing the final result with structured output
-
fanout
Execute agents in a fanout pipeline with concurrent execution. All agents receive the same input and execute concurrently.- 参数:
agents- List of agents to execute in parallelinput- Input message to distribute to all agents- 返回:
- Mono containing list of all results
-
fanout
Execute agents in a fanout pipeline with concurrent execution and no input.- 参数:
agents- List of agents to execute in parallel- 返回:
- Mono containing list of all results
-
fanout
public static reactor.core.publisher.Mono<List<Msg>> fanout(List<AgentBase> agents, Msg input, Class<?> structuredOutputClass) Execute agents in a fanout pipeline with concurrent execution and structured output.- 参数:
agents- List of agents to execute in parallelinput- Input message to distribute to all agentsstructuredOutputClass- The class type for structured output- 返回:
- Mono containing list of all results with structured output
-
fanout
public static reactor.core.publisher.Mono<List<Msg>> fanout(List<AgentBase> agents, Class<?> structuredOutputClass) Execute agents in a fanout pipeline with concurrent execution, structured output, and no input.- 参数:
agents- List of agents to execute in parallelstructuredOutputClass- The class type for structured output- 返回:
- Mono containing list of all results with structured output
-
fanoutSequential
public static reactor.core.publisher.Mono<List<Msg>> fanoutSequential(List<AgentBase> agents, Msg input) Execute agents in a fanout pipeline with sequential execution. All agents receive the same input but execute one after another.- 参数:
agents- List of agents to execute sequentially (but independently)input- Input message to distribute to all agents- 返回:
- Mono containing list of all results
-
fanoutSequential
Execute agents in a fanout pipeline with sequential execution and no input.- 参数:
agents- List of agents to execute sequentially (but independently)- 返回:
- Mono containing list of all results
-
fanoutSequential
public static reactor.core.publisher.Mono<List<Msg>> fanoutSequential(List<AgentBase> agents, Msg input, Class<?> structuredOutputClass) Execute agents in a fanout pipeline with sequential execution and structured output.- 参数:
agents- List of agents to execute sequentially (but independently)input- Input message to distribute to all agentsstructuredOutputClass- The class type for structured output- 返回:
- Mono containing list of all results with structured output
-
fanoutSequential
public static reactor.core.publisher.Mono<List<Msg>> fanoutSequential(List<AgentBase> agents, Class<?> structuredOutputClass) Execute agents in a fanout pipeline with sequential execution, structured output, and no input.- 参数:
agents- List of agents to execute sequentially (but independently)structuredOutputClass- The class type for structured output- 返回:
- Mono containing list of all results with structured output
-
createSequential
Create a reusable sequential pipeline.- 参数:
agents- List of agents for the pipeline- 返回:
- Sequential pipeline instance
-
createFanout
Create a reusable fanout pipeline with concurrent execution.- 参数:
agents- List of agents for the pipeline- 返回:
- Concurrent fanout pipeline instance
-
createFanoutSequential
Create a reusable fanout pipeline with sequential execution.- 参数:
agents- List of agents for the pipeline- 返回:
- Sequential fanout pipeline instance
-
compose
Compose two sequential pipelines into a single pipeline.- 参数:
first- First pipeline to executesecond- Second pipeline to execute with output from first- 返回:
- Composed pipeline
-