from pydantic import BaseModel, Field, model_validator



class DssatLMParserResponse(BaseModel):
    farm_name: str = Field("-99", description="The name of the farm.")
    crop_name: str = Field("-99", description="The name of the crop.")
    latitude: float = Field(-99, description="The latitude of the farm.")
    longitude: float = Field(-99, description="The longitude of the farm.")
    elevation: float = Field(-99, description="The elevation of the farm.")
    planting_date: str = Field("-99", description="The planting date.")
    is_irrigation_applied: str = Field("-99", description="Indicates if irrigation is applied.")
    irrigation_application: list = Field(default_factory=list, description="List of irrigation applications with date and amount.")
    question_statement: str = Field("-99", description="The question statement.")


class DssatLMInterpreterResponse(BaseModel):
    matched_question_found: str = Field(
        "Not Found", 
        description="The question from the bank of definitions that semantically matches the question statement the most."
    )
    retrieved_answer: str = Field(
        "Not Found", 
        description="The extracted the `key-value` pairs in the JSON object that corresponds to the matched question. In the form of `The <key> is <value>`."
    )
    answer_for_farmer: str = Field(
        "Sorry, your answer cannot be answered at the moment.", 
        description="The answer generated by the model for the farmer in a farmer-friendly language."
    )
    
