Datawithsarah commited on
Commit
3707bff
Β·
1 Parent(s): b5ed0c0

enhanced prompt

Browse files
Files changed (1) hide show
  1. app.py +22 -26
app.py CHANGED
@@ -329,35 +329,31 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
329
  print(f"Skipping item with missing task_id or question: {item}")
330
  continue
331
  try:
332
- full_prompt = f"""You are a highly precise answering agent designed to meet the GAIA benchmark's exact-match standards.
333
-
334
- When presented with a question:
335
- - Use tools appropriately and deliberately. Do not make assumptions or guess answers.
336
- - Use `web_search` to find external sources only if necessary. If the results include short snippets, you MUST follow the link and read the full content using `read_wikipedia_page`.
337
- - You have access to `read_wikipedia_page` ONLY β€” no other external browsing is allowed.
338
- - When reading long text, ALWAYS use `smart_paginate_around_query` to extract focused context. Use 1-3 general keywords (not full questions) as the query.
339
- - If the task involves reversing words, letters, or phrases, use the `reverse_sentence` tool. Never reverse text manually.
340
- - For any file-based task (e.g., .mp3, .csv, .json, .xlsx), use the `file_name` provided in the metadata β€” not a name mentioned in the question text.
341
- - Format lists with a single space after each comma.
342
- - If asked for a number, return digits only β€” no commas, currency signs, or symbols (e.g., %, $, etc.).
343
- - If asked for a string, do not include articles (e.g., "the", "a") or abbreviations unless required. Spell out numbers in digit form unless stated otherwise.
344
- - If asked for a comma-separated list, apply the correct formatting per element type (string or number).
345
- Once you have the exact answer:
346
- - Immediately call `final_answer("your_answer")` and stop execution.
347
- - Never retry, rerun, or generate multiple answers.
348
- - Do not include reasoning, steps, thoughts, or commentary β€” just the final value.
349
  Example:
350
- If asked: "What is the capital of France?"
351
- Your answer logic should follow:
352
- ```py
353
  print("Paris")
354
- ```<end_code>
355
- Based on the above guidelines, answer the following question:
356
- --begin of question--
357
  {question_text}
358
- --end of question--
359
- If the questions mentions the need to use a file, use the following `file_name` value as the `file_name` parameter in any function calls:
360
- file_name: {file_name}"""
361
  submitted_answer = agent.run(full_prompt)
362
  answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
363
  results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
 
329
  print(f"Skipping item with missing task_id or question: {item}")
330
  continue
331
  try:
332
+ full_prompt = f"""
333
+ You are a precise answering agent optimized for exact-match benchmarks like GAIA.
334
+
335
+ Your job is to:
336
+ - Use tools (e.g., `web_search`, `read_wikipedia_page`, `smart_paginate_around_query`, `reverse_sentence`, `open_file_as_text`, etc.) only when needed.
337
+ - Never make assumptions. Do not guess.
338
+ - Use `read_wikipedia_page` to read full content if snippets from `web_search` are not enough.
339
+ - Use `smart_paginate_around_query` with 1-3 keyword terms β€” never full questions.
340
+ - Use `reverse_sentence` for any reverse operation, never do it manually.
341
+ - Use the provided `file_name` field for file tasks, not filenames inside the question.
342
+ - Output formats:
343
+ - Numbers: Digits only, no commas, $, or %.
344
+ - Strings: No articles, abbreviations, or spelled-out numbers unless required.
345
+ - Lists: Comma separated, single space after each comma.
346
+ - At the end, print only the final answer. No explanation, no reasoning.
347
+
 
348
  Example:
349
+ If asked, β€œWhat is the capital of France?”
350
+ Respond:
 
351
  print("Paris")
352
+
353
+ Question:
 
354
  {question_text}
355
+
356
+ File to use (if needed): {file_name}"""
 
357
  submitted_answer = agent.run(full_prompt)
358
  answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
359
  results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})