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ΒΆ
Methods for analyzing task complexity and requirements. |
|
Recommended execution strategy for a task. |
|
Placeholder for planning requirements. |
|
Comprehensive task analysis combining all analysis components. |
|
Placeholder for task complexity assessment. |
|
Task dimensions for complexity assessment. |
Module ContentsΒΆ
- class agents.common.models.task_analysis.analysis.AnalysisMethodΒΆ
-
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.
- 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:
- generate_executive_summary()ΒΆ
Generate an executive summary of the analysis.
- Returns:
Formatted executive summary
- Return type:
- get_execution_recommendations()ΒΆ
Get prioritized execution recommendations.
- get_overall_assessment()ΒΆ
Get overall assessment summary.
- validate_analysis_consistency()ΒΆ
Validate that all analysis components are consistent.
- Returns:
Self if validation passes
- Raises:
ValueError β If analysis components are inconsistent
- Return type:
- 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)