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

Public Member Functions

None __init__ (self, AgentFactory agent_factory, int max_token=1024)
 
list[Agentcreate_agent (self, str task, str init_message=None)
 

Public Attributes

 agent_factory = agent_factory
 
list[Agenttask_generator
 
list[Agentagent_generator
 
 sequencial_agent
 
list agents = []
 

Detailed Description

A utility class for automatically generating and managing task-specific agents 
based on a given high-level task description.

This class uses a sequential pipeline of two agents:
    1. `task_generator` – Breaks down a high-level task into smaller, 
       structured subtasks.
    2. `agent_generator` – Creates dedicated agents for each subtask with 
       specific system prompts and configurations.

The resulting agents are combined into an `AutoAgentManager` for coordinated 
execution, ensuring that the output from one agent feeds into the next.

Attributes:
    agent_factory (AgentFactory): Factory for creating agents with predefined 
        settings.
    task_generator (Agent): The agent responsible for generating subtasks 
        from a high-level task description.
    agent_generator (Agent): The agent responsible for creating specialized 
        agents based on generated subtasks.
    sequencial_agent (SimpleSequentialAgents): Manages the execution of 
        `task_generator` followed by `agent_generator`.
    agents (list): Stores created agents.

Args:
    agent_factory (AgentFactory): The factory used to create new agents.
    max_token (int, optional): Maximum token limit for each agent. Defaults 
        to 1024.

Methods:
    create_agent(task: str, init_message: str = None) -> list[Agent]:
        Generates agents for a given high-level task, creates an 
        AutoAgentManager to run them, and returns the configured manager.
        The process:
            - Pass the task to the sequential pipeline.
            - Convert generated subtask definitions into real agents.
            - Initialize an AutoAgentManager for coordinated multi-agent execution.

Constructor & Destructor Documentation

◆ __init__()

None iragent.models.SmartAgentBuilder.__init__ ( self,
AgentFactory agent_factory,
int max_token = 1024 )

Member Function Documentation

◆ create_agent()

list[Agent] iragent.models.SmartAgentBuilder.create_agent ( self,
str task,
str init_message = None )

Member Data Documentation

◆ agent_factory

iragent.models.SmartAgentBuilder.agent_factory = agent_factory

◆ agent_generator

list[Agent] iragent.models.SmartAgentBuilder.agent_generator
Initial value:
= self.agent_factory.create_agent(
name = "agent_creator",
temprature=0.0,
max_token = max_token,
system_prompt= AGENT_GENERATOR,
response_format = {"type": "json_object"}
)

◆ agents

list iragent.models.SmartAgentBuilder.agents = []

◆ sequencial_agent

iragent.models.SmartAgentBuilder.sequencial_agent
Initial value:
= SimpleSequentialAgents(
agents= [self.task_generator, self.agent_generator],
init_message= ""
)

◆ task_generator

list[Agent] iragent.models.SmartAgentBuilder.task_generator
Initial value:
= self.agent_factory.create_agent(
name="task_generator",
temprature=0.1,
max_token = max_token,
system_prompt = TASK_GENERATOR,
)

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