haive.agents.common.models.task_analysis.analysis ================================================= .. py:module:: haive.agents.common.models.task_analysis.analysis .. autoapi-nested-parse:: 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 ------- .. autoapisummary:: haive.agents.common.models.task_analysis.analysis.AnalysisMethod haive.agents.common.models.task_analysis.analysis.ExecutionStrategy haive.agents.common.models.task_analysis.analysis.PlanningRequirement haive.agents.common.models.task_analysis.analysis.TaskAnalysis haive.agents.common.models.task_analysis.analysis.TaskComplexity haive.agents.common.models.task_analysis.analysis.TaskDimension Module Contents --------------- .. py:class:: AnalysisMethod Bases: :py:obj:`str`, :py:obj:`enum.Enum` Methods for analyzing task complexity and requirements. .. attribute:: HEURISTIC Rule-based heuristic analysis .. attribute:: PATTERN_MATCHING Pattern matching against known task types .. attribute:: DECOMPOSITION Bottom-up analysis through task decomposition .. attribute:: EXPERT_SYSTEM Expert system with domain knowledge .. attribute:: MACHINE_LEARNING ML-based complexity prediction .. attribute:: HYBRID Combination of multiple methods Initialize self. See help(type(self)) for accurate signature. .. py:class:: ExecutionStrategy(/, **data) Bases: :py:obj:`pydantic.BaseModel` Recommended execution strategy for a task. Provides specific recommendations for how to approach task execution based on the complexity and solvability analysis. .. attribute:: strategy_type Primary execution approach .. attribute:: priority_level Urgency/priority level for the task .. attribute:: recommended_approach Detailed approach description .. attribute:: resource_allocation How to allocate resources .. attribute:: timeline_strategy How to manage timing and sequencing .. attribute:: risk_mitigation Risk mitigation strategies .. attribute:: success_factors Key factors for success .. attribute:: fallback_options Alternative approaches if primary fails .. rubric:: Example .. code-block:: python 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. .. py:method:: validate_resource_allocation(v) :classmethod: Validate that resource allocation proportions sum to approximately 1.0. :param v: Resource allocation dictionary :returns: Validated resource allocation :raises ValueError: If proportions don't sum to approximately 1.0 .. py:attribute:: model_config Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict]. .. py:class:: PlanningRequirement(/, **data) Bases: :py:obj:`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. .. py:class:: TaskAnalysis(/, **data) Bases: :py:obj:`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. .. attribute:: task_description Original task description .. attribute:: domain Task domain or field .. attribute:: analysis_method Method used for analysis .. attribute:: complexity Complexity assessment .. attribute:: solvability Solvability assessment .. attribute:: decomposition Task decomposition (optional) .. attribute:: planning Planning requirements .. attribute:: execution_strategy Recommended execution approach .. attribute:: analysis_timestamp When analysis was performed .. attribute:: analysis_confidence Overall confidence in the analysis .. rubric:: Example .. code-block:: python # 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. .. py:method:: analyze_task(task_description, domain = None, context = None, analysis_method = AnalysisMethod.HYBRID) :classmethod: Analyze a task and return comprehensive analysis. This is the main entry point for task analysis. It performs heuristic analysis based on task characteristics. :param task_description: Description of the task to analyze :param domain: Optional domain specification :param context: Optional additional context :param analysis_method: Method to use for analysis :returns: Complete TaskAnalysis instance .. py:method:: generate_executive_summary() Generate an executive summary of the analysis. :returns: Formatted executive summary .. py:method:: get_execution_recommendations() Get prioritized execution recommendations. :returns: List of actionable recommendations .. py:method:: get_overall_assessment() Get overall assessment summary. :returns: Dictionary with key assessment metrics .. py:method:: validate_analysis_consistency() Validate that all analysis components are consistent. :returns: Self if validation passes :raises ValueError: If analysis components are inconsistent .. py:attribute:: model_config Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict]. .. py:class:: TaskComplexity(/, **data) Bases: :py:obj:`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. .. py:method:: get_complexity_score() Get overall complexity score. .. py:class:: TaskDimension Bases: :py:obj:`str`, :py:obj:`enum.Enum` Task dimensions for complexity assessment. Initialize self. See help(type(self)) for accurate signature.