Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,7 @@ import requests
|
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
from agent import agent_executor
|
|
|
|
| 7 |
|
| 8 |
# (Keep Constants as is)
|
| 9 |
# --- Constants ---
|
|
@@ -17,14 +18,12 @@ class BasicAgent:
|
|
| 17 |
|
| 18 |
def __call__(self, question: str) -> str:
|
| 19 |
try:
|
| 20 |
-
from langchain_core.messages import HumanMessage
|
| 21 |
result = agent_executor.invoke({"messages": [HumanMessage(content=question)]})
|
| 22 |
answer = result["messages"][-1].content
|
| 23 |
return answer.strip()
|
| 24 |
except Exception as e:
|
| 25 |
print(f"Agent error: {e}")
|
| 26 |
-
return "I don't know.
|
| 27 |
-
|
| 28 |
|
| 29 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
| 30 |
"""
|
|
|
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
from agent import agent_executor
|
| 7 |
+
from langchain_core.messages import HumanMessage
|
| 8 |
|
| 9 |
# (Keep Constants as is)
|
| 10 |
# --- Constants ---
|
|
|
|
| 18 |
|
| 19 |
def __call__(self, question: str) -> str:
|
| 20 |
try:
|
|
|
|
| 21 |
result = agent_executor.invoke({"messages": [HumanMessage(content=question)]})
|
| 22 |
answer = result["messages"][-1].content
|
| 23 |
return answer.strip()
|
| 24 |
except Exception as e:
|
| 25 |
print(f"Agent error: {e}")
|
| 26 |
+
return "I don't know."
|
|
|
|
| 27 |
|
| 28 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
| 29 |
"""
|