from pydantic import BaseModel, Field from typing import List, Dict, Literal, Optional # ====== Pydantic Model for Analysis Phase ====== class AnalysisOutput(BaseModel): goal: str = Field( ..., description="Overall training goal, must start with 'أن يتمكّن المتدرب من...'.", ) target_audience: str = Field( ..., description="The target audience group and their average age/professional profile.", ) previous_experiences: List[str] = Field( ..., description="3–5 short noun-phrases reflecting prior experiences." ) learner_characteristics: List[str] = Field( ..., description="Learner characteristics based on developmental dimensions." ) training_needs: List[str] = Field( ..., description="6 noun-phrases representing training needs extracted from course topics.", ) constraints: Dict[str, List[str]] = Field( ..., description="Constraints divided into {'trainer': [...], 'trainee': [...]}, 4 noun-phrases each.", ) duration: str = Field(..., description="The duration of the course (days/hours).") sources_of_analysis: List[str] = Field( ..., description="Noun-phrases starting and ending with a مصدر, e.g., 'جمع البيانات وتحليلها'.", )