类 Pipelines

java.lang.Object
io.agentscope.core.pipeline.Pipelines

public class Pipelines extends Object
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.
  • 方法详细资料

    • sequential

      public static reactor.core.publisher.Mono<Msg> sequential(List<AgentBase> agents, Msg input)
      Execute agents in a sequential pipeline. The output of each agent becomes the input of the next agent.
      参数:
      agents - List of agents to execute sequentially
      input - Initial input message
      返回:
      Mono containing the final result
    • sequential

      public static reactor.core.publisher.Mono<Msg> sequential(List<AgentBase> agents)
      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 sequentially
      input - Initial input message
      structuredOutputClass - 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 sequentially
      structuredOutputClass - The class type for structured output
      返回:
      Mono containing the final result with structured output
    • fanout

      public static reactor.core.publisher.Mono<List<Msg>> fanout(List<AgentBase> agents, Msg input)
      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 parallel
      input - Input message to distribute to all agents
      返回:
      Mono containing list of all results
    • fanout

      public static reactor.core.publisher.Mono<List<Msg>> fanout(List<AgentBase> agents)
      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 parallel
      input - Input message to distribute to all agents
      structuredOutputClass - 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 parallel
      structuredOutputClass - 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

      public static reactor.core.publisher.Mono<List<Msg>> fanoutSequential(List<AgentBase> agents)
      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 agents
      structuredOutputClass - 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

      public static SequentialPipeline createSequential(List<AgentBase> agents)
      Create a reusable sequential pipeline.
      参数:
      agents - List of agents for the pipeline
      返回:
      Sequential pipeline instance
    • createFanout

      public static FanoutPipeline createFanout(List<AgentBase> agents)
      Create a reusable fanout pipeline with concurrent execution.
      参数:
      agents - List of agents for the pipeline
      返回:
      Concurrent fanout pipeline instance
    • createFanoutSequential

      public static FanoutPipeline createFanoutSequential(List<AgentBase> agents)
      Create a reusable fanout pipeline with sequential execution.
      参数:
      agents - List of agents for the pipeline
      返回:
      Sequential fanout pipeline instance
    • compose

      public static Pipeline<Msg> compose(SequentialPipeline first, SequentialPipeline second)
      Compose two sequential pipelines into a single pipeline.
      参数:
      first - First pipeline to execute
      second - Second pipeline to execute with output from first
      返回:
      Composed pipeline