Skip to content

Commit

Permalink
fix: fix the wildcard route which bricked the refresh on the web app
Browse files Browse the repository at this point in the history
  • Loading branch information
cpacker committed Sep 25, 2024
1 parent 7f3c9ec commit 0a357a7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions letta/server/rest_api/static_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ async def serve_spa():
async def serve_spa():
return FileResponse(os.path.join(static_files_path, "index.html"))

@app.get("/agents/{agent}/chat", include_in_schema=False)
async def serve_spa():
print("serving spa", static_files_path)
return FileResponse(os.path.join(static_files_path, "index.html"))

@app.get("/agents", include_in_schema=False)
async def serve_spa():
return FileResponse(os.path.join(static_files_path, "index.html"))
Expand All @@ -55,10 +60,6 @@ async def serve_spa():
async def serve_spa():
return FileResponse(os.path.join(static_files_path, "index.html"))

@app.get("/agents/{agent-id}/chat", include_in_schema=False)
async def serve_spa():
return FileResponse(os.path.join(static_files_path, "index.html"))


# def mount_static_files(app: FastAPI):
# static_files_path = os.path.join(os.path.dirname(importlib.util.find_spec("letta").origin), "server", "static_files")
Expand Down

0 comments on commit 0a357a7

Please sign in to comment.