feat(llm): переход на реляционные узлы промпта, db_cli context и очистка от регулярок

This commit is contained in:
2026-08-17 11:55:07 +03:00
parent 4e3c99b728
commit 828ce67817
25 changed files with 4447 additions and 1006 deletions
+11 -7
View File
@@ -73,16 +73,20 @@ async def favicon():
def serve_static_fallback(file_path: str):
clean_path = file_path.lstrip("/")
target = os.path.join(STATIC_DIR, clean_path)
if os.path.isfile(target):
if clean_path.endswith(".js"):
return FileResponse(target, media_type="application/javascript")
elif clean_path.endswith(".css"):
return FileResponse(target, media_type="text/css")
return FileResponse(target)
# Резервный рекурсивный поиск файла в static
filename = os.path.basename(clean_path)
target_js = os.path.join(STATIC_DIR, "js", filename)
if filename.endswith(".js") and os.path.isfile(target_js):
return FileResponse(target_js, media_type="application/javascript")
target_css = os.path.join(STATIC_DIR, "css", filename)
if filename.endswith(".css") and os.path.isfile(target_css):
return FileResponse(target_css, media_type="text/css")
for root, _, files in os.walk(STATIC_DIR):
if filename in files:
full_path = os.path.join(root, filename)
media = "application/javascript" if filename.endswith(".js") else "text/css"
return FileResponse(full_path, media_type=media)
raise HTTPException(status_code=404, detail="File not found")