diff --git a/.env.gcp.yaml.example b/.env.gcp.yaml.example index c878de07..c8d8a8c6 100644 --- a/.env.gcp.yaml.example +++ b/.env.gcp.yaml.example @@ -13,3 +13,5 @@ AZURE_OPENAI_API_BASE: your_secret_here AZURE_OPENAI_API_VERSION: your_secret_here AZURE_OPENAI_API_KEY: your_secret_here KAY_API_KEY: your_secret_here +ROBOCORP_ACTION_SERVER_URL: https://dummy-action-server.robocorp.link +ROBOCORP_ACTION_SERVER_KEY: dummy-api-key diff --git a/backend/app/server.py b/backend/app/server.py index 82fdd920..074f7292 100644 --- a/backend/app/server.py +++ b/backend/app/server.py @@ -1,3 +1,5 @@ +import os +import logging from pathlib import Path import orjson @@ -7,6 +9,8 @@ from app.api import router as api_router from app.upload import ingest_runnable +logger = logging.getLogger(__name__) + app = FastAPI(title="OpenGPTs API") @@ -24,7 +28,12 @@ def ingest_files(files: list[UploadFile], config: str = Form(...)) -> None: return ingest_runnable.batch([file.file for file in files], config) -app.mount("", StaticFiles(directory=str(ROOT / "ui"), html=True), name="ui") +ui_dir = str(ROOT / "ui") + +if os.path.exists(ui_dir): + app.mount("", StaticFiles(directory=ui_dir, html=True), name="ui") +else: + logger.warn("No UI directory found, serving API only.") if __name__ == "__main__": import uvicorn