Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -269,29 +269,32 @@ with gr.Blocks(css=css) as demo:
|
|
| 269 |
|
| 270 |
|
| 271 |
def authorize_and_proceed(user, api_key):
|
| 272 |
-
|
| 273 |
|
| 274 |
-
if auth_result == 403:
|
| 275 |
return (
|
| 276 |
gr.update(visible=False),
|
| 277 |
-
gr.update(visible=False),
|
| 278 |
-
gr.update(visible=
|
| 279 |
-
|
| 280 |
)
|
| 281 |
-
elif auth_result:
|
| 282 |
gr.Info("Loading, please wait.")
|
| 283 |
messages_html, history = load_conversation(api_key)
|
| 284 |
return (
|
| 285 |
gr.update(visible=False),
|
| 286 |
gr.update(visible=True),
|
| 287 |
-
|
| 288 |
-
|
|
|
|
| 289 |
)
|
| 290 |
else:
|
| 291 |
return (
|
| 292 |
-
gr.update(visible=True),
|
|
|
|
| 293 |
gr.update(visible=False),
|
| 294 |
-
|
|
|
|
| 295 |
)
|
| 296 |
|
| 297 |
|
|
|
|
| 269 |
|
| 270 |
|
| 271 |
def authorize_and_proceed(user, api_key):
|
| 272 |
+
auth_result = authorize(user, api_key, PRIMARY_SYSTEM_INSTRUCTIONS)
|
| 273 |
|
| 274 |
+
if auth_result == 403:
|
| 275 |
return (
|
| 276 |
gr.update(visible=False),
|
| 277 |
+
gr.update(visible=False),
|
| 278 |
+
gr.update(visible=True),
|
| 279 |
+
[],
|
| 280 |
)
|
| 281 |
+
elif auth_result:
|
| 282 |
gr.Info("Loading, please wait.")
|
| 283 |
messages_html, history = load_conversation(api_key)
|
| 284 |
return (
|
| 285 |
gr.update(visible=False),
|
| 286 |
gr.update(visible=True),
|
| 287 |
+
gr.update(visible=False),
|
| 288 |
+
messages_html,
|
| 289 |
+
history
|
| 290 |
)
|
| 291 |
else:
|
| 292 |
return (
|
| 293 |
+
gr.update(visible=True),
|
| 294 |
+
gr.update(visible=False),
|
| 295 |
gr.update(visible=False),
|
| 296 |
+
"",
|
| 297 |
+
[]
|
| 298 |
)
|
| 299 |
|
| 300 |
|