Spaces:
Runtime error
Runtime error
acecalisto3
commited on
Update app2.py
Browse files
app2.py
CHANGED
@@ -1,3 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import asyncio
|
2 |
import gradio as gr
|
3 |
import logging
|
@@ -19,19 +37,16 @@ from pydantic_settings import BaseSettings
|
|
19 |
load_dotenv() # Load environment variables from .env file
|
20 |
|
21 |
class Settings(BaseSettings):
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
STORAGE_LOCATION: str = os.getenv("STORAGE_LOCATION", "")
|
29 |
-
CHATBOT_API_KEY: str = os.getenv("CHATBOT_API_KEY", "") # Add your chatbot API key
|
30 |
-
|
31 |
class Config:
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
settings = Settings()
|
36 |
|
37 |
# --- Database Connection ---
|
|
|
1 |
+
from pydantic_settings import BaseSettings
|
2 |
+
|
3 |
+
class Settings(BaseSettings):
|
4 |
+
# Define the database fields explicitly
|
5 |
+
db_host: str
|
6 |
+
db_user: str
|
7 |
+
db_password: str
|
8 |
+
db_name: str
|
9 |
+
|
10 |
+
class Config:
|
11 |
+
# Optional: if you want to allow extra fields
|
12 |
+
# extra = "allow"
|
13 |
+
|
14 |
+
settings = Settings()
|
15 |
+
|
16 |
+
|
17 |
+
|
18 |
+
|
19 |
import asyncio
|
20 |
import gradio as gr
|
21 |
import logging
|
|
|
37 |
load_dotenv() # Load environment variables from .env file
|
38 |
|
39 |
class Settings(BaseSettings):
|
40 |
+
# Define the database fields explicitly
|
41 |
+
db_host: str
|
42 |
+
db_user: str
|
43 |
+
db_password: str
|
44 |
+
db_name: str
|
45 |
+
|
|
|
|
|
|
|
46 |
class Config:
|
47 |
+
# Optional: if you want to allow extra fields
|
48 |
+
extra = "allow"
|
49 |
+
|
50 |
settings = Settings()
|
51 |
|
52 |
# --- Database Connection ---
|