skkjodhpur commited on
Commit
a375160
·
verified ·
1 Parent(s): 7a7686b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -51,8 +51,14 @@ def search(query):
51
  "tool_names": ", ".join([tool.name for tool in tools]),
52
  "intermediate_steps": [] # Initial empty intermediate steps
53
  }
54
- output = agent.invoke(inputs)
55
- return output
 
 
 
 
 
 
56
 
57
  # Create the Gradio interface
58
  iface = gr.Interface(
 
51
  "tool_names": ", ".join([tool.name for tool in tools]),
52
  "intermediate_steps": [] # Initial empty intermediate steps
53
  }
54
+ try:
55
+ output = agent.invoke(inputs)
56
+ return output
57
+ except Exception as e:
58
+ # Print the exception and the inputs for debugging
59
+ print(f"Error: {e}")
60
+ print("Inputs:", inputs)
61
+ return str(e)
62
 
63
  # Create the Gradio interface
64
  iface = gr.Interface(