ExecutionUnit#

class council.controllers.ExecutionUnit(chain: ChainBase, budget: Budget, initial_state: ChatMessage | None = None, name: str | None = None, rank: int | None = None)[source]#

Bases: object

Represents an execution unit to be executed by an Agent

Parameters:
  • chain (ChainBase) – the chain to be executed

  • budget (Budget) – the budget granted for this execution

  • initial_state (Optional[ChatMessage]) – an optional message that will be injected in the chain context

  • name (Optional[str]) – a unique name for the execution. Defaults to Chain.name

  • rank (Optional[int]) – execution rank for execution, executed by ascending order. Same rank are executed in parallel. If not set, default to sequential execution.

property budget: Budget#

The budget for the execution

Return type:

Budget

property chain: ChainBase#

The chain to be executed

Return type:

Chain

property initial_state: ChatMessage | None#

An optional message to put in the chain context

Returns:

Optional[ChatMessage]

property name: str#

Name of the execution unit

Return type:

str

property rank: int#

Execution Rank

Return type:

int