feat: support cors env (#1188)

Co-authored-by: Shubham Naik <shub@memgpt.ai>
This commit is contained in:
Shubham Naik
2025-03-04 21:31:40 -08:00
committed by GitHub
parent 6776168d59
commit ea4984dfc9

View File

@@ -1,3 +1,4 @@
import os
from pathlib import Path
from typing import Optional
@@ -116,13 +117,20 @@ class ModelSettings(BaseSettings):
disable_schema_generation: bool = False
cors_origins = [
"http://letta.localhost",
"http://localhost:8283",
"http://localhost:8083",
"http://localhost:3000",
"http://localhost:4200",
]
env_cors_origins = os.getenv("ACCEPTABLE_ORIGINS")
cors_origins = (
[
"http://letta.localhost",
"http://localhost:8283",
"http://localhost:8083",
"http://localhost:3000",
"http://localhost:4200",
]
+ [env_cors_origins]
if env_cors_origins
else []
)
# read pg_uri from ~/.letta/pg_uri or set to none, this is to support Letta Desktop
default_pg_uri = None