Spaces:
Build error
Build error
File size: 413 Bytes
9adf324 | 1 2 3 4 5 6 7 8 9 10 11 12 | import gradio as gr
def save_jwt_to_session(response):
"""Extracts session_token and session_id from API response and saves them in Gradio State."""
session_token = response.get("session_token")
session_id = response.get("session_id")
if session_token and session_id:
return gr.update(value=session_token), gr.update(value=session_id)
return gr.update(), gr.update()
|