Spaces:
Sleeping
Sleeping
ernani
commited on
Commit
·
842a856
1
Parent(s):
fb72cf5
updating app call request parameters
Browse files
app.py
CHANGED
|
@@ -18,10 +18,10 @@ class SearchAgent:
|
|
| 18 |
self.agent = MainAgent()
|
| 19 |
print("SearchAgent initialized with MainAgent.")
|
| 20 |
|
| 21 |
-
def __call__(self, question: str) -> str:
|
| 22 |
print(f"Processing question: {question[:100]}...")
|
| 23 |
try:
|
| 24 |
-
answer = self.agent.process_question(question)
|
| 25 |
print(f"Answer generated: {answer[:100]}...")
|
| 26 |
return answer
|
| 27 |
except Exception as e:
|
|
@@ -86,11 +86,12 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
| 86 |
for item in questions_data:
|
| 87 |
task_id = item.get("task_id")
|
| 88 |
question_text = item.get("question")
|
|
|
|
| 89 |
if not task_id or question_text is None:
|
| 90 |
print(f"Skipping item with missing task_id or question: {item}")
|
| 91 |
continue
|
| 92 |
try:
|
| 93 |
-
submitted_answer = agent(question_text)
|
| 94 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
| 95 |
results_log.append({
|
| 96 |
"Task ID": task_id,
|
|
|
|
| 18 |
self.agent = MainAgent()
|
| 19 |
print("SearchAgent initialized with MainAgent.")
|
| 20 |
|
| 21 |
+
def __call__(self, task_id: str, question: str, file_name: str = "") -> str:
|
| 22 |
print(f"Processing question: {question[:100]}...")
|
| 23 |
try:
|
| 24 |
+
answer = self.agent.process_question(task_id, question, file_name)
|
| 25 |
print(f"Answer generated: {answer[:100]}...")
|
| 26 |
return answer
|
| 27 |
except Exception as e:
|
|
|
|
| 86 |
for item in questions_data:
|
| 87 |
task_id = item.get("task_id")
|
| 88 |
question_text = item.get("question")
|
| 89 |
+
file_name = item.get("file_name")
|
| 90 |
if not task_id or question_text is None:
|
| 91 |
print(f"Skipping item with missing task_id or question: {item}")
|
| 92 |
continue
|
| 93 |
try:
|
| 94 |
+
submitted_answer = agent(task_id, question_text, file_name)
|
| 95 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
| 96 |
results_log.append({
|
| 97 |
"Task ID": task_id,
|