haive.agents.research.perplexity.pro_search.tasks.models¶

Pydantic models for recursive conditional planning with tree-based task decomposition. Supports dynamic planning, parallel execution, and adaptive replanning.

Classes¶

ExecutionPlan

Execution plan for a set of tasks.

PlanningState

State for recursive planning workflow.

PlanningStrategy

Strategy configuration for the planning process.

ReplanningAnalysis

Analysis for replanning decision.

TaskDecomposition

Result of decomposing a high-level task.

TaskDependency

Dependency relationship between tasks.

TaskMetadata

Metadata for task tracking and optimization.

TaskNode

Individual task node in the planning tree.

TaskPriority

Priority levels for tasks.

TaskResource

Resource requirements for a task.

TaskStatus

Status of a task in the planning tree.

Module Contents¶

class haive.agents.research.perplexity.pro_search.tasks.models.ExecutionPlan(/, **data)¶

Bases: pydantic.BaseModel

Execution plan for a set of tasks.

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)

calculate_resource_requirements()¶

Calculate total resource requirements.

Return type:

ExecutionPlan

property can_parallelize: bool¶

Check if any parallelization is possible.

Return type:

bool

class haive.agents.research.perplexity.pro_search.tasks.models.PlanningState(/, **data)¶

Bases: pydantic.BaseModel

State for recursive planning workflow.

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)

add_task(task, parent_id=None)¶

Add a task to the tree.

Parameters:
Return type:

None

update_task_status(task_id, status, result=None)¶

Update task status and handle state transitions.

Parameters:
Return type:

None

property completion_percentage: float¶

Calculate completion percentage.

Return type:

float

property critical_path: list[str]¶

Get current critical path.

Return type:

list[str]

property executable_tasks: list[TaskNode]¶

Get tasks ready for execution.

Return type:

list[TaskNode]

property is_complete: bool¶

Check if planning goal is achieved.

Return type:

bool

property needs_replanning: bool¶

Check if replanning is needed.

Return type:

bool

class haive.agents.research.perplexity.pro_search.tasks.models.PlanningStrategy(/, **data)¶

Bases: pydantic.BaseModel

Strategy configuration for the planning process.

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_strategy_coherence()¶

Ensure strategy settings are coherent.

Return type:

PlanningStrategy

class haive.agents.research.perplexity.pro_search.tasks.models.ReplanningAnalysis(/, **data)¶

Bases: pydantic.BaseModel

Analysis for replanning decision.

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 haive.agents.research.perplexity.pro_search.tasks.models.TaskDecomposition(/, **data)¶

Bases: pydantic.BaseModel

Result of decomposing a high-level task.

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)

calculate_critical_path()¶

Calculate critical path if not provided.

Return type:

TaskDecomposition

property parallelizable_groups: list[list[str]]¶

Identify groups of tasks that can run in parallel.

Return type:

list[list[str]]

class haive.agents.research.perplexity.pro_search.tasks.models.TaskDependency(/, **data)¶

Bases: pydantic.BaseModel

Dependency relationship between tasks.

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 haive.agents.research.perplexity.pro_search.tasks.models.TaskMetadata(/, **data)¶

Bases: pydantic.BaseModel

Metadata for task tracking and optimization.

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)

property can_retry: bool¶

Check if task can be retried.

Return type:

bool

property efficiency_ratio: float | None¶

Calculate efficiency ratio (estimated vs actual).

Return type:

float | None

class haive.agents.research.perplexity.pro_search.tasks.models.TaskNode(/, **data)¶

Bases: pydantic.BaseModel

Individual task node in the planning tree.

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)

can_start(completed_tasks)¶

Check if all dependencies are satisfied.

Parameters:

completed_tasks (set[str])

Return type:

bool

classmethod validate_children_for_type(v, info)¶

Validate children based on task type.

Return type:

Any

property is_complete: bool¶

Check if task is complete.

Return type:

bool

property is_executable: bool¶

Check if task can be executed.

Return type:

bool

property is_leaf: bool¶

Check if this is a leaf node.

Return type:

bool

class haive.agents.research.perplexity.pro_search.tasks.models.TaskPriority¶

Bases: str, enum.Enum

Priority levels for tasks.

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

class haive.agents.research.perplexity.pro_search.tasks.models.TaskResource(/, **data)¶

Bases: pydantic.BaseModel

Resource requirements for a task.

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)

property resource_key: str¶

Unique key for this resource requirement.

Return type:

str

class haive.agents.research.perplexity.pro_search.tasks.models.TaskStatus¶

Bases: str, enum.Enum

Status of a task in the planning tree.

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