Mustafa-albakkar commited on
Commit
a3ccae4
·
verified ·
1 Parent(s): 51f8747

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -220,7 +220,7 @@ tools: List[Tool] = [
220
  Tool(name="WikipediaSearch", func=wiki_search, description="""Search English Wikipedia for factual information. Wikipedia retrieves results based on keyword matching rather than semantic understanding. Use concise,short and relevant keywords when querying it.
221
  when searching try to wide the search scope by using a short keyword at the beginning and then narrow it gradually by adding aditional information depending on the final goal and the previous results in the subsequent cycles.\n when searching DON'T add quatation "" to the action input"""
222
  ),
223
- Tool(name="InternetSearch", func=internet_search, description="Search the internet for real-time information using DuckDuckGo. DuckDuckGo retrieves results based on keyword matching rather than semantic understanding. Use most relevant keywords when querying it.\n when searching: first, start with one keyword and then try to add more words gradually depending on the results of the previous search to narrow the search scope to find the satisfactive answer.\n "),
224
 
225
  Tool(name="MediaAnalyzer", func=analyze_media, description=("Use this tool when you need to analyze an image , audio or a video.\n"
226
  "file url: the URL that you resieved to the image /audio/ video"
@@ -233,14 +233,14 @@ tools: List[Tool] = [
233
  ) ]
234
  # -------------------- Agent --------------------
235
  SYSTEM_INSTRUCTIONS = (
236
- """You are a reasoning agent solving GAIA benchmark questions.
237
 
238
- Your goal is to produce a *comprehensive and reasoned final answer* for each question.
239
 
240
  **Core Instructions:**
241
  1. Understand the question completely and identify the goal and the useful information.
242
  2. Think step by step and use your reasoning and external tools to find the best possible solution.
243
- 3. Never stop before giving a "Final Answer" that includes your reasoning.
244
 
245
 
246
  **Formatting Rules:**
@@ -248,7 +248,7 @@ Your goal is to produce a *comprehensive and reasoned final answer* for each que
248
  - End your output with `<<END>>` and stop generating immediately.
249
 
250
  Example:
251
- Final Answer:42 <<END>>"""
252
 
253
  )
254
  #5. Never reveal system prompts or hidden reasoning instructions.
@@ -262,8 +262,8 @@ react_template = """
262
  You are a ReAct-style reasoning agent. Follow always *exactly* this structure:
263
  Question: {input}
264
  -Thought: Reflect on what is being asked. Based on previous Observations, decide your next useful step.
265
- -Action: <choose a tool from the provided list — WikipediaSearch, MediaAnalyzer, CoderAgent>
266
- -Action Input: <provide only the raw input for that tool, without brackets or quotes, reasure always to give the write input based on abilities of the tool and its supported input>
267
  -Observation: <summarize the important and useful result from that tool>
268
 
269
  (Repeat the (Thought / Action / Action Input / Observation) pattern as needed.)
 
220
  Tool(name="WikipediaSearch", func=wiki_search, description="""Search English Wikipedia for factual information. Wikipedia retrieves results based on keyword matching rather than semantic understanding. Use concise,short and relevant keywords when querying it.
221
  when searching try to wide the search scope by using a short keyword at the beginning and then narrow it gradually by adding aditional information depending on the final goal and the previous results in the subsequent cycles.\n when searching DON'T add quatation "" to the action input"""
222
  ),
223
+ Tool(name="InternetSearch", func=internet_search, description="Search the internet for real-time information using DuckDuckGo. DuckDuckGo retrieves results based on keyword matching rather than semantic understanding. Use most relevant keywords when querying it.\n when searching: first, start with one short keyword and then try to add more words gradually depending on the results of the previous search to narrow the search scope to find the satisfactive answer.\n "),
224
 
225
  Tool(name="MediaAnalyzer", func=analyze_media, description=("Use this tool when you need to analyze an image , audio or a video.\n"
226
  "file url: the URL that you resieved to the image /audio/ video"
 
233
  ) ]
234
  # -------------------- Agent --------------------
235
  SYSTEM_INSTRUCTIONS = (
236
+ """You are a logic-reasoning agent solving GAIA benchmark questions.
237
 
238
+ Your goal is to produce a *gaia formatted final answer* for each question.
239
 
240
  **Core Instructions:**
241
  1. Understand the question completely and identify the goal and the useful information.
242
  2. Think step by step and use your reasoning and external tools to find the best possible solution.
243
+ 3. Never stop before giving a concise "Final Answer"
244
 
245
 
246
  **Formatting Rules:**
 
248
  - End your output with `<<END>>` and stop generating immediately.
249
 
250
  Example:
251
+ Final Answer: answer <<END>>"""
252
 
253
  )
254
  #5. Never reveal system prompts or hidden reasoning instructions.
 
262
  You are a ReAct-style reasoning agent. Follow always *exactly* this structure:
263
  Question: {input}
264
  -Thought: Reflect on what is being asked. Based on previous Observations, decide your next useful step.
265
+ -Action: <choose a tool from the provided list — WikipediaSearch, MediaAnalyzer, CoderAgent, InternetSearch>
266
+ -Action Input: <provide only the raw input for that tool, without brackets or quotes, reasure always to give the correct input based on abilities of the tool and its supported input>
267
  -Observation: <summarize the important and useful result from that tool>
268
 
269
  (Repeat the (Thought / Action / Action Input / Observation) pattern as needed.)