Skip to main content

portia.planning_agents.context

Context helpers for PlanningAgents.

render_prompt_insert_defaults

def render_prompt_insert_defaults(query: str,
tool_list: list[Tool],
system_context_extension: list[str]
| None = None,
examples: list[Plan] | None = None) -> str

Render the prompt for the PlanningAgent with defaults inserted if not provided.

default_query_system_context

def default_query_system_context(
system_context_extension: list[str] | None = None) -> list[str]

Return the default system context.

get_tool_descriptions_for_tools

def get_tool_descriptions_for_tools(
tool_list: list[Tool]) -> list[dict[str, str]]

Given a list of tool names, return the descriptions of the tools.