LLMController#

classDiagram ControllerBase <|-- LLMController
class council.controllers.LLMController(llm: LLMBase, response_threshold: float = 0, top_k_execution_plan: int = 10000)[source]#

Bases: ControllerBase

A controller that uses an LLM to decide the execution plan

__init__(llm: LLMBase, response_threshold: float = 0, top_k_execution_plan: int = 10000)[source]#

Initialize a new instance

Parameters:
  • llm (LLMBase) – the instance of LLM to use

  • response_threshold (float) – a minimum threshold to select a response from its score

  • top_k_execution_plan (int) – maximum number of execution plan returned

get_plan(context: AgentContext, chains: List[Chain], budget: Budget) List[ExecutionUnit][source]#

Generates an execution plan for the agent based on the provided context, chains, and budget.

Parameters:
  • context (AgentContext) – The context for generating the execution plan.

  • chains (List[Chain]) – The list of chains available for execution.

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

Returns:

A list of execution units representing the execution plan.

Return type:

List[ExecutionUnit]

Raises:

None

select_responses(context: AgentContext) List[ScoredChatMessage][source]#

Selects responses from the agent’s context.

Parameters:

context (AgentContext) – The context for selecting responses.

Returns:

A list of scored agent messages representing the selected responses.

Return type:

List[ScoredChatMessage]

Raises:

None