fixing text frontend and startup creation

This commit is contained in:
Yannic Kilcher
2023-01-16 00:11:20 +01:00
parent dbdb3a0823
commit c0cb15bbb0
2 changed files with 12 additions and 8 deletions
+11 -7
View File
@@ -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:
+1 -1
View File
@@ -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: