-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
27 lines (21 loc) · 897 Bytes
/
app.py
File metadata and controls
27 lines (21 loc) · 897 Bytes
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
from fastapi import FastAPI
from fastapi.responses import HTMLResponse
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
from fastapi import Request
from src.voice.websocket import router as websocket_router
app = FastAPI(title="Medical Voice Assistant")
# Mount static files
app.mount("/static", StaticFiles(directory="static"), name="static")
# Setup templates
templates = Jinja2Templates(directory="templates")
# Include WebSocket router
app.include_router(websocket_router)
@app.get("/", response_class=HTMLResponse)
async def get_voice_interface(request: Request):
return templates.TemplateResponse("index.html", {"request": request})
if __name__ == "__main__":
import uvicorn
print("Starting Medical Voice Assistant...")
print("Open your browser and go to: http://localhost:8000")
uvicorn.run(app, host="0.0.0.0", port=8000)