File size: 661 Bytes
1810ba0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | from pathlib import Path
import importlib.util
import sys
from main import app
PROJECT_ROOT = Path(__file__).resolve().parent
ORCHESTRATOR_DIR = PROJECT_ROOT / "qwen-orchestrator"
def _load_orchestrator_app():
sys.path.insert(0, str(ORCHESTRATOR_DIR))
spec = importlib.util.spec_from_file_location(
"eudora_orchestrator_app",
ORCHESTRATOR_DIR / "app.py",
)
if spec is None or spec.loader is None:
raise RuntimeError("Could not load orchestrator app")
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
return module.app
app.mount("/orchestrator", _load_orchestrator_app())
|