Spaces:
Sleeping
Sleeping
Deploy Small Talk: Reachy Mini AI podcast (gradio.Server + three.js + LiveKit)
Browse files- backend/server.py +31 -0
- frontend/dist/assets/index-D_audj8n.js +0 -0
- frontend/dist/index.html +1 -1
backend/server.py
CHANGED
|
@@ -599,6 +599,28 @@ async def style_reachy(req: StyleRequest):
|
|
| 599 |
return out
|
| 600 |
|
| 601 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 602 |
# --------------------------------------------------------------------- admin
|
| 603 |
from fastapi import Header # noqa: E402
|
| 604 |
|
|
@@ -608,6 +630,13 @@ def _check_admin(token: str | None) -> None:
|
|
| 608 |
raise HTTPException(403, "bad admin token")
|
| 609 |
|
| 610 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 611 |
async def admin_rooms(x_admin_token: str | None = Header(default=None)):
|
| 612 |
"""Everything running, with enough detail to decide what to kill."""
|
| 613 |
_check_admin(x_admin_token)
|
|
@@ -695,6 +724,8 @@ def attach(app) -> None:
|
|
| 695 |
app.add_api_route("/api/rooms/{room_id}/reachy/leave", remove_reachy, methods=["POST"])
|
| 696 |
app.add_api_route("/api/token", post_token, methods=["POST"])
|
| 697 |
app.add_api_route("/api/style-reachy", style_reachy, methods=["POST"])
|
|
|
|
|
|
|
| 698 |
app.add_api_route("/api/admin/rooms", admin_rooms, methods=["GET"])
|
| 699 |
app.add_api_route("/api/admin/rooms/{room_id}/stop", admin_stop, methods=["POST"])
|
| 700 |
app.add_api_route("/api/admin/rooms/{room_id}", admin_delete, methods=["DELETE"])
|
|
|
|
| 599 |
return out
|
| 600 |
|
| 601 |
|
| 602 |
+
# --------------------------------------------------------------------- debug log
|
| 603 |
+
# Browser-side WebRTC diagnostics ship here so flaky-client issues (looking at
|
| 604 |
+
# you, Firefox) can be inspected server-side without copy-pasting consoles.
|
| 605 |
+
from collections import deque # noqa: E402
|
| 606 |
+
|
| 607 |
+
DEBUG_LOG: deque[str] = deque(maxlen=3000)
|
| 608 |
+
|
| 609 |
+
|
| 610 |
+
class DebugLines(BaseModel):
|
| 611 |
+
tag: str = ""
|
| 612 |
+
lines: list[str]
|
| 613 |
+
|
| 614 |
+
|
| 615 |
+
async def post_debug_log(req: DebugLines):
|
| 616 |
+
import time as _t
|
| 617 |
+
|
| 618 |
+
ts = _t.strftime("%H:%M:%S")
|
| 619 |
+
for ln in req.lines[:100]:
|
| 620 |
+
DEBUG_LOG.append(f"{ts} [{req.tag[:24]}] {ln[:500]}")
|
| 621 |
+
return {"ok": True}
|
| 622 |
+
|
| 623 |
+
|
| 624 |
# --------------------------------------------------------------------- admin
|
| 625 |
from fastapi import Header # noqa: E402
|
| 626 |
|
|
|
|
| 630 |
raise HTTPException(403, "bad admin token")
|
| 631 |
|
| 632 |
|
| 633 |
+
async def admin_debug_log(x_admin_token: str | None = Header(default=None)):
|
| 634 |
+
_check_admin(x_admin_token)
|
| 635 |
+
from fastapi.responses import PlainTextResponse
|
| 636 |
+
|
| 637 |
+
return PlainTextResponse("\n".join(DEBUG_LOG))
|
| 638 |
+
|
| 639 |
+
|
| 640 |
async def admin_rooms(x_admin_token: str | None = Header(default=None)):
|
| 641 |
"""Everything running, with enough detail to decide what to kill."""
|
| 642 |
_check_admin(x_admin_token)
|
|
|
|
| 724 |
app.add_api_route("/api/rooms/{room_id}/reachy/leave", remove_reachy, methods=["POST"])
|
| 725 |
app.add_api_route("/api/token", post_token, methods=["POST"])
|
| 726 |
app.add_api_route("/api/style-reachy", style_reachy, methods=["POST"])
|
| 727 |
+
app.add_api_route("/api/debug-log", post_debug_log, methods=["POST"])
|
| 728 |
+
app.add_api_route("/api/admin/debug-log", admin_debug_log, methods=["GET"])
|
| 729 |
app.add_api_route("/api/admin/rooms", admin_rooms, methods=["GET"])
|
| 730 |
app.add_api_route("/api/admin/rooms/{room_id}/stop", admin_stop, methods=["POST"])
|
| 731 |
app.add_api_route("/api/admin/rooms/{room_id}", admin_delete, methods=["DELETE"])
|
frontend/dist/assets/index-D_audj8n.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
frontend/dist/index.html
CHANGED
|
@@ -11,7 +11,7 @@
|
|
| 11 |
href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,300;12..96,400;12..96,500;12..96,600;12..96,700;12..96,800&family=Instrument+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600&family=JetBrains+Mono:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,500;1,400;1,500;1,600&family=Orbitron:wght@500;700;900&family=Share+Tech+Mono&family=Noto+Sans+JP:wght@300;500&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Fraunces:opsz,wght@9..144,300;9..144,400;9..144,600&family=Inter+Tight:wght@200;300;400;600&family=Special+Elite&family=IBM+Plex+Sans+Condensed:wght@400;600&display=swap"
|
| 12 |
rel="stylesheet"
|
| 13 |
/>
|
| 14 |
-
<script type="module" crossorigin src="/assets/index-
|
| 15 |
<link rel="stylesheet" crossorigin href="/assets/index-B_ssUwJo.css">
|
| 16 |
</head>
|
| 17 |
<body>
|
|
|
|
| 11 |
href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,300;12..96,400;12..96,500;12..96,600;12..96,700;12..96,800&family=Instrument+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600&family=JetBrains+Mono:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,500;1,400;1,500;1,600&family=Orbitron:wght@500;700;900&family=Share+Tech+Mono&family=Noto+Sans+JP:wght@300;500&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Fraunces:opsz,wght@9..144,300;9..144,400;9..144,600&family=Inter+Tight:wght@200;300;400;600&family=Special+Elite&family=IBM+Plex+Sans+Condensed:wght@400;600&display=swap"
|
| 12 |
rel="stylesheet"
|
| 13 |
/>
|
| 14 |
+
<script type="module" crossorigin src="/assets/index-D_audj8n.js"></script>
|
| 15 |
<link rel="stylesheet" crossorigin href="/assets/index-B_ssUwJo.css">
|
| 16 |
</head>
|
| 17 |
<body>
|