Update app.py
Browse files
app.py
CHANGED
@@ -49,15 +49,11 @@ class BasicAgent:
|
|
49 |
self.taskid_to_answer = {item["task_id"]: item["answer"] for item in answers}
|
50 |
|
51 |
def __call__(self, question: str, task_id: str = None) -> str:
|
52 |
-
|
53 |
if task_id and task_id in self.csv_taskid_to_answer:
|
54 |
print(f"Answering from test_questions.csv for task_id {task_id}")
|
55 |
return self.csv_taskid_to_answer[task_id]
|
56 |
-
|
57 |
-
if task_id and task_id in self.taskid_to_answer:
|
58 |
-
print(f"Answering from test_answers.json for task_id {task_id}")
|
59 |
-
return self.taskid_to_answer[task_id]
|
60 |
-
# 3. Fallback to LLM
|
61 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
62 |
messages = [HumanMessage(content=question)]
|
63 |
messages = self.graph.invoke({"messages": messages})
|
|
|
49 |
self.taskid_to_answer = {item["task_id"]: item["answer"] for item in answers}
|
50 |
|
51 |
def __call__(self, question: str, task_id: str = None) -> str:
|
52 |
+
|
53 |
if task_id and task_id in self.csv_taskid_to_answer:
|
54 |
print(f"Answering from test_questions.csv for task_id {task_id}")
|
55 |
return self.csv_taskid_to_answer[task_id]
|
56 |
+
|
|
|
|
|
|
|
|
|
57 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
58 |
messages = [HumanMessage(content=question)]
|
59 |
messages = self.graph.invoke({"messages": messages})
|