Spaces:
Sleeping
Sleeping
Ken Sang Tang commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,12 @@
|
|
| 1 |
-
|
| 2 |
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
return {"Hello": "World!"}
|
|
|
|
| 1 |
+
import toml
|
| 2 |
|
| 3 |
+
# Load OPENMANUS_ENDPOINT_URL from env or config fallback
|
| 4 |
+
OPENMANUS_ENDPOINT_URL = os.getenv("OPENMANUS_ENDPOINT_URL")
|
| 5 |
+
if not OPENMANUS_ENDPOINT_URL:
|
| 6 |
+
config_path = "config/config.toml"
|
| 7 |
+
if os.path.exists(config_path):
|
| 8 |
+
config = toml.load(config_path)
|
| 9 |
+
OPENMANUS_ENDPOINT_URL = config.get("OPENMANUS_ENDPOINT_URL")
|
| 10 |
|
| 11 |
+
if not OPENMANUS_ENDPOINT_URL:
|
| 12 |
+
raise EnvironmentError("OPENMANUS_ENDPOINT_URL must be set in env or config/config.toml")
|
|
|