Agent#
- class council.agents.Agent(controller: ControllerBase, chains: List[Chain], evaluator: EvaluatorBase)[source]#
Bases:
objectRepresents an agent that executes a set of chains to interact with the environment.
- controller#
The controller responsible for generating execution plans.
- Type:
- evaluator#
The evaluator responsible for evaluating the agent’s performance.
- Type:
- __init__(controller: ControllerBase, chains: List[Chain], evaluator: EvaluatorBase) None[source]#
Initializes the Agent object.
- Parameters:
controller (ControllerBase) – The controller responsible for generating execution plans.
chains (List[Chain]) – The list of chains that the agent executes.
evaluator (EvaluatorBase) – The evaluator responsible for evaluating the agent’s performance.
- execute(context: AgentContext, budget: Budget | None = None) AgentResult[source]#
Executes the agent’s chains based on the provided context and budget.
- Parameters:
context (AgentContext) – The context for executing the chains.
budget (Optional[Budget]) – The budget for agent execution. Defaults to
Budget.default()if None
- Return type:
- Raises:
None –
- execute_from_user_message(message: str, budget: Budget | None = None) AgentResult[source]#
Helper function that executes an agent with a simple user message.
- Parameters:
message (str) – the user message
budget (Budget) – the budget for the agent execution
- Return type:
- static from_chain(chain: Chain) Agent[source]#
- Helper function to create a new agent with a
BasicController, a BasicEvaluatorand a singleSkillBasewrapped into aChain
- Helper function to create a new agent with a
- static from_skill(skill: SkillBase, chain_description: str | None = None) Agent[source]#
- Helper function to create a new agent with a
BasicController, a BasicEvaluatorand a singleSkillBasewrapped into aChain
- Helper function to create a new agent with a