refactor(ui): delete legacy static website and refresh documentation
This commit is contained in:
+2
-20
@@ -1394,7 +1394,6 @@ if SPEECH_TO_SPEECH_URL or S2S_PROXY_TARGET:
|
||||
SERPER_URL = "https://google.serper.dev/search"
|
||||
# Cap results so the tool output stays small enough to feed back to the model.
|
||||
MAX_RESULTS = 5
|
||||
HERE = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
app = FastAPI(title="s2s-demo")
|
||||
|
||||
@@ -3481,7 +3480,7 @@ async def reasoning(req: ReasoningRequest):
|
||||
elif (not phone) and (not needs_reports) and (not episode_id) and (not S2S_LATEST_SUMMARY_TEXT):
|
||||
logger.info(
|
||||
"[INJECT-PROFILE] ⏭️ REASONING: skipped (phoneNumber missing from request body AND no episode_id). "
|
||||
"Browser-side issue: check main.js passes voceroUserPhoneNumber and/or episode_id in JSON body. (Note: S2S_REPORT_LIST fetch works even without phone.)"
|
||||
"Browser-side issue: check VoiceController passes phoneNumber and/or episode_id in the JSON body. (Note: S2S_REPORT_LIST fetch works even without phone.)"
|
||||
)
|
||||
elif not can_inject:
|
||||
logger.info(
|
||||
@@ -3758,7 +3757,7 @@ async def reasoning(req: ReasoningRequest):
|
||||
|
||||
# ────────────────────────────────────────────────────────────────────
|
||||
# Mode A: NODE_RED forwards the complete payload; the flow decides behavior.
|
||||
# Stage 1 (log-only) returns {answer: "", log_only: true}, allowing main.js
|
||||
# Stage 1 (log-only) returns {answer: "", log_only: true}, allowing the browser
|
||||
# to leave speech generation to the S2S backend. Later stages can return
|
||||
# {answer: "...", log_only: false}. Expected response fields include answer,
|
||||
# log_only, usage, debug and latency_ms.
|
||||
@@ -6293,18 +6292,6 @@ async def _queue_id(request: Request) -> str:
|
||||
return (data or {}).get("queueId", "") if isinstance(data, dict) else ""
|
||||
|
||||
|
||||
@app.middleware("http")
|
||||
async def no_cache_static_assets(request: Request, call_next):
|
||||
response = await call_next(request)
|
||||
path = request.url.path or ""
|
||||
nocache_ext = (".html", ".js", ".mjs", ".css", ".wasm", ".worklet.js")
|
||||
if any(path.endswith(ext) for ext in nocache_ext) or path == "/" or path.endswith("/"):
|
||||
response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate, max-age=0"
|
||||
response.headers["Pragma"] = "no-cache"
|
||||
response.headers["Expires"] = "0"
|
||||
return response
|
||||
|
||||
|
||||
# Preserve the former proposal URLs after moving the document out of the client.
|
||||
@app.get("/project", include_in_schema=False)
|
||||
@app.get("/project/", include_in_schema=False)
|
||||
@@ -6316,8 +6303,3 @@ async def project_documentation():
|
||||
|
||||
# The existing FastAPI /docs page remains registered ahead of this mount.
|
||||
app.mount("/docs", StaticFiles(directory=os.path.join(ROOT_DIR, "docs"), html=True), name="documentation")
|
||||
|
||||
|
||||
# Static front-end. Registered last so the /api routes win. `html=True` serves
|
||||
# index.html at "/". The repo is public anyway, so serving the dir is fine.
|
||||
app.mount("/", StaticFiles(directory=HERE, html=True), name="static")
|
||||
|
||||
Reference in New Issue
Block a user