Spaces:
Runtime error
Runtime error
Update agent.py
Browse files
agent.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import requests
|
2 |
from typing import Dict
|
3 |
-
from retriever import
|
4 |
from tools import clean_answer_with_prompt, build_prompt
|
5 |
from transformers import pipeline
|
6 |
|
@@ -19,7 +19,7 @@ def run_agent_on_question(task: Dict) -> str:
|
|
19 |
file_name = task.get('file_name', '')
|
20 |
|
21 |
# Step 1: Retrieve relevant context (as list of strings)
|
22 |
-
context_list =
|
23 |
context = "\n".join(context_list)
|
24 |
|
25 |
# Step 2: Build a prompt using system instruction + context + question
|
|
|
1 |
import requests
|
2 |
from typing import Dict
|
3 |
+
from retriever import retrieve_relevant_context
|
4 |
from tools import clean_answer_with_prompt, build_prompt
|
5 |
from transformers import pipeline
|
6 |
|
|
|
19 |
file_name = task.get('file_name', '')
|
20 |
|
21 |
# Step 1: Retrieve relevant context (as list of strings)
|
22 |
+
context_list = retrieve_relevant_context(task_id, question)
|
23 |
context = "\n".join(context_list)
|
24 |
|
25 |
# Step 2: Build a prompt using system instruction + context + question
|