from pydantic import BaseModel, EmailStr, validator import re class UserContactRequest(BaseModel): """Request model for user contact information""" full_name: str email: EmailStr phone_number: str @validator('phone_number') def validate_phone(cls, v): # Remove any non-digit characters phone = re.sub(r'\D', '', v) if not 8 <= len(phone) <= 15: # Standard phone number length globally raise ValueError('Invalid phone number length') return phone @validator('full_name') def validate_name(cls, v): if not v.strip(): raise ValueError('Name cannot be empty') return v.strip() class UserContactResponse(BaseModel): """Response model for user contact endpoint""" conversation_id: str is_existing: bool message: str