Spaces:
Running
Running
Enhanced the support for the excel file and added endpoint to have optimized vector store and Rag for the Excel.
b953016
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 | |
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 | |
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 |