Spaces:
Sleeping
Sleeping
| from fastapi import FastAPI | |
| import toml | |
| import os | |
| app = FastAPI() | |
| # Load OPENMANUS_ENDPOINT_URL from env or config fallback | |
| OPENMANUS_ENDPOINT_URL = os.getenv("OPENMANUS_ENDPOINT_URL") | |
| if not OPENMANUS_ENDPOINT_URL: | |
| config_path = "config/config.toml" | |
| if os.path.exists(config_path): | |
| config = toml.load(config_path) | |
| OPENMANUS_ENDPOINT_URL = config.get("OPENMANUS_ENDPOINT_URL") | |
| if not OPENMANUS_ENDPOINT_URL: | |
| raise EnvironmentError("OPENMANUS_ENDPOINT_URL must be set in env or config/config.toml") | |