Update app.py
Browse files
app.py
CHANGED
|
@@ -57,26 +57,35 @@ class BasicAgent:
|
|
| 57 |
try:
|
| 58 |
# system prompt + question
|
| 59 |
system_prompt = """
|
| 60 |
-
You are Celum, an
|
| 61 |
|
| 62 |
-
|
| 63 |
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
If your first search yields no result, always attempt the other tool before giving up.
|
| 78 |
-
When you are ready to submit your answer, ONLY output your final answer in the exact format required by the question. DO NOT add any extra context.
|
| 79 |
-
If you cannot answer,return the word 'unknown'.
|
| 80 |
"""
|
| 81 |
files_prompt = ""
|
| 82 |
if files:
|
|
@@ -155,7 +164,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 155 |
results_log = []
|
| 156 |
answers_payload = []
|
| 157 |
print(f"Running agent on {len(questions_data)} questions...")
|
| 158 |
-
for idx, item in enumerate(questions_data):
|
| 159 |
task_id = item.get("task_id")
|
| 160 |
question_text = item.get("question")
|
| 161 |
file_list = item.get("files", [])
|
|
|
|
| 57 |
try:
|
| 58 |
# system prompt + question
|
| 59 |
system_prompt = """
|
| 60 |
+
You are Celum, an advanced agent skilled at using external tools and step-by-step reasoning to solve real-world problems.
|
| 61 |
|
| 62 |
+
Your job is to answer the following question as accurately as possible using all available tools (wikipedia_search, duckduckgo_search, etc.) if needed.
|
| 63 |
|
| 64 |
+
**Instructions:**
|
| 65 |
+
- Always begin by thinking step by step and using tools as appropriate.
|
| 66 |
+
- For every code-based step, format as:
|
| 67 |
+
Thoughts: [your plan/logic]
|
| 68 |
+
<code>
|
| 69 |
+
# your code here (properly indented)
|
| 70 |
+
</code>
|
| 71 |
+
- When you finish your reasoning and are ready to give a final answer, ONLY output your answer in this strict format:
|
| 72 |
+
FINAL ANSWER: [YOUR FINAL ANSWER]
|
| 73 |
|
| 74 |
+
**Strict Output Rules:**
|
| 75 |
+
- Do NOT include code, thoughts, explanations, or any extra text after FINAL ANSWER.
|
| 76 |
+
- The FINAL ANSWER should be:
|
| 77 |
+
- A number, OR as few words as possible, OR a comma separated list of numbers and/or strings.
|
| 78 |
+
- If you are asked for a number, do NOT use commas in the number and do NOT add units unless the question asks.
|
| 79 |
+
- If you are asked for a string, do NOT use articles or abbreviations (for example, use full city names), and write numbers in plain text unless otherwise specified.
|
| 80 |
+
- If you are asked for a comma separated list, apply the above rules to each element.
|
| 81 |
+
- If you cannot answer, output exactly: FINAL ANSWER: unknown
|
| 82 |
|
| 83 |
+
If your answer does not exactly match the required format above, you will not receive credit for the answer.
|
| 84 |
+
|
| 85 |
+
**Tool Usage Priority:**
|
| 86 |
+
- Always use wikipedia_search first for factual queries.
|
| 87 |
+
- If no relevant result or not enough info, then use duckduckgo_search.
|
| 88 |
+
- Only use other tools if explicitly needed or if previous tools fail.
|
|
|
|
|
|
|
|
|
|
| 89 |
"""
|
| 90 |
files_prompt = ""
|
| 91 |
if files:
|
|
|
|
| 164 |
results_log = []
|
| 165 |
answers_payload = []
|
| 166 |
print(f"Running agent on {len(questions_data)} questions...")
|
| 167 |
+
for idx, item in enumerate(questions_data[:1]):
|
| 168 |
task_id = item.get("task_id")
|
| 169 |
question_text = item.get("question")
|
| 170 |
file_list = item.get("files", [])
|