nuernie
commited on
Commit
·
f486429
1
Parent(s):
28ad8e5
adjust root path
Browse files
app.py
CHANGED
@@ -17,7 +17,24 @@ async def lifespan(app: FastAPI):
|
|
17 |
yield
|
18 |
# Cleanup can go here if needed
|
19 |
|
20 |
-
app = FastAPI(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
@app.websocket("/ws")
|
23 |
async def websocket_endpoint(websocket: WebSocket):
|
@@ -46,6 +63,9 @@ async def websocket_endpoint(websocket: WebSocket):
|
|
46 |
|
47 |
@app.get("/health")
|
48 |
def health_check():
|
|
|
|
|
|
|
49 |
return {"status": "healthy"}
|
50 |
|
51 |
if __name__ == "__main__":
|
|
|
17 |
yield
|
18 |
# Cleanup can go here if needed
|
19 |
|
20 |
+
app = FastAPI(
|
21 |
+
title="Whisper Live Server",
|
22 |
+
description="A real-time speech-to-text server using OpenAI's Whisper model",
|
23 |
+
version="1.0.0",
|
24 |
+
lifespan=lifespan
|
25 |
+
)
|
26 |
+
|
27 |
+
@app.get("/")
|
28 |
+
async def root():
|
29 |
+
"""
|
30 |
+
Root endpoint that returns a welcome message
|
31 |
+
"""
|
32 |
+
return {
|
33 |
+
"message": "Welcome to Whisper Live Server",
|
34 |
+
"status": "running",
|
35 |
+
"websocket_endpoint": "/ws",
|
36 |
+
"health_endpoint": "/health"
|
37 |
+
}
|
38 |
|
39 |
@app.websocket("/ws")
|
40 |
async def websocket_endpoint(websocket: WebSocket):
|
|
|
63 |
|
64 |
@app.get("/health")
|
65 |
def health_check():
|
66 |
+
"""
|
67 |
+
Health check endpoint to verify the server is running
|
68 |
+
"""
|
69 |
return {"status": "healthy"}
|
70 |
|
71 |
if __name__ == "__main__":
|