agents.planning.llm_compiler_v3.modelsΒΆ

Pydantic models for LLM Compiler V3 Agent.

This module defines structured data models for the LLM Compiler pattern optimized for Enhanced MultiAgent V3 architecture.

ClassesΒΆ

CompilerInput

Input to the LLM Compiler V3 Agent.

CompilerOutput

Final output from the LLM Compiler V3 Agent.

CompilerPlan

Execution plan containing tasks and their dependencies.

CompilerTask

Individual task in the LLM Compiler execution DAG.

ExecutionMode

Execution mode for tasks.

ParallelExecutionResult

Result from executing a task.

ReplanRequest

Request for replanning when initial plan fails.

TaskDependency

Represents a dependency between tasks.

Module ContentsΒΆ

class agents.planning.llm_compiler_v3.models.CompilerInput(/, **data)ΒΆ

Bases: pydantic.BaseModel

Input to the LLM Compiler V3 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)

model_configΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class agents.planning.llm_compiler_v3.models.CompilerOutput(/, **data)ΒΆ

Bases: pydantic.BaseModel

Final output from the LLM Compiler V3 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)

get_failed_tasks()ΒΆ

Get only the failed tasks.

Return type:

list[ParallelExecutionResult]

get_successful_tasks()ΒΆ

Get only the successfully executed tasks.

Return type:

list[ParallelExecutionResult]

model_configΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

property success_rate: floatΒΆ

Calculate the success rate of task execution.

Return type:

float

class agents.planning.llm_compiler_v3.models.CompilerPlan(/, **data)ΒΆ

Bases: pydantic.BaseModel

Execution plan containing tasks and their dependencies.

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_executable_tasks(completed_task_ids)ΒΆ

Get tasks that can be executed now (dependencies satisfied).

Parameters:

completed_task_ids (list[str])

Return type:

list[CompilerTask]

get_join_task()ΒΆ

Get the final join task if it exists.

Return type:

CompilerTask | None

get_task_by_id(task_id)ΒΆ

Find task by ID.

Parameters:

task_id (str)

Return type:

CompilerTask | None

validate_dependencies()ΒΆ

Validate that all dependencies reference existing tasks.

Return type:

list[str]

model_configΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class agents.planning.llm_compiler_v3.models.CompilerTask(/, **data)ΒΆ

Bases: pydantic.BaseModel

Individual task in the LLM Compiler execution DAG.

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_execute_with_results(completed_tasks)ΒΆ

Check if all dependencies are satisfied.

Parameters:

completed_tasks (list[str])

Return type:

bool

has_dependencies()ΒΆ

Check if this task has any dependencies.

Return type:

bool

property dependency_ids: list[str]ΒΆ

Get list of task IDs this task depends on.

Return type:

list[str]

property is_join_task: boolΒΆ

Check if this is the final join task.

Return type:

bool

model_configΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class agents.planning.llm_compiler_v3.models.ExecutionModeΒΆ

Bases: str, enum.Enum

Execution mode for tasks.

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

class agents.planning.llm_compiler_v3.models.ParallelExecutionResult(/, **data)ΒΆ

Bases: pydantic.BaseModel

Result from executing 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)

model_configΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class agents.planning.llm_compiler_v3.models.ReplanRequest(/, **data)ΒΆ

Bases: pydantic.BaseModel

Request for replanning when initial plan fails.

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)

model_configΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class agents.planning.llm_compiler_v3.models.TaskDependency(/, **data)ΒΆ

Bases: pydantic.BaseModel

Represents a dependency 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)

resolve_reference()ΒΆ

Generate reference string for task dependency.

Return type:

str

model_configΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].