AgentChain#

class council.agents.AgentChain(name: str, description: str, agent: Agent)[source]#

Bases: ChainBase

A chain that wraps an Agent, so that it can be invoked from another agent.

__init__(name: str, description: str, agent: Agent) None[source]#

Initialize a new instance.

Parameters:
  • name (str) – The name of the chain.

  • description (str) – The description of the chain.

  • agent (Agent) – The agent to be wrapped

property description: str#

the description of the chain.

execute(context: ChainContext, executor: ThreadPoolExecutor | None = None) None#

Executes the chain of skills based on the provided context, budget, and optional executor.

Parameters:
  • context (ChainContext) – The context for executing the chain.

  • executor (Optional[RunnerExecutor]) – The skill executor to use for executing the chain.

Returns:

The result of executing the chain.

Return type:

Any

Raises:

None

property name: str#

the name of the chain

render_as_dict(include_children: bool = True) Dict[str, Any]#

returns the graph of operation as a dictionary

render_as_json() str#

returns the graph of operation as a JSON string