Chain#

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

Bases: object

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

name#

The name of the chain.

Type:

str

description#

The description of the chain.

Type:

str

runner#

The runner responsible for executing the chain.

Type:

RunnerBase

__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

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

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

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

  • budget (Budget) – The budget for chain execution.

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

Returns:

The result of executing the chain.

Return type:

Any

Raises:

None

get_description() str[source]#

Retrieves the description of the chain.

Returns:

The description of the chain.

Return type:

str

Raises:

None