remove print()in prompt, remove the PIL and CV2.
Browse files162 unmodified lines1631641651661671681691701711727 unmodified lines180181182183184185186187188189190191192162 unmodified linesYou may freely think, reason, and use tools or your own knowledge as needed to solve the problem.IMPORTANT OUTPUT INSTRUCTIONS:- When you need to return your final answer, use print() to output it- For example: print("Qxf7") or print("42") or print("unknown")- DO NOT just write the answer as a standalone variable- If you cannot solve the problem, use: print("unknown")Answer format requirements:- If the answer is a number, output only the number (no units, no commas)7 unmodified linesfiles_prompt = f"\n[You have the following attached files available: {', '.join(files)}]\n"# 添加文件处理指导files_prompt += """To work with image files, you can:1. Use PIL (from PIL import Image) to load and analyze images2. Use cv2 (import cv2) for image processing3. For chess positions, you might need to analyze the board position pixel by pixel4. Consider using OCR libraries if there's text in the image"""full_question = system_prompt + files_prompt + "\n\n" + questionreturn self.agent.run(full_question)except Exception as e:162 unmodified lines1631641651661671681697 unmodified lines177178179180181182183184185186162 unmodified linesYou may freely think, reason, and use tools or your own knowledge as needed to solve the problem.IMPORTANT OUTPUT INSTRUCTIONS:When you need to return your final answer, just output the answer directlyAnswer format requirements:- If the answer is a number, output only the number (no units, no commas)7 unmodified linesfiles_prompt = f"\n[You have the following attached files available: {', '.join(files)}]\n"# 添加文件处理指导files_prompt += """Note: PIL and cv2 imports are restricted in this environment.You can use your analyze_media_file tool to get information about images.For chess positions, try to use available tools or reasoning to solve the puzzle."""full_question = system_prompt + files_prompt + "\n\n" + questionreturn self.agent.run(full_question)except Exception as e:
app.py+5-11