from typing import List, Optional

from pydantic import BaseModel, Field


class SPINOutput(BaseModel):
    situation: Optional[str] = Field(None, description="Situation information")
    problem: Optional[str] = Field(None, description="Problem information")
    implication: Optional[str] = Field(None, description="Implication information")
    need: Optional[str] = Field(None, description="Need-payoff information")
    additional_info: Optional[str] = Field(None, description="Additional sales-related information.")
    questions: Optional[str] = Field(None, description="Additional questions to further clarify SPIN")
    potential_customer: Optional[bool] = Field(False, description="Indication if this could be a good customer")

    def __str__(self):
        """Custom string output for usage in agents and tasks"""
        return (f"Situation: {self.situation or 'N/A'}\n"
                f"Problem: {self.problem or 'N/A'}\n"
                f"Implication: {self.implication or 'N/A'}\n"
                f"Need: {self.need or 'N/A'}\n"
                f"Additional Info: {self.additional_info or 'N/A'}\n"
                f"Questions: {self.questions or 'N/A'}\n"
                f"Potential Customer: {self.potential_customer or 'N/A'}\n")

