remove print()in prompt, remove the PIL and CV2.
Browse files
app.py
CHANGED
|
@@ -163,10 +163,7 @@ class BasicAgent:
|
|
| 163 |
You may freely think, reason, and use tools or your own knowledge as needed to solve the problem.
|
| 164 |
|
| 165 |
IMPORTANT OUTPUT INSTRUCTIONS:
|
| 166 |
-
|
| 167 |
-
- For example: print("Qxf7") or print("42") or print("unknown")
|
| 168 |
-
- DO NOT just write the answer as a standalone variable
|
| 169 |
-
- If you cannot solve the problem, use: print("unknown")
|
| 170 |
|
| 171 |
Answer format requirements:
|
| 172 |
- If the answer is a number, output only the number (no units, no commas)
|
|
@@ -180,13 +177,10 @@ class BasicAgent:
|
|
| 180 |
files_prompt = f"\n[You have the following attached files available: {', '.join(files)}]\n"
|
| 181 |
# 添加文件处理指导
|
| 182 |
files_prompt += """
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
4. Consider using OCR libraries if there's text in the image
|
| 188 |
-
"""
|
| 189 |
-
|
| 190 |
full_question = system_prompt + files_prompt + "\n\n" + question
|
| 191 |
return self.agent.run(full_question)
|
| 192 |
except Exception as e:
|
|
|
|
| 163 |
You may freely think, reason, and use tools or your own knowledge as needed to solve the problem.
|
| 164 |
|
| 165 |
IMPORTANT OUTPUT INSTRUCTIONS:
|
| 166 |
+
When you need to return your final answer, just output the answer directly
|
|
|
|
|
|
|
|
|
|
| 167 |
|
| 168 |
Answer format requirements:
|
| 169 |
- If the answer is a number, output only the number (no units, no commas)
|
|
|
|
| 177 |
files_prompt = f"\n[You have the following attached files available: {', '.join(files)}]\n"
|
| 178 |
# 添加文件处理指导
|
| 179 |
files_prompt += """
|
| 180 |
+
Note: PIL and cv2 imports are restricted in this environment.
|
| 181 |
+
You can use your analyze_media_file tool to get information about images.
|
| 182 |
+
For chess positions, try to use available tools or reasoning to solve the puzzle.
|
| 183 |
+
"""
|
|
|
|
|
|
|
|
|
|
| 184 |
full_question = system_prompt + files_prompt + "\n\n" + question
|
| 185 |
return self.agent.run(full_question)
|
| 186 |
except Exception as e:
|