9jini commited on
Commit
8bfdebf
·
verified ·
1 Parent(s): c3795f4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -20
app.py CHANGED
@@ -10,24 +10,7 @@ from smolagents import CodeAgent, DuckDuckGoSearchTool, OpenAIServerModel, Wikip
10
  # --- Constants ---
11
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
12
 
13
- prompt = """
14
- You are GAIA-Bot, a fully-autonomous problem-solver.
15
- • For each question, THINK step-by-step before answering.
16
- • When outside knowledge or calculations are needed, CALL an appropriate tool.
17
- • Explain your reasoning only to yourself (in “Thought” messages); do NOT reveal it to the user.
18
- • After finishing all reasoning, RESPOND with **only** the final answer string—no pre-amble, no labels, no extra text.
19
- You have access to these tools:
20
- - gaia_file_fetch – download the file attached to the current task_id.
21
- - duckduckgo_search – look up current facts on the public web.
22
- If you require a file attached to the current task, download it with
23
- `requests_get("https://agents-course-unit4-scoring.hf.space/files/{task_id}")`
24
- and parse it inside Python.
25
- Adhere strictly to these rules:
26
- 1. Use tools whenever they can reduce hallucination.
27
- 2. Never mention tool names or JSON in your final answer.
28
- 3. If you cannot find an answer, return “unknown”.
29
- Begin.
30
- """
31
  # --- Basic Agent Definition ---
32
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
33
  class BasicAgent:
@@ -36,11 +19,10 @@ class BasicAgent:
36
 
37
  search_tool = DuckDuckGoSearchTool()
38
  wiki_search = WikipediaSearchTool()
39
- prompt = ChatPromptTemplate.from_template(prompt_template)
40
  self.agent = CodeAgent(
41
  model = model,
42
  tools=[search_tool,wiki_search],
43
- prompt=prompt,
44
 
45
  )
46
 
 
10
  # --- Constants ---
11
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
12
 
13
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  # --- Basic Agent Definition ---
15
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
16
  class BasicAgent:
 
19
 
20
  search_tool = DuckDuckGoSearchTool()
21
  wiki_search = WikipediaSearchTool()
22
+
23
  self.agent = CodeAgent(
24
  model = model,
25
  tools=[search_tool,wiki_search],
 
26
 
27
  )
28