botsi commited on
Commit
0fec8fb
·
verified ·
1 Parent(s): 7f88b73

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -52,6 +52,7 @@ def fetch_data_as_json():
52
  # Return the JSON result
53
  return json_result
54
 
 
55
 
56
  get_window_url_params = """
57
  function() {
@@ -62,9 +63,7 @@ get_window_url_params = """
62
  """
63
 
64
  with gr.Blocks() as demo:
65
- gr.Markdown("""## Gradio send queryparam to chatbot
66
- type `read query`
67
- """)
68
  url_params = gr.JSON({}, visible=False, label="URL Params")
69
  chatbot = gr.Chatbot().style(height=500)
70
  msg = gr.Textbox()
@@ -80,7 +79,7 @@ type `read query`
80
  {json.dumps(url_params, indent=4)}
81
  """
82
  else:
83
- bot_message = random.choice(["Yes", "No"])
84
  history[-1][1] = bot_message
85
  time.sleep(1)
86
  return history
 
52
  # Return the JSON result
53
  return json_result
54
 
55
+ print(json_result)
56
 
57
  get_window_url_params = """
58
  function() {
 
63
  """
64
 
65
  with gr.Blocks() as demo:
66
+ gr.Markdown("""##Please insert`read query`in order to get the URL Parameters from the chatbot""")
 
 
67
  url_params = gr.JSON({}, visible=False, label="URL Params")
68
  chatbot = gr.Chatbot().style(height=500)
69
  msg = gr.Textbox()
 
79
  {json.dumps(url_params, indent=4)}
80
  """
81
  else:
82
+ bot_message = "You did not ask for the URL Params :) But here is what I read from the database:" + json_results
83
  history[-1][1] = bot_message
84
  time.sleep(1)
85
  return history