nat.experimental.test_time_compute.search.multi_llm_planner#

Attributes#

Classes#

MultiLLMPlanner

A planner that uses multiple LLMs to generate plans. Each LLM can generate

Functions#

register_multi_llm_planner(config, builder)

Register the MultiLLMPlanner strategy with the provided configuration.

Module Contents#

logger#
class MultiLLMPlanner(
config: nat.experimental.test_time_compute.models.search_config.MultiLLMPlanConfig,
)#

Bases: nat.experimental.test_time_compute.models.strategy_base.StrategyBase

A planner that uses multiple LLMs to generate plans. Each LLM can generate a specified number of plans, and all plans are combined.

config#
llms_bound = []#
async build_components(builder: nat.builder.builder.Builder) None#

Build the components required for this multi-LLM planner. Binds each LLMRef from the config with the selected framework wrapper (LANGCHAIN).

supported_pipeline_types() [nat.experimental.test_time_compute.models.stage_enums.PipelineTypeEnum]#

Return the stage types supported by this selector.

stage_type() nat.experimental.test_time_compute.models.stage_enums.StageTypeEnum#

Return the stage type of this strategy.

async _generate_plan_for_temperature(
llm,
base_prompt: str,
temperature: float,
) nat.experimental.test_time_compute.models.ttc_item.TTCItem#
async _generate_plans_for_llm(
llm,
base_prompt: str,
) list[nat.experimental.test_time_compute.models.ttc_item.TTCItem]#
async ainvoke(
items: list[nat.experimental.test_time_compute.models.ttc_item.TTCItem],
original_prompt: str | None = None,
agent_context: str | None = None,
**kwargs,
) list[nat.experimental.test_time_compute.models.ttc_item.TTCItem]#

Generate a list of PlanningItems by querying each LLM in self.llms_bound. Each LLM produces ‘plans_per_llm’ plans.

async register_multi_llm_planner(
config: nat.experimental.test_time_compute.models.search_config.MultiLLMPlanConfig,
builder: nat.builder.builder.Builder,
)#

Register the MultiLLMPlanner strategy with the provided configuration.