sebastianfrench commited on
Commit
494f954
·
1 Parent(s): 527eec5

feat: add json with the questions

Browse files
Files changed (2) hide show
  1. agents/search_agent.py +3 -16
  2. app.py +1 -2
agents/search_agent.py CHANGED
@@ -2,6 +2,8 @@ from graphs.evaluation import build_workflow
2
  from langchain_core.messages import HumanMessage, SystemMessage
3
  from langfuse.callback import CallbackHandler
4
  from dotenv import load_dotenv
 
 
5
  load_dotenv()
6
  langfuse_handler = CallbackHandler(host="https://cloud.langfuse.com")
7
 
@@ -25,19 +27,4 @@ class SearchAgent:
25
  }, config={"callbacks": [langfuse_handler]})
26
 
27
  return state["answer"]
28
-
29
- if __name__ == "__main__":
30
- #question = "In the video https://www.youtube.com/watch?v=L1vXCYZAYYM, what is the highest number of bird species to be on camera simultaneously?"
31
- #question = """How many studio albums were published by Mercedes Sosa between 2000 and 2009 (included)? You can use the latest 2022 version of english wikipedia."""
32
- #question = """Examine the video at https://www.youtube.com/watch?v=1htKBjuUWec.
33
- task_id = "f918266a-b3e0-4914-865d-4faa564f1aef"
34
- question_text = "What is the final numeric output from the attached Python code?"
35
- file_url = f"https://agents-course-unit4-scoring.hf.space/files/{task_id}"
36
- question_with_file_info = f"For this task there is file available, with name {task_id}, download it from {file_url}\n\n{question_text}"
37
-
38
-
39
- #What does Teal'c say in response to the question "Isn't that hot?"""
40
- agent = SearchAgent()
41
- submit_answer = agent(question_with_file_info)
42
-
43
- print(submit_answer)
 
2
  from langchain_core.messages import HumanMessage, SystemMessage
3
  from langfuse.callback import CallbackHandler
4
  from dotenv import load_dotenv
5
+ import json
6
+
7
  load_dotenv()
8
  langfuse_handler = CallbackHandler(host="https://cloud.langfuse.com")
9
 
 
27
  }, config={"callbacks": [langfuse_handler]})
28
 
29
  return state["answer"]
30
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app.py CHANGED
@@ -42,9 +42,8 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
42
  print(f"Fetching questions from questions.json")
43
  try:
44
  with open("questions.json", "r") as file:
45
- d = json.load(file)
46
 
47
- questions_data = d.get("questions", [])
48
  if not questions_data:
49
  print("Fetched questions list is empty.")
50
  return "Fetched questions list is empty or invalid format.", None
 
42
  print(f"Fetching questions from questions.json")
43
  try:
44
  with open("questions.json", "r") as file:
45
+ questions_data = json.load(file)
46
 
 
47
  if not questions_data:
48
  print("Fetched questions list is empty.")
49
  return "Fetched questions list is empty or invalid format.", None