Agent#

class council.agents.Agent(controller: ControllerBase, chains: List[Chain], evaluator: EvaluatorBase)[source]#

Bases: object

Represents an agent that executes a set of chains to interact with the environment.

controller#

The controller responsible for generating execution plans.

Type:

ControllerBase

chains#

The list of chains that the agent executes.

Type:

List[Chain]

evaluator#

The evaluator responsible for evaluating the agent’s performance.

Type:

EvaluatorBase

__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:

AgentResult

Raises:

None

execute_from_user_message(message: str) AgentResult[source]#

Helper function that executes an agent with a simple user message.

Parameters:

message (str) – the user message

Return type:

AgentResult

static from_skill(skill: SkillBase, chain_description: str | None = None) Agent[source]#
Helper function to create a new agent with a BasicController, a

BasicEvaluator and a single SkillBase wrapped into a Chain

Parameters:
  • skill (SkillBase) – a skill

  • chain_description (str) – Optional, chain description

Returns:

a new instance

Return type:

Agent