@@ -33,14 +33,6 @@ class Settings(BaseSettings):
33
33
COMET_API_KEY : Optional [str ] = None # API key for CometML integration.
34
34
COMET_PROJECT_NAME : str = "twin" # CometML project name for tracking experiments.
35
35
36
- # --- Default Genre ---
37
- DEFAULT_GENRE : str = Field ("Western" , description = "Default genre for querying." )
38
-
39
- # --- Docker and Network Configuration ---
40
- DOCKER_NETWORK_NAME : str = Field (
41
- "zenml-network" , description = "Docker network for the application."
42
- )
43
-
44
36
# --- Enable Flags ---
45
37
ENABLE_OFFLINE_MODE : bool = Field (
46
38
True , description = "Flag to enable offline mode (disables online ingestion)."
@@ -56,32 +48,17 @@ class Settings(BaseSettings):
56
48
# --- Hugging Face Configuration ---
57
49
HUGGINGFACE_ACCESS_TOKEN : Optional [str ] = None # Token for Hugging Face API.
58
50
59
- # --- Local Data File Path ---
60
- DATA_DIRECTORY : str = Field (
61
- "./data" ,
62
- description = "Path to the local JSON file for offline processing." ,
63
- )
64
-
65
- # --- MongoDB Atlas Local Configuration ---
66
- MONGODB_OFFLINE_COLLECTION : str = (
67
- "offline_documents" # Name of the collection in the offline database.
68
- )
69
- MONGODB_OFFLINE_DATABASE : str = "rag_pipeline" # Name of the offline database.
51
+ # --- MongoDB Atlas Configuration ---
52
+ MONGODB_DATABASE_NAME : str = "second_brain"
70
53
MONGODB_OFFLINE_URI : str = Field (
71
54
default_factory = lambda : os .getenv (
72
55
"MONGODB_OFFLINE_URI" , "mongodb://127.0.0.1:27017"
73
56
),
74
- description = "Connection URI for local MongoDB Atlas instance." ,
75
- )
76
-
77
- # --- MongoDB Atlas Cloud Configuration ---
78
- MONGODB_ONLINE_COLLECTION : str = (
79
- "movies" # Name of the collection in the online database.
57
+ description = "Connection URI for the local MongoDB Atlas instance." ,
80
58
)
81
- MONGODB_ONLINE_DATABASE : str = "sample_mflix" # Name of the online database.
82
59
MONGODB_ONLINE_URI : str | None = Field (
83
60
default = None ,
84
- description = "Connection URI for cloud MongoDB Atlas instance." ,
61
+ description = "Connection URI for the Cloud MongoDB Atlas instance." ,
85
62
)
86
63
87
64
# --- Notion API Configuration ---
@@ -93,9 +70,8 @@ class Settings(BaseSettings):
93
70
94
71
# --- Docker Runtime ---
95
72
IS_RUNNING_IN_DOCKER : bool = Field (
96
- default_factory = lambda : os .getenv ("IS_RUNNING_IN_DOCKER" , "false" ).lower ()
97
- in ["true" , "1" ],
98
73
description = "Flag to indicate if the application is running inside a Docker container." ,
74
+ default = False ,
99
75
)
100
76
101
77
def __init__ (self , ** kwargs ):
@@ -104,45 +80,23 @@ def __init__(self, **kwargs):
104
80
"""
105
81
super ().__init__ (** kwargs )
106
82
107
- # Adjust MongoDB URI based on runtime conditions, but respect .env
108
- if os .getenv ("IS_RUNNING_IN_DOCKER" , "false" ).lower () == "true" :
109
- self .MONGODB_OFFLINE_URI = os .getenv (
110
- "MONGODB_OFFLINE_URI" , "mongodb://mongodb-atlas-local:27017"
111
- )
112
-
113
83
@property
114
84
def MONGODB_URI (self ) -> str :
115
85
"""
116
86
Returns the appropriate MongoDB URI based on ENABLE_OFFLINE_MODE.
117
87
"""
118
88
119
- return (
120
- self .MONGODB_OFFLINE_URI
121
- if self .ENABLE_OFFLINE_MODE
122
- else self .MONGODB_ONLINE_URI
123
- )
89
+ if self .IS_RUNNING_IN_DOCKER is True :
90
+ self .MONGODB_OFFLINE_URI = "mongodb://mongodb-atlas-local:27017"
124
91
125
- @property
126
- def DATABASE_NAME (self ) -> str :
127
- """
128
- Returns the appropriate database name based on ENABLE_OFFLINE_MODE.
129
- """
130
- return (
131
- self .MONGODB_OFFLINE_DATABASE
132
- if self .ENABLE_OFFLINE_MODE
133
- else self .MONGODB_ONLINE_DATABASE
134
- )
92
+ if self .ENABLE_OFFLINE_MODE is True :
93
+ return self .MONGODB_OFFLINE_URI
135
94
136
- @property
137
- def COLLECTION_NAME (self ) -> str :
138
- """
139
- Returns the appropriate collection name based on ENABLE_OFFLINE_MODE.
140
- """
141
- return (
142
- self .MONGODB_OFFLINE_COLLECTION
143
- if self .ENABLE_OFFLINE_MODE
144
- else self .MONGODB_ONLINE_COLLECTION
145
- )
95
+ assert (
96
+ self .MONGODB_ONLINE_URI is not None
97
+ ), "MONGODB_ONLINE_URI is not set, while ENABLE_OFFLINE_MODE is False."
98
+
99
+ return self .MONGODB_ONLINE_URI
146
100
147
101
@property
148
102
def OPENAI_MAX_TOKEN_WINDOW (self ) -> int :
0 commit comments