agents.planning.plan_execute_v3.models

Plan-and-Execute V3 Models - Structured Output Models for the agent.

Based on the Plan-and-Execute methodology where planning and execution are separated into distinct phases with structured outputs.

Classes

ExecutionPlan

Complete execution plan with metadata.

Plan

Simple plan model for basic planning operations.

PlanEvaluation

Evaluation of current plan progress and decision on next action.

PlanExecuteInput

Input format for the Plan-and-Execute agent.

PlanExecuteOutput

Final output from the Plan-and-Execute agent.

PlanStep

Individual step in an execution plan.

RevisedPlan

Revised execution plan based on evaluation.

StepExecution

Result from executing a single step.

StepStatus

Status of a plan step.

Module Contents

class agents.planning.plan_execute_v3.models.ExecutionPlan(/, **data)

Bases: pydantic.BaseModel

Complete execution plan with metadata.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

get_next_step()

Get the next step ready for execution.

Return type:

PlanStep | None

get_progress_percentage()

Calculate completion percentage.

Return type:

float

has_failures()

Check if any steps have failed.

Return type:

bool

is_complete()

Check if all steps are completed.

Return type:

bool

update_total_steps()

Ensure total_steps matches actual step count.

classmethod validate_step_ids(v)

Ensure step IDs are sequential starting from 1.

class agents.planning.plan_execute_v3.models.Plan(/, **data)

Bases: pydantic.BaseModel

Simple plan model for basic planning operations.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

classmethod from_execution_plan(execution_plan)

Create a simple Plan from an ExecutionPlan.

Parameters:

execution_plan (ExecutionPlan)

Return type:

Plan

class agents.planning.plan_execute_v3.models.PlanEvaluation(/, **data)

Bases: pydantic.BaseModel

Evaluation of current plan progress and decision on next action.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

validate_decision_fields()

Ensure required fields are present based on decision.

class agents.planning.plan_execute_v3.models.PlanExecuteInput(/, **data)

Bases: pydantic.BaseModel

Input format for the Plan-and-Execute agent.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

class agents.planning.plan_execute_v3.models.PlanExecuteOutput(/, **data)

Bases: pydantic.BaseModel

Final output from the Plan-and-Execute agent.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

class agents.planning.plan_execute_v3.models.PlanStep(/, **data)

Bases: pydantic.BaseModel

Individual step in an execution plan.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

classmethod validate_dependencies(v, info)

Ensure dependencies are valid step IDs.

class agents.planning.plan_execute_v3.models.RevisedPlan(/, **data)

Bases: pydantic.BaseModel

Revised execution plan based on evaluation.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

class agents.planning.plan_execute_v3.models.StepExecution(/, **data)

Bases: pydantic.BaseModel

Result from executing a single step.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

class agents.planning.plan_execute_v3.models.StepStatus

Bases: str, enum.Enum

Status of a plan step.

Initialize self. See help(type(self)) for accurate signature.