-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
executable file
·85 lines (74 loc) · 2.44 KB
/
run.py
File metadata and controls
executable file
·85 lines (74 loc) · 2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/usr/bin/env python3
"""
Voice Vibe Coding - Single Command Runner
Starts webhook server and orchestrator together for seamless operation.
"""
import os
import sys
import subprocess
import signal
import time
from pathlib import Path
# Process tracking
processes = []
def signal_handler(sig, frame):
"""Clean shutdown on Ctrl+C"""
print("\n\n🛑 Shutting down Voice Vibe Coding...")
for proc in processes:
proc.terminate()
sys.exit(0)
def main():
print("🎙️ Voice Vibe Coding - Starting All Services")
print("=" * 50)
print()
# Register signal handler for clean shutdown
signal.signal(signal.SIGINT, signal_handler)
# Check if venv is activated
if not hasattr(sys, 'real_prefix') and not (hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix):
print("⚠️ Virtual environment not activated!")
print(" Run: source venv/bin/activate")
print(" Then: python run.py")
sys.exit(1)
# Start webhook server
print("🌐 Starting webhook server on port 5001...")
webhook_proc = subprocess.Popen(
[sys.executable, "webhook_server.py"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True
)
processes.append(webhook_proc)
time.sleep(2) # Give it time to start
# Check if webhook server started successfully
if webhook_proc.poll() is not None:
print("❌ Webhook server failed to start")
sys.exit(1)
print("✅ Webhook server running")
print()
print("📞 Voice Vibe Coding is ready!")
print()
print("Service Status:")
print(" • Webhook Server: http://localhost:5001")
print(" • Pre-call webhook: http://localhost:5001/precall")
print(" • Post-call webhook: http://localhost:5001/elevenlabs-webhook")
print()
print("When a call comes in, the orchestrator will automatically start.")
print()
print("📋 Monitoring:")
print(" • Webhook logs: logs/webhook_server.log")
print(" • Pipeline logs: logs/pipeline_*.log")
print()
print("Press Ctrl+C to stop all services")
print()
# Keep running and monitor processes
try:
while True:
# Check if webhook server died
if webhook_proc.poll() is not None:
print("❌ Webhook server stopped unexpectedly")
break
time.sleep(1)
except KeyboardInterrupt:
pass
if __name__ == "__main__":
main()