# default_assistants = [
#     {
#         "name": "Emma",
#         "gender": "female",
#         "accent": "British-RP",
#         "personality": "Professional and warm",
#         "description": "A professional receptionist with a warm, welcoming tone and Received Pronunciation British accent",
#         "bot_config": {
#             "name": "Emma",
#             "llm": {
#                 "provider": "openai",
#                 "model": "gpt-4",
#                 "temperature": 0.7,
#                 "system_prompt": """You are Emma, a professional and warm receptionist with a British accent. 
#                 Your role is to handle appointment bookings, answer questions about services, and manage scheduling.
#                 Always maintain a helpful, friendly, and professional demeanor."""
#             },
#             "voice": {
#                 "provider": "eleven_labs",
#                 "voice_id": "british_female_1",
#                 "stability": 0.5,
#                 "similarity_boost": 0.75
#             },
#             "conversation_flow": {
#                 "greeting": "Hello! This is Emma speaking. How may I assist you today?",
#                 "booking_flow": {
#                     "confirm_service": "I'll help you book an appointment. Which service were you interested in?",
#                     "confirm_time": "What time would work best for you?",
#                     "confirm_details": "Let me confirm those details with you..."
#                 }
#             }
#         }
#     },
#     {
#         "name": "James",
#         "gender": "male",
#         "accent": "British-London",
#         "personality": "Professional and confident",
#         "description": "A confident male receptionist with a modern London accent",
#         "bot_config": {
#             "name": "James",
#             "llm": {
#                 "provider": "openai",
#                 "model": "gpt-4",
#                 "temperature": 0.7,
#                 "system_prompt": """You are James, a confident and professional receptionist with a London accent. 
#                 Your role is to handle appointment bookings, answer questions about services, and manage scheduling.
#                 Maintain a confident, friendly, and efficient demeanor."""
#             },
#             "voice": {
#                 "provider": "eleven_labs",
#                 "voice_id": "british_male_1",
#                 "stability": 0.5,
#                 "similarity_boost": 0.75
#             },
#             "conversation_flow": {
#                 "greeting": "Hi there, James speaking. How can I help you today?",
#                 "booking_flow": {
#                     "confirm_service": "I'll get that appointment sorted for you. Which service would you like to book?",
#                     "confirm_time": "What time works best for you?",
#                     "confirm_details": "Let me just confirm those details..."
#                 }
#             }
#         }
#     }
# ]

# # Function to initialize default assistants in MongoDB
# async def initialize_default_assistants(db):
#     # Check if assistants already exist
#     if await db.ai_assistants.count_documents({}) == 0:
#         await db.ai_assistants.insert_many(default_assistants) 
from pydantic import BaseModel
from typing import Optional, Dict, Any
from datetime import datetime



class AIAssistantBase(BaseModel):
    name: str
    gender: str
    accent: str
    personality: str
    voice_id: str
    voice_model: Optional[str] = "eleven_multilingual_v2"
    system_prompt: str

class AIAssistantCreate(BaseModel):
    name: str
    gender: str
    accent: str
    personality: str
    voice_id: str
    voice_model: Optional[str] = "eleven_multilingual_v2"
    system_prompt: str
    llm_websocket_url: str

class AIAssistantUpdate(BaseModel):
    name: Optional[str]
    voice_id: Optional[str]
    voice_model: Optional[str] = "eleven_multilingual_v2"
    system_prompt: Optional[str]
    conversation_flow: Optional[Dict[str, Any]]
    voice_temperature: Optional[float] = 1.0
    voice_speed: Optional[float] = 1.0
    interruption_sensitivity: Optional[float] = 1.0

class AIAssistantOut(AIAssistantBase):
    id: int
    retell_agent_id: Optional[str]
    created_at: datetime
    updated_at: datetime
    voice_temperature: Optional[float] = 1.0
    voice_speed: Optional[float] = 1.0
    interruption_sensitivity: Optional[float] = 1.0

    class Config:
        orm_mode = True
