nat.experimental.test_time_compute.scoring.llm_based_plan_scorer#
Attributes#
Classes#
Functions#
|
Register the LLM-based plan scorer strategy. |
Module Contents#
- logger#
- class LLMBasedPlanScorer( )#
Bases:
nat.experimental.test_time_compute.models.strategy_base.StrategyBase- llm_bound = None#
- async build_components(builder: nat.builder.builder.Builder) None#
Build the components required for the planner.
- supported_pipeline_types() [nat.experimental.test_time_compute.models.stage_enums.PipelineTypeEnum]#
- async score_single(
- original_prompt: str,
- agent_context: str,
- planning_item: nat.experimental.test_time_compute.models.ttc_item.TTCItem,
Score a single planning item using the LLM.
- Args:
original_prompt (str): The original prompt. agent_context (str): The agent context. planning_item (TTCItem): The item to score.
- Returns:
float: The score of the item.
- 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]#
Score a list of planning items.
- Args:
original_prompt (str): The original prompt. agent_context (str): The agent context. items (list[TTCItem]): The list of planning items to score.
- Returns:
list[float]: A list of scores corresponding to each planning item.
- async register_llm_based_plan_scorer(
- config: nat.experimental.test_time_compute.models.scoring_config.LLMBasedPlanScoringConfig,
- builder: nat.builder.builder.Builder,
Register the LLM-based plan scorer strategy.
- Args:
config (LLMBasedPlanScoringConfig): The configuration for the strategy. builder (Builder): The builder instance.
- Returns:
LLMBasedPlanScorer: The registered LLM-based plan scorer.