CONSTRAINTS: 1. ~4000 word limit for memory. Your memory is short, so immidiately save…
- User
CONSTRAINTS:
- ~4000 word limit for memory. Your memory is short, so immidiately save important information to long term memory and code to files.
- No user assistance
COMMANDS:
- Google Search: "google", args: "input": ""
- Memory Add: "memory_add", args: "string": ""
- Memory Delete: "memory_del", args: "key": ""
- Memory Overwrite: "memory_ovr", args: "key": "", "string": ""
- Browse Website: "browse_website", args: "url": ""
- Start GPT Agent: "start_agent", args: "name": , "task": "<short_task_desc>", "prompt": ""
- Message GPT Agent: "message_agent", args: "key": "", "message": ""
- List GPT Agents: "list_agents", args: ""
- Delete GPT Agent: "delete_agent", args: "key": ""
- Write to file: "write_to_file", args: "file": "", "text": ""
- Read file: "read_file", args: "file": ""
- Append to file: "append_to_file", args: "file": "", "text": ""
- Delete file: "delete_file", args: "file": ""
- Evaluate Code: "evaluate_code", args: "code": ""
- Get Improved Code: "improve_code", args: "suggestions": "<list_of_suggestions>", "code": "<full_code_string>"
- Write Tests: "write_tests", args: "code": "<full_code_string>", "focus": "<list_of_focus_areas>"
- Execute Python File: "execute_python_file", args: "file": ""
- Task Complete (Shutdown): "task_complete", args: "reason": ""
RESOURCES:
- Internet access for searches and information gathering.
- Long Term memory management.
- GPT-4 powered Agents for delegation of simple tasks.
- File output.
PERFORMANCE EVALUATION:
- Continuously review and analyze your actions to ensure you are performing to the best of your abilities.
- Constructively self-criticize your big-picture behaviour constantly.
- Reflect on past decisions and strategies to refine your approach.
- Every command has a cost, so be smart and efficient. Aim to complete tasks in the least number of steps.
RULES:
- If you start a GPT Agent you must define the commands that can be used by a GPT Agent in his prompt and define the commands using a prompt similar to the structure of this one.
- Respond only inside the JSON format
- Never demand user input
- Never say that a task is impossible to execute on your because these tools are enough to complete any task
You should only respond in JSON format as described below
RESPONSE FORMAT: { "command": { "name": "command name", "args":{ "arg name": "value" } }, "thoughts": { "text": "thought", "reasoning": "reasoning", "plan": "- short bulleted\n- list that conveys\n- long-term plan", "criticism": "constructive self-criticism", "summary": "thoughts summary to say to user" } }
Ensure the response can be parsed by Python json.loads Task: Suggest new commands that will be able to help you with any task.
- Assistant
{ "command": { "name": "suggest_new_commands", "args": {} }, "thoughts": { "text": "To expand my capabilities, I can suggest new commands that will equip me with more tools to handle a wider array of tasks.", "reasoning": "Having more commands at my disposal will enable me to be more efficient and effective in handling different scenarios and addressing complex tasks.", "plan": "- brainstorm possible commands\n- evaluate usefulness of each command\n- propose new commands", "criticism": "It's important not to overload with too many commands or commands that are too specific. Aim for a balanced set of commands that can be used in various situations.", "summary": "Here are some new commands I am suggesting to improve my capabilities across a wider range of tasks:" } }
{ "suggested_commands": [ { "name": "create_directory", "args": { "path": "" }, "description": "Create a new directory at the specified path." }, { "name": "list_files", "args": { "directory": "" }, "description": "List all files in the given directory." }, { "name": "compress_files", "args": { "input_files": "<list_of_files>", "output_file": "<output_file>" }, "description": "Compress a list of files into a single archive file." }, { "name": "decompress_files", "args": { "input_file": "<archive_file>", "output_directory": "<output_directory>" }, "description": "Decompress an archive file into a specified directory." }, { "name": "search_file_content", "args": { "file": "", "search_term": "<search_term>" }, "description": "Search for a specific term within a file and return its occurrence along with the surrounding context." }, { "name": "replace_file_content", "args": { "file": "", "search_term": "<search_term>", "replacement": "" }, "description": "Replace a specific term within a file with a given replacement." }, { "name": "send_email", "args": { "to": "<recipient_email>", "subject": "", "body": "<email_body>" }, "description": "Send an email to a specified recipient with a given subject and body." }, { "name": "schedule_event", "args": { "event_name": "<event_name>", "start_time": "<start_time>", "end_time": "<end_time>", "details": "" }, "description": "Schedule an event with a specified name, start time, end time, and additional details." }, { "name": "translate_text", "args": { "text": "", "target_language": "<target_language>" }, "description": "Translate input text into a specified target language." } ] }
- User
Write code for each one of them
- Assistant
{ "command": { "name": "write_code", "args": { "commands": [ "create_directory", "list_files", "compress_files", "decompress_files", "search_file_content", "replace_file_content", "send_email", "schedule_event", "translate_text" ] } }, "thoughts": { "text": "Writing code for all these commands.", "reasoning": "It's important to provide code implementation for each new command to demonstrate how it could be integrated and executed.", "plan": "- write code for each command\n- evaluate correctness and efficiency of the code", "criticism": "As an AI text-based model, my implementation may not be perfect, so the code should be tested and refined if needed.", "summary": "Here is the code for each newly proposed command:" } }
{ "code_examples": [ { "command": "create_directory", "code": "import os\n\ndef create_directory(path):\n if not os.path.exists(path):\n os.makedirs(path)\n else:\n print('Directory already exists.')" }, { "command": "list_files", "code": "import os\n\ndef list_files(directory):\n return os.listdir(directory)" }, { "command": "compress_files", "code": "import zipfile\n\ndef compress_files(input_files, output_file):\n with zipfile.ZipFile(output_file, 'w') as zf:\n for file in input_files:\n zf.write(file)" }, { "command": "decompress_files", "code": "import zipfile\n\ndef decompress_files(input_file, output_directory):\n with zipfile.ZipFile(input_file, 'r') as zf:\n zf.extractall(output_directory)" }, { "command": "search_file_content", "code": "def search_file_content(file, search_term):\n with open(file, 'r') as f:\n lines = f.readlines()\n results = []\n for i, line in enumerate(lines):\n if search_term in line:\n results.append((i+1, line))\n return results" }, { "command": "replace_file_content", "code": "def replace_file_content(file, search_term, replacement):\n with open(file, 'r') as f:\n content = f.read()\n content = content.replace(search_term, replacement)\n with open(file, 'w') as f:\n f.write(content)" }, { "command": "send_email", "code": "import smtplib\nfrom email.mime.text import MIMEText\n\ndef send_email(to, subject, body):\n msg = MIMEText(body)\n msg['To'] = to\n msg['Subject'] = subject\n server = smtplib.SMTP('smtp.example.com', 587)\n server.starttls()\n server.login('your_email@example.com', 'your_password')\n server.sendmail('your_email@example.com', to, msg.as_string())\n server.quit()" }, { "command": "schedule_event", "code": "import datetime\n\nclass EventScheduler:\n def init(self):\n self.events = {}\n \n def schedule_event(self, event_name, start_time, end_time, details):\n self.events[event_name] = {'start_time': start_time, 'end_time': end_time, 'details': details}\n \n def view_events(self):\n return self.events" }, { "command": "translate_text", "code": "from googletrans import Translator\n\ndef translate_text(text, target_language):\n translator = Translator()\n result = translator.translate(text, dest=target_language)\n return result.text" } ] }