Spaces:
Building
Building
Update app.py
Browse files
app.py
CHANGED
@@ -11,6 +11,7 @@ import uvicorn
|
|
11 |
import os
|
12 |
from pathlib import Path
|
13 |
import mimetypes
|
|
|
14 |
|
15 |
from utils import log
|
16 |
from chat_handler import router as chat_router # ← start_session & chat
|
@@ -85,6 +86,11 @@ app.include_router(chat_router, prefix="/api")
|
|
85 |
# ---------------- Admin API routes ----------------------------------
|
86 |
app.include_router(admin_router)
|
87 |
|
|
|
|
|
|
|
|
|
|
|
88 |
# ---------------- Serve Angular UI if exists ------------------------
|
89 |
static_dir = Path(__file__).parent / "static"
|
90 |
if static_dir.exists():
|
|
|
11 |
import os
|
12 |
from pathlib import Path
|
13 |
import mimetypes
|
14 |
+
from websocket_handler import websocket_endpoint
|
15 |
|
16 |
from utils import log
|
17 |
from chat_handler import router as chat_router # ← start_session & chat
|
|
|
86 |
# ---------------- Admin API routes ----------------------------------
|
87 |
app.include_router(admin_router)
|
88 |
|
89 |
+
# ---------------- WebSocket route for real-time STT ------------------
|
90 |
+
@app.websocket("/ws/conversation/{session_id}")
|
91 |
+
async def conversation_websocket(websocket: WebSocket, session_id: str):
|
92 |
+
await websocket_endpoint(websocket, session_id)
|
93 |
+
|
94 |
# ---------------- Serve Angular UI if exists ------------------------
|
95 |
static_dir = Path(__file__).parent / "static"
|
96 |
if static_dir.exists():
|