diff --git a/backend/main.py b/backend/main.py index 8037032c..9c900f8b 100644 --- a/backend/main.py +++ b/backend/main.py @@ -81,13 +81,17 @@ if settings.OFFICIAL_WEB_API_KEY: @app.on_event("startup") def create_official_web_api_client(): with Session(engine) as session: - create_api_client( - session=session, - api_key=settings.OFFICIAL_WEB_API_KEY, - description="The official web client for the OASST backend.", - frontend_type="web", - trusted=True, - ) + try: + api_auth(settings.OFFICIAL_WEB_API_KEY, db=session) + except OasstError: + logger.info("Creating official web API client") + create_api_client( + session=session, + api_key=settings.OFFICIAL_WEB_API_KEY, + description="The official web client for the OASST backend.", + frontend_type="web", + trusted=True, + ) if settings.RATE_LIMIT: diff --git a/text-frontend/__main__.py b/text-frontend/__main__.py index 3e662e5f..18c1f124 100644 --- a/text-frontend/__main__.py +++ b/text-frontend/__main__.py @@ -25,7 +25,7 @@ def _render_message(message: dict) -> str: @app.command() -def main(backend_url: str = "http://127.0.0.1:8080", api_key: str = "DUMMY_KEY"): +def main(backend_url: str = "http://127.0.0.1:8080", api_key: str = "1234"): """Simple REPL frontend.""" def _post(path: str, json: dict) -> dict: