Chain#

class council.chains.Chain(name: str, description: str, runners: List[RunnerBase])[source]#

Bases: Monitorable

Represents a chain of skills that can be executed in a specific order.

__init__(name: str, description: str, runners: List[RunnerBase])[source]#

Initializes the Chain object.

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

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

  • runners (List[RunnerBase]) – The list of runners representing the skills in the chain.

Raises:

None

property description: str#

the description of the chain.

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

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

property runner: RunnerBase#

the runner of the chain