-
Notifications
You must be signed in to change notification settings - Fork 79
Expand file tree
/
Copy pathconfig.py
More file actions
43 lines (33 loc) · 1.19 KB
/
config.py
File metadata and controls
43 lines (33 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from pydantic import PostgresDsn, computed_field
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
model_config = SettingsConfigDict(
env_file="/opt/.env",
env_ignore_empty=True,
extra="ignore",
)
model: str = "gpt-4o-mini-2024-07-18"
openai_api_key: str = ""
mcp_server_port: int = 8050
postgres_dsn: PostgresDsn = (
"postgresql://postgres:password@example.supabase.com:6543/postgres"
)
@computed_field
@property
def orm_conn_str(self) -> str:
# NOTE: Explicitly follow LangGraph AsyncPostgresSaver
# and use psycopg driver for ORM
return self.postgres_dsn.encoded_string().replace(
"postgresql://", "postgresql+psycopg://"
)
@computed_field
@property
def checkpoint_conn_str(self) -> str:
# NOTE: LangGraph AsyncPostgresSaver has some issues
# with specifying psycopg driver explicitly
return self.postgres_dsn.encoded_string()
langfuse_public_key: str = ""
langfuse_secret_key: str = ""
langfuse_host: str = "https://cloud.langfuse.com"
environment: str = "development"
settings = Settings()