File tree 2 files changed +12
-8
lines changed
2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -81,13 +81,17 @@ def alembic_upgrade():
81
81
@app .on_event ("startup" )
82
82
def create_official_web_api_client ():
83
83
with Session (engine ) as session :
84
- create_api_client (
85
- session = session ,
86
- api_key = settings .OFFICIAL_WEB_API_KEY ,
87
- description = "The official web client for the OASST backend." ,
88
- frontend_type = "web" ,
89
- trusted = True ,
90
- )
84
+ try :
85
+ api_auth (settings .OFFICIAL_WEB_API_KEY , db = session )
86
+ except OasstError :
87
+ logger .info ("Creating official web API client" )
88
+ create_api_client (
89
+ session = session ,
90
+ api_key = settings .OFFICIAL_WEB_API_KEY ,
91
+ description = "The official web client for the OASST backend." ,
92
+ frontend_type = "web" ,
93
+ trusted = True ,
94
+ )
91
95
92
96
93
97
if settings .RATE_LIMIT :
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ def _render_message(message: dict) -> str:
25
25
26
26
27
27
@app .command ()
28
- def main (backend_url : str = "http://127.0.0.1:8080" , api_key : str = "DUMMY_KEY " ):
28
+ def main (backend_url : str = "http://127.0.0.1:8080" , api_key : str = "1234 " ):
29
29
"""Simple REPL frontend."""
30
30
31
31
def _post (path : str , json : dict ) -> dict :
You can’t perform that action at this time.
0 commit comments