mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-06-30 16:40:05 +08:00
fixing text frontend and startup creation
This commit is contained in:
+11
-7
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user