Phoenix21 commited on
Commit
e6c371a
·
verified ·
1 Parent(s): 2acee8d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -1,7 +1,12 @@
1
  import gradio as gr
2
  from pipeline import run_with_chain
3
  def ask_dailywellness(query: str) -> str:
4
- return run_with_chain (query)
 
 
 
 
 
5
  interface = gr. Interface (
6
  fn=ask_dailywellness,
7
  inputs=gr.Textbox(lines=2, label="Ask DailyWellnessAI"),
 
1
  import gradio as gr
2
  from pipeline import run_with_chain
3
  def ask_dailywellness(query: str) -> str:
4
+ # Ensure that the query passed to run_with_chain is a valid string
5
+ if isinstance(query, str):
6
+ return run_with_chain(query)
7
+ else:
8
+ # If for some reason the query is not a string, return an error message
9
+ return "Invalid input. Please enter a valid query."
10
  interface = gr. Interface (
11
  fn=ask_dailywellness,
12
  inputs=gr.Textbox(lines=2, label="Ask DailyWellnessAI"),