Hello ! 👋 <@1293681350007849102> <@1233640756548...
# general-english
a
Hello ! 👋 @User @User @User @User I am getting the following error Exception: Failed to start conversation: {"message":"Cannot POST /api/v1/conversation","error":"Not Found","statusCode":404} I have a voice assistant already set up where I can receive calls via web call,need an Python API code to test it. Here's the error I'm encountering:
Copy code
raise Exception(f"Failed to start conversation: {response.text}")
And below is my current code:
Copy code
import asyncio
import pyaudio
import wave
import os
from vapi_python.vapi_python import Vapi

def main():
    # Initialize VAPI with your API key
    vapi = Vapi(api_key='')
    
    # Configure the pizza shop assistant
    assistant = {
        'firstMessage': 'Thank you for calling Vappys Pizza! How can I help you today?',
        'context': '''You are an employee at a pizza shop.
        
        Menu:
        Pizzas:
        - Margherita ($10)
        - Pepperoni ($12)
        - Veggie Supreme ($13)
        
        Sides:
        - Garlic Bread ($4)
        - Chicken Wings ($8)
        
        Drinks:
        - Soda ($2)
        - Water ($1)
        
        Be friendly, confirm orders clearly, and ask for delivery address if needed.
        Estimate 30-40 minutes for delivery, 15-20 for pickup.''',
        'model': 'gpt-4',
        'voice': 'jennifer-playht',
        'recordingEnabled': True,
        'interruptionsEnabled': True
    }
    
    print(":pizza: Starting Pizza Shop Assistant...")
    print("Press Ctrl+C to end the conversation")
    
    try:
        # Start the conversation
        vapi.start(assistant=assistant)
        
        # This will keep the conversation going until manually stopped
        input("Press Enter to end the conversation...")
        
    except KeyboardInterrupt:
        print("\n:wave: Ending conversation...")
    finally:
        vapi.stop()

if __name__ == "__main__":
    main()
2 Views