Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

fix: Update static_files.py (#1340)

madgrizzle699b1db400c1
diff --git a/memgpt/server/rest_api/static_files.py b/memgpt/server/rest_api/static_files.py
index f1e653bb1..494f6a521 100644
--- a/memgpt/server/rest_api/static_files.py
+++ b/memgpt/server/rest_api/static_files.py
@@ -1,3 +1,4 @@
+import importlib.util
import os
from fastapi import FastAPI, HTTPException
@@ -17,7 +18,7 @@ class SPAStaticFiles(StaticFiles):
def mount_static_files(app: FastAPI):
- static_files_path = os.path.join(os.getcwd(), "memgpt", "server", "static_files")
+ static_files_path = os.path.join(os.path.dirname(importlib.util.find_spec("memgpt").origin), "server", "static_files")
if os.path.exists(static_files_path):
app.mount(
"/",