agents.common.models.task_analysis.analysisΒΆ

Main task analysis model combining all analysis components.

This module provides the comprehensive TaskAnalysis model that combines complexity assessment, solvability analysis, task decomposition, and execution strategy recommendations.

ClassesΒΆ

AnalysisMethod

Methods for analyzing task complexity and requirements.

ExecutionStrategy

Recommended execution strategy for a task.

PlanningRequirement

Placeholder for planning requirements.

TaskAnalysis

Comprehensive task analysis combining all analysis components.

TaskComplexity

Placeholder for task complexity assessment.

TaskDimension

Task dimensions for complexity assessment.

Module ContentsΒΆ

class agents.common.models.task_analysis.analysis.AnalysisMethodΒΆ

Bases: str, enum.Enum

Methods for analyzing task complexity and requirements.

HEURISTICΒΆ

Rule-based heuristic analysis

PATTERN_MATCHINGΒΆ

Pattern matching against known task types

DECOMPOSITIONΒΆ

Bottom-up analysis through task decomposition

EXPERT_SYSTEMΒΆ

Expert system with domain knowledge

MACHINE_LEARNINGΒΆ

ML-based complexity prediction

HYBRIDΒΆ

Combination of multiple methods

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

class agents.common.models.task_analysis.analysis.ExecutionStrategy(/, **data)ΒΆ

Bases: pydantic.BaseModel

Recommended execution strategy for a task.

Provides specific recommendations for how to approach task execution based on the complexity and solvability analysis.

Parameters:

data (Any)

strategy_typeΒΆ

Primary execution approach

priority_levelΒΆ

Urgency/priority level for the task

recommended_approachΒΆ

Detailed approach description

resource_allocationΒΆ

How to allocate resources

timeline_strategyΒΆ

How to manage timing and sequencing

risk_mitigationΒΆ

Risk mitigation strategies

success_factorsΒΆ

Key factors for success

fallback_optionsΒΆ

Alternative approaches if primary fails

Example

strategy = ExecutionStrategy(
strategy_type="parallel_execution",
priority_level="high",
recommended_approach="Execute independent branches in parallel while managing dependencies",
resource_allocation={"computational": 0.4, "human_expert": 0.3, "time": 0.3},
timeline_strategy="front_load_critical_path",
risk_mitigation=["backup_data_sources", "expert_consultation", "iterative_validation"],
success_factors=["clear_requirements", "adequate_resources", "expert_oversight"]
)

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.

classmethod validate_resource_allocation(v)ΒΆ

Validate that resource allocation proportions sum to approximately 1.0.

Parameters:

v (dict[str, float]) – Resource allocation dictionary

Returns:

Validated resource allocation

Raises:

ValueError – If proportions don’t sum to approximately 1.0

Return type:

dict[str, float]

model_configΒΆ

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

class agents.common.models.task_analysis.analysis.PlanningRequirement(/, **data)ΒΆ

Bases: pydantic.BaseModel

Placeholder for planning requirements.

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.common.models.task_analysis.analysis.TaskAnalysis(/, **data)ΒΆ

Bases: pydantic.BaseModel

Comprehensive task analysis combining all analysis components.

This is the main model that brings together complexity assessment, solvability analysis, task decomposition, and execution recommendations into a unified analysis.

Parameters:

data (Any)

task_descriptionΒΆ

Original task description

domainΒΆ

Task domain or field

analysis_methodΒΆ

Method used for analysis

complexityΒΆ

Complexity assessment

solvabilityΒΆ

Solvability assessment

decompositionΒΆ

Task decomposition (optional)

planningΒΆ

Planning requirements

execution_strategyΒΆ

Recommended execution approach

analysis_timestampΒΆ

When analysis was performed

analysis_confidenceΒΆ

Overall confidence in the analysis

Example

# Analyze a simple research task
analysis = TaskAnalysis.analyze_task(
task_description="Find the birthday of the most recent Wimbledon winner",
domain="sports_research",
context="Factual lookup requiring web search"
)

# Analyze a complex research problem
analysis = TaskAnalysis.analyze_task(
task_description="Develop a cure for cancer through novel therapeutic approaches",
domain="medical_research",
context="Breakthrough research requiring novel discoveries"
)

print(f"Complexity: {analysis.complexity.overall_complexity}")
print(f"Solvable: {analysis.solvability.is_currently_solvable}")
print(f"Strategy: {analysis.execution_strategy.strategy_type}")

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.

classmethod analyze_task(task_description, domain=None, context=None, analysis_method=AnalysisMethod.HYBRID)ΒΆ

Analyze a task and return comprehensive analysis.

This is the main entry point for task analysis. It performs heuristic analysis based on task characteristics.

Parameters:
  • task_description (str) – Description of the task to analyze

  • domain (str | None) – Optional domain specification

  • context (str | None) – Optional additional context

  • analysis_method (AnalysisMethod) – Method to use for analysis

Returns:

Complete TaskAnalysis instance

Return type:

TaskAnalysis

generate_executive_summary()ΒΆ

Generate an executive summary of the analysis.

Returns:

Formatted executive summary

Return type:

str

get_execution_recommendations()ΒΆ

Get prioritized execution recommendations.

Returns:

List of actionable recommendations

Return type:

list[str]

get_overall_assessment()ΒΆ

Get overall assessment summary.

Returns:

Dictionary with key assessment metrics

Return type:

dict[str, Any]

validate_analysis_consistency()ΒΆ

Validate that all analysis components are consistent.

Returns:

Self if validation passes

Raises:

ValueError – If analysis components are inconsistent

Return type:

TaskAnalysis

model_configΒΆ

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

class agents.common.models.task_analysis.analysis.TaskComplexity(/, **data)ΒΆ

Bases: pydantic.BaseModel

Placeholder for task complexity assessment.

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

Get overall complexity score.

Return type:

float

class agents.common.models.task_analysis.analysis.TaskDimensionΒΆ

Bases: str, enum.Enum

Task dimensions for complexity assessment.

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