Arvind
04/21/2025, 10:13 PMimport asyncio
from vapi_python.vapi_python import Vapi
async def main():
# Initialize VAPI with your API key
vapi = Vapi(api_key='abc')
# 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
await vapi.start(assistant=assistant)
# Keep the conversation going until Ctrl+C is pressed
while True:
await asyncio.sleep(1)
except KeyboardInterrupt:
print("\n:wave: Ending conversation...")
await vapi.stop()
if __name__ == "__main__":
asyncio.run(main())
help me with this issueKyle Brunker
04/21/2025, 10:34 PMArvind
04/21/2025, 11:18 PM