Spaces:
Sleeping
Sleeping
Commit
·
5c4d32b
1
Parent(s):
7d0fb24
push
Browse files- config/config.py +11 -3
- todo_agent.py +1 -0
config/config.py
CHANGED
|
@@ -13,8 +13,16 @@ class Settings(BaseSettings):
|
|
| 13 |
BUSINESS_SERVICE_URL: HttpUrl = "https://abdullahcoder54-todo-app.hf.space"
|
| 14 |
CONVERSATION_RETENTION_DAYS: int = 7
|
| 15 |
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
settings = Settings()
|
|
|
|
| 13 |
BUSINESS_SERVICE_URL: HttpUrl = "https://abdullahcoder54-todo-app.hf.space"
|
| 14 |
CONVERSATION_RETENTION_DAYS: int = 7
|
| 15 |
|
| 16 |
+
def model_post_init(self, __context):
|
| 17 |
+
if not self.GEMINI_API_KEY:
|
| 18 |
+
self.GEMINI_API_KEY = os.environ.get("GEMINI_API_KEY")
|
| 19 |
+
if not self.BETTER_AUTH_SECRET:
|
| 20 |
+
self.BETTER_AUTH_SECRET = os.environ.get("BETTER_AUTH_SECRET")
|
| 21 |
+
|
| 22 |
+
if not self.GEMINI_API_KEY or not self.BETTER_AUTH_SECRET:
|
| 23 |
+
raise RuntimeError(
|
| 24 |
+
"Critical env vars missing in MCP subprocess"
|
| 25 |
+
)
|
| 26 |
+
|
| 27 |
|
| 28 |
settings = Settings()
|
todo_agent.py
CHANGED
|
@@ -37,6 +37,7 @@ class TodoAgent:
|
|
| 37 |
name="Todo Management MCP Server",
|
| 38 |
params={"command": sys.executable, "args": ["-m", "ai_mcp_server"]},
|
| 39 |
client_session_timeout_seconds=30.0
|
|
|
|
| 40 |
)
|
| 41 |
self.agent = Agent(
|
| 42 |
name="TodoAssistant",
|
|
|
|
| 37 |
name="Todo Management MCP Server",
|
| 38 |
params={"command": sys.executable, "args": ["-m", "ai_mcp_server"]},
|
| 39 |
client_session_timeout_seconds=30.0
|
| 40 |
+
|
| 41 |
)
|
| 42 |
self.agent = Agent(
|
| 43 |
name="TodoAssistant",
|