Srinivasulu kethanaboina commited on
Commit
0f7bc71
1 Parent(s): 6cd1447

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -93,10 +93,9 @@ def handle_query(query, cookies=None):
93
  # Define the button click function
94
  def retrieve_history_and_redirect():
95
  # Here you can retrieve the chat history if necessary
96
- # You can return it, log it, or perform any necessary action
97
- # Redirect to the specified page
98
- webbrowser.open("https://redfernstech.com/chat-bot-test")
99
- return "Redirecting..."
100
 
101
  # Define your Gradio chat interface function
102
  def chat_interface(message, history):
@@ -148,8 +147,11 @@ with gr.Blocks(css=css) as demo:
148
  # Button to retrieve history and redirect
149
  redirect_button = gr.Button("Retrieve History & Redirect")
150
 
151
- # Connect the button with the function
152
- redirect_button.click(fn=retrieve_history_and_redirect, inputs=[], outputs=chat)
 
 
 
153
 
154
  # Launch the Gradio interface
155
  demo.launch()
 
93
  # Define the button click function
94
  def retrieve_history_and_redirect():
95
  # Here you can retrieve the chat history if necessary
96
+ # Return a confirmation message for now
97
+ webbrowser.open("https://redfernstech.com/chat-bot-test") # Redirect to the target URL
98
+ return "History retrieved. Redirecting to the chat test page..."
 
99
 
100
  # Define your Gradio chat interface function
101
  def chat_interface(message, history):
 
147
  # Button to retrieve history and redirect
148
  redirect_button = gr.Button("Retrieve History & Redirect")
149
 
150
+ # Use a gr.Textbox or gr.HTML as output for the button
151
+ redirect_message = gr.Textbox(label="Status", interactive=False)
152
+
153
+ # Connect the button with the function, and output the status message
154
+ redirect_button.click(fn=retrieve_history_and_redirect, inputs=[], outputs=redirect_message)
155
 
156
  # Launch the Gradio interface
157
  demo.launch()