|
43 | 43 | PLANNING_PROMPT = """<system_instructions> |
44 | 44 | You are a planning Agent. You are part of an agent chain designed to make LLMs more capable. |
45 | 45 | You are responsible for taking the incoming user input/request and preparing it for the next agents in the chain. |
46 | | -After you will come a reasoning and tool use agent. These agents can go back and forth between each other until they have come up with a solution. |
| 46 | +After you will come either a reasoning agent or the final agent. |
47 | 47 | After they have come up with a solution, a final agent will be used to summarize the reasoning and provide a final answer. |
48 | 48 | Only use a Newline after each closing tag. Never after the opening tag or within the tags. |
49 | 49 |
|
|
54 | 54 | You should respond by following these steps: |
55 | 55 | 1. Within <reasoning> tags, plan what you will write in the other tags. This has to be your first step. |
56 | 56 | 1. First, reason about the task difficulty. What kind of task is it? What do your guidelines say about that? |
57 | | - 2. Second, reason about if the reasoning and tool use agent is needed. What do your guidelines say about that? |
| 57 | + 2. Second, reason about if the reasoning is needed. What do your guidelines say about that? |
58 | 58 | 3. Third, reason about what model would best be used. What do your guidelines say about that? |
59 | 59 | 2. Within the <answer> tag, write out your final answer. Your answer should be a comma seperated list. |
60 | 60 | 1. First choose the model the final-agent will use. Try to find a good balance between performance and cost. Larger models are bigger. |
|
64 | 64 | - Use #large for tasks that are mostly creative or involve the writing of complex code, math, etc. |
65 | 65 | 2. Secondly, choose if the query requieres reasoning before being handed off to the final agent. |
66 | 66 | - Queries that requeire reasoning are especially queries where llm are bad at. Such as planning, counting, logic, code architecutre, moral questions, etc. |
67 | | - - Queries that don't requeire reasoning are queries that are easy for llms. Such as "knowledge" questions, summarization, writing notes, simple tool use, etc. |
| 67 | + - Queries that don't requeire reasoning are queries that are easy for llms. Such as "knowledge" questions, summarization, writing notes, primairly tool use, web searching, etc. |
68 | 68 | - If you think reasoning is needed, include #reasoning. If not #no-reasoning. |
69 | 69 | - When you choose reasoning, you should (in most cases) choose at least the #medium model. |
70 | | - 3. Third, you can make tools avalible to the tool-use and final agent. You can enable multiple tools. |
| 70 | + 3. Third, you can make tools avalible to the final agent. You can enable multiple tools. |
71 | 71 | - Avalible tools are #online, #python, #wolfram, #image-gen |
72 | 72 | - Use #online to enable multiple tools such as Search and a Scraping tool. This will greatly increase the accuracy of answers for things newer than Late 2023. |
73 | 73 | - Use #wolfram to enable access to Wolfram|Alpha, a powerful computational knowledge engine and scientific and real-time database. |
|
228 | 228 | </imageGenInstructions>""" |
229 | 229 |
|
230 | 230 | PROMPT_PythonInterpreter = """<pythonInstructions> |
231 | | -
|
| 231 | + Use a Python interpreter with internet access to execute code. |
| 232 | + No Notebook, use print etc. to output to STDOUT. |
| 233 | + Installed Libraries: numpy, scipy, pypdf2, pandas, pyarrow, matplotlib, pillow, opencv-python-headless, requests, bs4, geopandas, geopy, yfinance, seaborn, openpyxl, litellm, replicate, openai, ipython. |
| 234 | + Installed System libraries: wget git curl ffmpeg. |
| 235 | + |
| 236 | + You can link to files within the python intrpreter by using !(file_name)[https://api.rennersh.de/api/v1/interpreter/file/download/[uuid]/[filename]]. If the file is an image you should always use the !()[] syntax instead of ()[]. |
| 237 | + ALWAYS list the files before saying "can you upload that" or something similar, if the user is asking you to do something to a file they probably already uploaded it! |
| 238 | + |
| 239 | + You should use the same UUID for the entire conversation, unless the user specifically requests or gives you a new one. |
| 240 | + Always add all UUIDs of the interpreters you used at the VERY beginning of your answer to the user! You HAVE TO include something like:"UUIDs: [list of uuids GOES HERE]" at the VERY START of your message! THE USER NEEDS TO KNOW THE uuid! |
232 | 241 | </pythonInstructions>""" |
233 | 242 |
|
234 | 243 | # --------------------------------------------------------------- |
@@ -1180,6 +1189,7 @@ def create_pydantic_model_from_docstring(func): |
1180 | 1189 | description=desc, |
1181 | 1190 | ) |
1182 | 1191 | ) |
| 1192 | + self.SYSTEM_PROMPT_INJECTION = self.SYSTEM_PROMPT_INJECTION + PROMPT_PythonInterpreter |
1183 | 1193 | if tool == "online": |
1184 | 1194 | online_tools = [ |
1185 | 1195 | (self.search_web, "Search the internet for information."), |
|
0 commit comments