look at my files please. I wanted that when someone tried to create a new agent then first of all create a new tool that had phone number in request url of that phone, once it gets created then create voice agent having that tool so that we can use email associated with that number for sending the confirmation emailwhen i am creating an agent facing this issue* Running on local URL: http://0.0.0.0:7860* Running on public URL: https://1031bec673d50c31df.gradio.liveThis share link expires in 1 week. For free permanent hosting and GPU upgrades, run gradio deploy
from the terminal in the working directory to deploy to Hugging Face Spaces (https://huggingface.co/spaces)🔍 DEBUG: Login attempt with password: admin123🔍 DEBUG: Current login state: False✅ Login successful!🔍 DEBUG: Rendering interface, logged in: True🔍 LOG: create_agent_with_unique_phone called with enhanced phone manager - agent_name: r - user_id: 2 - selected_tools: ['appointment'] - preferred_area_code: 323🔍 LOG: User found - Name: Jane Smith, Email: jane@example.com🔍 LOG: Voice config: {'provider': 'openai', 'voiceId': 'alloy'}🔍 LOG: Model config: {'provider': 'openai', 'model': 'gpt-4o'}🤖 Creating agent with config: { "name": "r", "voice": { "provider": "openai", "voiceId": "alloy" }, "model": { "systemPrompt": "You are a helpful AI assistant integrated into an AI communication platform. You can help users with various tasks, answer questions, and provide assistance. Be concise, friendly, and professional in your responses.\n\nAPPOINTMENT SCHEDULING INSTRUCTIONS:\n- When a user wants to schedule an appointment, ask for their preferred date and time.\n- Do NOT ask for the user's email address. The confirmation will be sent to the email associated with their phone number, or to the admin if no email is found.\n- The user's mobile number is automatically available from the call context and will be used for lookup.\n- Once you have the date and time, IMMEDIATELY use the schedule_appointment function.\n- Always confirm the appointment details with the user before calling the function.\n- Example: "Perfect! I'll schedule that appointment for you right now. A confirmation will be sent to the email linked to your phone number. Your appointment ID is [ID]. Is there anything else I can help you with?"\n\nRemember to actually CALL the schedule_appointment function - don't just say you will do it.", "provider": "openai", "model": "gpt-4o", "maxTokens": 4096, "temperature": 0.7 }, "firstMessage": "Hello! I'm r, your AI assistant. How can I help you today?", "recordingEnabled": true, "endCallMessage": "Thank you for calling. Have a great day!", "endCallPhrases": [ "goodbye", "bye", "end call", "hang up" ], "backgroundSound": "office", "backchannelingEnabled": true, "backgroundDenoisingEnabled": true, "modelOutputInMessagesEnabled": true}🔍 Agent creation response: 201🔍 Response text: {"id":"51692425-862e-46f1-b737-0fe859a91183","orgId":"6c78f57c-cfb5-403f-85ab-b56236072d48","name":"r","voice":{"voiceId":"alloy","provider":"openai"},"createdAt":"2025-07-16T16:37:58.543Z","updatedAt":"2025-07-16T16:37:58.543Z","model":{"model":"gpt-4o","provider":"openai","maxTokens":4096,"temperature":0.7,"systemPrompt":"You are a helpful AI assistant integrated into an AI communication platform. You can help users with various tasks, answer questions, and provide assistance. Be concise, friendly, and professional in your responses.\n\nAPPOINTMENT SCHEDULING INSTRUCTIONS:\n- When a user wants to schedule an appointment, ask for their preferred date and time.\n- Do NOT ask for the user's email address. The confirmation will be sent to the email associated with their phone number, or to the admin if no email is found.\n- The user's mobile number is automatically available from the call context and will be used for lookup.\n- Once you have the date and time, IMMEDIATELY use the schedule_appointment function.\n- Always confirm the appointment details with the user before calling the function.\n- Example: "Perfect! I'll schedule that appointment for you right now. A confirmation will be sent to the email linked to your phone number. Your appointment ID is [ID]. Is there anything else I can help you with?"\n\nRemember to actually CALL the schedule_appointment function - don't just say you will do it."},"recordingEnabled":true,"firstMessage":"Hello! I'm r, your AI assistant. How can I help you today?","endCallMessage":"Thank you for calling. Have a great day!","endCallPhrases":["goodbye","bye","end call","hang up"],"backgroundSound":"office","backchannelingEnabled":true,"backgroundDenoisingEnabled":true,"modelOutputInMessagesEnabled":true,"isServerUrlSecretSet":false}🔧 Creating Vapi tool with config: { "type": "api_request", "name": "schedule_appointment", "description": "Schedule an appointment and send confirmation email", "parameters": { "type": "object", "properties": { "to": { "type": "string", "description": "Fallback/Admin email address (e.g., zohaib9856@gmail.com) for appointment confirmation. The primary recipient will be looked up by phone number." }, "subject": { "type": "string", "description": "Subject line for the appointment email" }, "message": { "type": "string", "description": "Appointment details and confirmation message" }, "date": { "type": "string", "description": "Appointment date (YYYY-MM-DD)" }, "time": { "type": "string", "description": "Appointment time (HH:MM)" }, "duration": { "type": "integer", "description": "Duration in minutes", "default": 60 } }, "required": [ "subject", "message", "date", "time" ] }, "server": { "url": "https://ea495a13898d.ngrok-free.app/webhook/function-call/51692425-862e-46f1-b737-0fe859a91183/{{call.customer.number}}", "method": "POST", "body": { "type": "object", "properties": { "to": { "description": "Fallback/admin email address for confirmation", "type": "string" }, "subject": { "description": "Email subject line", "type": "string" }, "message": { "description": "Appointment details and confirmation message", "type": "string" }, "date": { "description": "Appointment date (YYYY-MM-DD)", "type": "string" }, "time": { "description": "Appointment time (HH:MM)", "type": "string" }, "duration": { "description": "Duration in minutes", "type": "integer", "default": 60 } }, "required": [ "to", "subject", "message", "date", "time" ] } }}🔍 Tool creation response: 400🔍 Response text: {"message":["property name should not exist","property description should not exist","property parameters should not exist","property server should not exist","type must be one of the following values: dtmf, endCall, transferCall, output, voicemail, query, sms, function, mcp, apiRequest, bash, computer, textEditor, google.calendar.event.create, google.calendar.availability.check, google.sheets.row.append, slack.message.send, gohighlevel.calendar.event.create, gohighlevel.calendar.availability.check, gohighlevel.contact.create, gohighlevel.contact.get, make, ghl"],"error":"Bad Request","statusCode":400}Error saving appointment settings for agent 51692425-862e-46f1-b737-0fe859a91183: table agent_appointment_settings has no column named updated_at
Loading...
(venv) PS C:\Users\DELL\Desktop\gradio_project> python app.py🧪 Gradio version: 5.34.2✅ Enhanced AI Chat Handler initialized successfully🔄 Loading all agents on startup...✅ Loaded 14 chat agents✅ Found 100 voice agents in Vapi✅ Total voice agents loaded: 100🎯 Startup complete - Voice: 100, Chat: 14🔍 DEBUG: Initializing app...🔍 DEBUG: Checking database state...📊 Users in memory: 10📊 Users in database: 10 - John Doe (john@example.com) - Jane Smith (jane@example.com) - Mike Johnson (mike@example.com) - Sarah Wilson (sarah@example.com) - David Brown (david@example.com) - Haseeb (h@gmail.com) - Umer (umer@gmail.com) - haziqtest (haziqteset123) - zohaib (ymzohaib@gmail.com) - abc (abc@gmail.com)🔍 DEBUG: App initialized - Voice: 100, Chat: 14, Users: 10🔍 DEBUG: Initial user choices: 10 users🔍 DEBUG: Initial user choices: 10 users🔍 DEBUG: Generated initial chat agents display🔍 DEBUG: Initial chat agent choices: 15 agents🔍 DEBUG: Initial user choices: 10 users🔍 DEBUG: Initial user choices: 10 users* Running on local URL: http://0.0.0.0:7860* Running on public URL: https://3fffddccf31c36c89b.gradio.liveThis share link expires in 1 week. For free permanent hosting and GPU upgrades, run gradio deploy
from the terminal in the working directory to deploy to Hugging Face Spaces (https://huggingface.co/spaces)🔍 DEBUG: Login attempt with password: admin123🔍 DEBUG: Current login state: False✅ Login successful!🔍 DEBUG: Rendering interface, logged in: True🔍 LOG: create_agent_with_unique_phone called with enhanced phone manager - agent_name: t - user_id: 2 - selected_tools: ['appointment'] - preferred_area_code: 323🔍 LOG: User found - Name: Jane Smith, Email: jane@example.com🔍 LOG: Voice config: {'provider': 'openai', 'voiceId': 'alloy'}🔍 LOG: Model config: {'provider': 'openai', 'model': 'gpt-4o'}🤖 Creating agent with config: { "name": "t", "voice": { "provider": "openai", "voiceId": "alloy" }, "model": { "systemPrompt": "You are a helpful AI assistant integrated into an AI communication platform. You can help users with various tasks, answer questions, and provide assistance. Be concise, friendly, and professional in your responses.\n\nAPPOINTMENT SCHEDULING INSTRUCTIONS:\n- When a user wants to schedule an appointment, ask for their preferred date and time.\n- Do NOT ask for the user's email address. The confirmation will be sent to the email associated with their phone number, or to the admin if no email is found.\n- The user's mobile number is automatically available from the call context and will be used for lookup.\n- Once you have the date and time, IMMEDIATELY use the schedule_appointment function.\n- Always confirm the appointment details with the user before calling the function.\n- Example: "Perfect! I'll schedule that appointment for you right now. A confirmation will be sent to the email linked to your phone number. Your appointment ID is [ID]. Is there anything else I can help you with?"\n\nRemember to actually CALL the schedule_appointment function - don't just say you will do it.", "provider": "openai", "model": "gpt-4o", "maxTokens": 4096, "temperature": 0.7 }, "firstMessage": "Hello! I'm t, your AI assistant. How can I help you today?", "recordingEnabled": true, "endCallMessage": "Thank you for calling. Have a great day!", "endCallPhrases": [ "goodbye", "bye", "end call", "hang up" ], "backgroundSound": "office", "backchannelingEnabled": true, "backgroundDenoisingEnabled": true, "modelOutputInMessagesEnabled": true}🔍 Agent creation response: 201🔍 Response text: {"id":"3dc2eda9-657a-4a67-a83d-f6e7acb5cc23","orgId":"6c78f57c-cfb5-403f-85ab-b56236072d48","name":"t","voice":{"voiceId":"alloy","provider":"openai"},"createdAt":"2025-07-16T18:14:57.893Z","updatedAt":"2025-07-16T18:14:57.893Z","model":{"model":"gpt-4o","provider":"openai","maxTokens":4096,"temperature":0.7,"systemPrompt":"You are a helpful AI assistant integrated into an AI communication platform. You can help users with various tasks, answer questions, and provide assistance. Be concise, friendly, and professional in your responses.\n\nAPPOINTMENT SCHEDULING INSTRUCTIONS:\n- When a user wants to schedule an appointment, ask for their preferred date and time.\n- Do NOT ask for the user's email address. The confirmation will be sent to the email associated with their phone number, or to the admin if no email is found.\n- The user's mobile number is automatically available from the call context and will be used for lookup.\n- Once you have the date and time, IMMEDIATELY use the schedule_appointment function.\n- Always confirm the appointment details with the user before calling the function.\n- Example: "Perfect! I'll schedule that appointment for you right now. A confirmation will be sent to the email linked to your phone number. Your appointment ID is [ID]. Is there anything else I can help you with?"\n\nRemember to actually CALL the schedule_appointment function - don't just say you will do it."},"recordingEnabled":true,"firstMessage":"Hello! I'm t, your AI assistant. How can I help you today?","endCallMessage":"Thank you for calling. Have a great day!","endCallPhrases":["goodbye","bye","end call","hang up"],"backgroundSound":"office","backchannelingEnabled":true,"backgroundDenoisingEnabled":true,"modelOutputInMessagesEnabled":true,"isServerUrlSecretSet":false}🔧 Creating Vapi tool with config: { "type": "api_request", "config": { "name": "schedule_appointment", "description": "Schedule an appointment and send confirmation email", "parameters": { "type": "object", "properties": { "to": { "type": "string", "description": "Fallback/Admin email address (e.g., zohaib9856@gmail.com) for appointment confirmation. The primary recipient will be looked up by phone number." }, "subject": { "type": "string", "description": "Subject line for the appointment email" }, "message": { "type": "string", "description": "Appointment details and confirmation message" }, "date": { "type": "string", "description": "Appointment date (YYYY-MM-DD)" }, "time": { "type": "string", "description": "Appointment time (HH:MM)" }, "duration": { "type": "integer", "description": "Duration in minutes", "default": 60 } }, "required": [ "subject", "message", "date", "time" ] }, "server": { "url": "https://ea495a13898d.ngrok-free.app/webhook/function-call/3dc2eda9-657a-4a67-a83d-f6e7acb5cc23/{{call.customer.number}}", "method": "POST", "body": { "type": "object", "properties": { "to": { "description": "Fallback/admin email address for confirmation", "type": "string" }, "subject": { "description": "Email subject line", "type": "string" }, "message": { "description": "Appointment details and confirmation message", "type": "string" }, "date": { "description": "Appointment date (YYYY-MM-DD)", "type": "string" }, "time": { "description": "Appointment time (HH:MM)", "type": "string" }, "duration": { "description": "Duration in minutes", "type": "integer", "default": 60 } }, "required": [ "to", "subject", "message", "date", "time" ] } } }}🔍 Tool creation response: 400🔍 Response text: {"message":["property config should not exist","type must be one of the following values: dtmf, endCall, transferCall, output, voicemail, query, sms, function, mcp, apiRequest, bash, computer, textEditor, google.calendar.event.create, google.calendar.availability.check, google.sheets.row.append, slack.message.send, gohighlevel.calendar.event.create, gohighlevel.calendar.availability.check, gohighlevel.contact.create, gohighlevel.contact.get, make, ghl"],"error":"Bad Request","statusCode":400}
Loading...
🔍 DEBUG: Current login state: False✅ Login successful!🔍 DEBUG: Rendering interface, logged in: True🔍 LOG: create_agent_with_unique_phone called with enhanced phone manager - agent_name: y - user_id: 2 - selected_tools: ['appointment'] - preferred_area_code: 323🔍 LOG: User found - Name: Jane Smith, Email: jane@example.com🔍 LOG: Voice config: {'provider': 'openai', 'voiceId': 'alloy'}🔍 LOG: Model config: {'provider': 'openai', 'model': 'gpt-4o'}🤖 Creating agent with config: { "name": "y", "voice": { "provider": "openai", "voiceId": "alloy" }, "model": { "systemPrompt": "You are a helpful AI assistant integrated into an AI communication platform. You can help users with various tasks, answer questions, and provide assistance. Be concise, friendly, and professional in your responses.\n\nAPPOINTMENT SCHEDULING INSTRUCTIONS:\n- When a user wants to schedule an appointment, ask for their preferred date and time.\n- Do NOT ask for the user's email address. The confirmation will be sent to the email associated with their phone number, or to the admin if no email is found.\n- The user's mobile number is automatically available from the call context and will be used for lookup.\n- Once you have the date and time, IMMEDIATELY use the schedule_appointment function.\n- Always confirm the appointment details with the user before calling the function.\n- Example: "Perfect! I'll schedule that appointment for you right now. A confirmation will be sent to the email linked to your phone number. Your appointment ID is [ID]. Is there anything else I can help you with?"\n\nRemember to actually CALL the schedule_appointment function - don't just say you will do it.", "provider": "openai", "model": "gpt-4o", "maxTokens": 4096, "temperature": 0.7 }, "firstMessage": "Hello! I'm y, your AI assistant. How can I help you today?", "recordingEnabled": true, "endCallMessage": "Thank you for calling. Have a great day!", "endCallPhrases": [ "goodbye", "bye", "end call", "hang up" ], "backgroundSound": "office", "backchannelingEnabled": true, "backgroundDenoisingEnabled": true, "modelOutputInMessagesEnabled": true}🔍 Agent creation response: 201🔍 Response text: {"id":"5f8d2f9d-9cee-45dc-a32a-beefe3d3c0e8","orgId":"6c78f57c-cfb5-403f-85ab-b56236072d48","name":"y","voice":{"voiceId":"alloy","provider":"openai"},"createdAt":"2025-07-16T18:18:00.133Z","updatedAt":"2025-07-16T18:18:00.133Z","model":{"model":"gpt-4o","provider":"openai","maxTokens":4096,"temperature":0.7,"systemPrompt":"You are a helpful AI assistant integrated into an AI communication platform. You can help users with various tasks, answer questions, and provide assistance. Be concise, friendly, and professional in your responses.\n\nAPPOINTMENT SCHEDULING INSTRUCTIONS:\n- When a user wants to schedule an appointment, ask for their preferred date and time.\n- Do NOT ask for the user's email address. The confirmation will be sent to the email associated with their phone number, or to the admin if no email is found.\n- The user's mobile number is automatically available from the call context and will be used for lookup.\n- Once you have the date and time, IMMEDIATELY use the schedule_appointment function.\n- Always confirm the appointment details with the user before calling the function.\n- Example: "Perfect! I'll schedule that appointment for you right now. A confirmation will be sent to the email linked to your phone number. Your appointment ID is [ID]. Is there anything else I can help you with?"\n\nRemember to actually CALL the schedule_appointment function - don't just say you will do it."},"recordingEnabled":true,"firstMessage":"Hello! I'm y, your AI assistant. How can I help you today?","endCallMessage":"Thank you for calling. Have a great day!","endCallPhrases":["goodbye","bye","end call","hang up"],"backgroundSound":"office","backchannelingEnabled":true,"backgroundDenoisingEnabled":true,"modelOutputInMessagesEnabled":true,"isServerUrlSecretSet":false}🔧 Creating Vapi tool with config: { "type": "api_request", "name": "schedule_appointment", "description": "Schedule an appointment and send confirmation email", "parameters": { "type": "object", "properties": { "to": { "type": "string", "description": "Fallback/Admin email address (e.g., zohaib9856@gmail.com) for appointment confirmation. The primary recipient will be looked up by phone number." }, "subject": { "type": "string", "description": "Subject line for the appointment email" }, "message": { "type": "string", "description": "Appointment details and confirmation message" }, "date": { "type": "string", "description": "Appointment date (YYYY-MM-DD)" }, "time": { "type": "string", "description": "Appointment time (HH:MM)" }, "duration": { "type": "integer", "description": "Duration in minutes", "default": 60 } }, "required": [ "subject", "message", "date", "time" ] }, "server": { "url": "https://ea495a13898d.ngrok-free.app/webhook/function-call/5f8d2f9d-9cee-45dc-a32a-beefe3d3c0e8/{{call.customer.number}}", "method": "POST", "body": { "type": "object", "properties": { "to": { "description": "Fallback/admin email address for confirmation", "type": "string" }, "subject": { "description": "Email subject line", "type": "string" }, "message": { "description": "Appointment details and confirmation message", "type": "string" }, "date": { "description": "Appointment date (YYYY-MM-DD)", "type": "string" }, "time": { "description": "Appointment time (HH:MM)", "type": "string" }, "duration": { "description": "Duration in minutes", "type": "integer", "default": 60 } }, "required": [ "to", "subject", "message", "date", "time" ] } }}🔍 Tool creation response: 400🔍 Response text: {"message":["property name should not exist","property description should not exist","property parameters should not exist","property server should not exist","type must be one of the following values: dtmf, endCall, transferCall, output, voicemail, query, sms, function, mcp, apiRequest, bash, computer, textEditor, google.calendar.event.create, google.calendar.availability.check, google.sheets.row.append, slack.message.send, gohighlevel.calendar.event.create, gohighlevel.calendar.availability.check, gohighlevel.contact.create, gohighlevel.contact.get, make, ghl"],"error":"Bad Request","statusCode":400}