Iragent
This project is about using agents as simple as possible with small and large language models
Loading...
Searching...
No Matches
iragent.models.SimpleSequentialAgents Class Reference

Public Member Functions

 __init__ (self, List[Agent] agents, str init_message)
 
List[Messagestart (self)
 

Public Attributes

list history = []
 
 agent_manager
 

Detailed Description

A lightweight wrapper for running multiple agents in a fixed, 
predefined sequence.

This class sets up a chain of agents where each agent's output is 
automatically routed to the next agent in the list, until all 
agents have executed in order.

Internally, it uses `AgentManager` to handle message passing 
and execution, with the number of rounds set to the number of agents.

Attributes:
    history (list): Stores the conversation or execution history.
    agent_manager (AgentManager): Manages the sequential execution 
        of agents.

Args:
    agents (List[Agent]): The list of agents to execute in sequence.  
        Each agent will have its `next_agent` attribute set to the 
        name of the following agent in the list.
    init_message (str): The initial message content passed to the 
        first agent.

Methods:
    start() -> List[Message]:
        Runs the agents in sequential order, starting with the 
        initial message and passing outputs along the chain.
        Returns the list of `Message` objects representing the 
        results of each agent's execution.

Constructor & Destructor Documentation

◆ __init__()

iragent.models.SimpleSequentialAgents.__init__ ( self,
List[Agent] agents,
str init_message )

Member Function Documentation

◆ start()

List[Message] iragent.models.SimpleSequentialAgents.start ( self)

Member Data Documentation

◆ agent_manager

iragent.models.SimpleSequentialAgents.agent_manager
Initial value:
= AgentManager(
init_message=init_message,
agents=agents,
max_round=len(agents),
termination_fn=None,
first_agent=agents[0],
)

◆ history

list iragent.models.SimpleSequentialAgents.history = []

The documentation for this class was generated from the following file: