Update app.py
Browse files
app.py
CHANGED
@@ -56,16 +56,17 @@ class cbfs:
|
|
56 |
#return result.get('output_text', "No response generated.")
|
57 |
|
58 |
def convchain(self, query):
|
59 |
-
|
60 |
-
|
61 |
try:
|
62 |
result = self.chain.invoke({"input": query})
|
63 |
-
print("Agent Result:", result)
|
64 |
-
|
65 |
-
|
66 |
return f"Error: {str(e)}"
|
67 |
|
68 |
|
|
|
69 |
# Create an instance of the agent
|
70 |
cb = cbfs(tools)
|
71 |
|
|
|
56 |
#return result.get('output_text', "No response generated.")
|
57 |
|
58 |
def convchain(self, query):
|
59 |
+
if not query:
|
60 |
+
return "Please enter a query."
|
61 |
try:
|
62 |
result = self.chain.invoke({"input": query})
|
63 |
+
print("Agent Result:", result) # Debugging line
|
64 |
+
return result.get('output_text', "No response generated.")
|
65 |
+
except Exception as e:
|
66 |
return f"Error: {str(e)}"
|
67 |
|
68 |
|
69 |
+
|
70 |
# Create an instance of the agent
|
71 |
cb = cbfs(tools)
|
72 |
|