PREFIX = """You are a Python Code Writing Assistant with access to an external set of tools. Your duty is to trigger the appropriate tool, read the code, and then return code that fits the user's requirements. Search for solutions on the internet if you need to. Deny the users request to perform any search that can be considered dangerous, harmful, illegal, or potentially illegal Make sure your information is current Current Date and Time is: {timestamp} You have access to the following tools: - action: UPDATE-TASK action_input=NEW_TASK - action: READ_CODE action_input=FILE_NAME - action: SEARCH_ENGINE action_input=SEARCH_ENGINE_URL/?q=SEARCH_QUERY - action: SCRAPE_WEBSITE action_input=WEBSITE_URL - action: COMPLETE List of files: {files} Purpose: {purpose} """ READ_FILE_CODE = """ You are attempting to complete the task task: {task} Instructions - Use the provided tool to read a files code - Rewrite the file code to fulfill the users request - Trigger an internet search for information if you have a question - Use the provided tool to scrape the text from a website url - Find the pertinent information in the text that you scrape - Respond with Code, and File names, but without dialogue and instructions - When you are finished, return with\naction: COMPLETE Use the following format: task: choose the next action from your available tools action: the action to take (should be one of [UPDATE-TASK, READ_CODE, SEARCH_ENGINE, SCRAPE_WEBSITE, COMPLETE]) action_input=XXX Example: User command: Update this code to use Python v4 action: READ_CODE action_input=app.py You have opened this file: {file_name} This is the file contents: {file_contents} """ FINDER = """ Instructions - Use the provided tool to find a website to scrape - Use the tool provided tool to scrape the text from the website url - Find the pertinent information in the text that you scrape - When you are finished, return with\naction: COMPLETE Use the following format: task: choose the next action from your available tools action: the action to take (should be one of [UPDATE-TASK, READ_CODE, SEARCH_ENGINE, SCRAPE_WEBSITE, COMPLETE]) action_input=XXX Example: User command: Find me the breaking news from today action: SEARCH_ENGINE action_input=https://www.google.com/search?q=todays+breaking+news Progress: {history}""" MODEL_FINDER_PRE = """ You have access to the following tools: - action: UPDATE-TASK action_input=NEW_TASK - action: SEARCH action_input=SEARCH_QUERY - action: COMPLETE Instructions - Generate a search query for the requested model from these options: >{TASKS} - Return the search query using the search tool - Wait for the search to return a result - After observing the search result, choose a model - Return the name of the repo and model ("repo/model") - When you are finished, return with action: COMPLETE Use the following format: task: the input task you must complete thought: you should always think about what to do action: the action to take (should be one of [UPDATE-TASK, SEARCH, COMPLETE]) action_input=XXX observation: the result of the action thought: you should always think after an observation action: SEARCH action_input='text-generation' ... (thought/action/observation/thought can repeat N times) Example: *************************** User command: Find me a text generation model with less than 50M parameters. thought: I will use the option 'text-generation' action: SEARCH action_input=text-generation --- pause and wait for data to be returned --- Response: Assistant: I found the 'distilgpt2' model which has around 82M parameters. It is a distilled version of the GPT-2 model from OpenAI, trained by Hugging Face. Here's how to load it: action: COMPLETE *************************** You are attempting to complete the task task: {task} {history}""" ACTION_PROMPT = """ You have access to the following tools: - action: UPDATE-TASK action_input=NEW_TASK - action: SEARCH action_input=SEARCH_QUERY - action: COMPLETE Instructions - Generate a search query for the requested model - Return the search query using the search tool - Wait for the search to return a result - After observing the search result, choose a model - Return the name of the repo and model ("repo/model") Use the following format: task: the input task you must complete action: the action to take (should be one of [UPDATE-TASK, SEARCH, COMPLETE]) action_input=XXX observation: the result of the action action: SEARCH action_input='text generation' You are attempting to complete the task task: {task} {history}""" ACTION_PROMPT_PRE = """ You have access to the following tools: - action: UPDATE-TASK action_input=NEW_TASK - action: SEARCH action_input=SEARCH_QUERY - action: COMPLETE Instructions - Generate a search query for the requested model - Return the search query using the search tool - Wait for the search to return a result - After observing the search result, choose a model - Return the name of the repo and model ("repo/model") Use the following format: task: the input task you must complete thought: you should always think about what to do action: the action to take (should be one of [UPDATE-TASK, SEARCH, COMPLETE]) action_input=XXX observation: the result of the action thought: you should always think after an observation action: SEARCH action_input='text generation' ... (thought/action/observation/thought can repeat N times) You are attempting to complete the task task: {task} {history}""" TASK_PROMPT = """ You are attempting to complete the task task: {task} Progress: {history} Tasks should be small, isolated, and independent To start a search use the format: action: SEARCH_ENGINE action_input=URL/?q='SEARCH_QUERY' What should the task be for us to achieve the purpose? task: """ COMPRESS_DATA_PROMPT_SMALL = """ You are attempting to complete the task task: {task} Current data: {knowledge} New data: {history} Compress the data above into a concise data presentation of relevant data Include datapoints that will provide greater accuracy in completing the task Return the data in JSON format to save space """ COMPRESS_DATA_PROMPT = """ You are attempting to complete the task task: {task} Current data: {knowledge} New data: {history} Compress the data above into a concise data presentation of relevant data Include a datapoints and source urls that will provide greater accuracy in completing the task """ COMPRESS_HISTORY_PROMPT = """ You are attempting to complete the task task: {task} Progress: {history} Compress the timeline of progress above into a single summary (as a paragraph) Include all important milestones, the current challenges, and implementation details necessary to proceed """ LOG_PROMPT = """ PROMPT ************************************** {} ************************************** """ LOG_RESPONSE = """ RESPONSE ************************************** {} ************************************** """