agents.planning.enhanced_plan_execute_v5.planner.promptsΒΆ

Planner Prompts - Advanced prompt templates for strategic planning.

This module provides sophisticated prompt templates designed for creating comprehensive, actionable plans using modern prompt engineering techniques.

FunctionsΒΆ

create_planning_context(objective[, available_tools, ...])

Create a complete context dictionary for planning prompts.

format_previous_attempts(attempts)

Format previous attempts for inclusion in prompts.

format_tools_list(tools)

Format tools list for inclusion in prompts.

get_planning_template(objective[, domain_focus, ...])

Select the most appropriate planning template based on context.

Module ContentsΒΆ

agents.planning.enhanced_plan_execute_v5.planner.prompts.create_planning_context(objective, available_tools=None, domain_focus=None, complexity_level='moderate', time_constraints=None, previous_attempts=None, additional_context=None)ΒΆ

Create a complete context dictionary for planning prompts.

Parameters:
  • objective (str) – The main objective

  • available_tools (list) – Tools available for execution

  • domain_focus (str) – Specific domain focus

  • complexity_level (str) – Desired complexity level

  • time_constraints (str) – Time limitations

  • previous_attempts (list) – Previous planning attempts

  • additional_context (str) – Additional context information

Returns:

Complete context for planning prompts

Return type:

dict

Examples

Basic context:

context = create_planning_context(
    objective="Research market trends",
    available_tools=["web_search", "calculator"],
    complexity_level="detailed"
)

Advanced context:

context = create_planning_context(
    objective="Analyze competitor strategy",
    available_tools=["web_search", "document_reader"],
    domain_focus="business_analysis",
    time_constraints="Complete within 2 hours",
    previous_attempts=["Initial research was too broad"]
)
agents.planning.enhanced_plan_execute_v5.planner.prompts.format_previous_attempts(attempts)ΒΆ

Format previous attempts for inclusion in prompts.

Parameters:

attempts (list) – List of previous attempt descriptions

Returns:

Formatted previous attempts description

Return type:

str

agents.planning.enhanced_plan_execute_v5.planner.prompts.format_tools_list(tools)ΒΆ

Format tools list for inclusion in prompts.

Parameters:

tools (list) – List of available tools

Returns:

Formatted tools description

Return type:

str

agents.planning.enhanced_plan_execute_v5.planner.prompts.get_planning_template(objective, domain_focus=None, has_previous_attempts=False, additional_context=None)ΒΆ

Select the most appropriate planning template based on context.

Parameters:
  • objective (str) – The planning objective

  • domain_focus (str) – Specific domain or area of focus

  • has_previous_attempts (bool) – Whether there were previous planning attempts

  • additional_context (str) – Any additional context information

Returns:

The most suitable template for the context

Return type:

ChatPromptTemplate

Examples

Research planning:

template = get_planning_template(
    objective="Research AI trends",
    domain_focus="artificial_intelligence"
)

Adaptive planning:

template = get_planning_template(
    objective="Complete analysis",
    has_previous_attempts=True
)