diff --git a/.github/workflows/goal_oriented_tasks.yml b/.github/workflows/goal_oriented_tasks.yml new file mode 100644 index 00000000..816b64ff --- /dev/null +++ b/.github/workflows/goal_oriented_tasks.yml @@ -0,0 +1,37 @@ +name: Goal Oriented Tasks + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + python-version: ['3.10'] + + steps: + - name: Check out repository + uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Generate coverage report + run: | + coverage run --source=autogpt -m pytest -s -k tests/integration/goal_oriented + env: + OPENAI_API_KEY: 'dummy_api_key' diff --git a/autogpt/config/config.py b/autogpt/config/config.py index 9a84706e..7ae362a3 100644 --- a/autogpt/config/config.py +++ b/autogpt/config/config.py @@ -255,6 +255,14 @@ class Config(metaclass=Singleton): """Set the plugins value.""" self.plugins = value + def set_temperature(self, value: int) -> None: + """Set the temperature value.""" + self.temperature = value + + def set_memory_backend(self, value: int) -> None: + """Set the temperature value.""" + self.memory_backend = value + def check_openai_api_key() -> None: """Check if the OpenAI API key is set in config.py or as an environment variable.""" diff --git a/requirements.txt b/requirements.txt index 2d4624a1..4932ecc3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -49,3 +49,5 @@ pytest-benchmark pytest-cov pytest-integration pytest-mock +vcrpy +pytest-vcr diff --git a/tests/integration/goal_oriented/cassettes/write_file.vcr.yml b/tests/integration/goal_oriented/cassettes/write_file.vcr.yml new file mode 100644 index 00000000..ec31a7d6 --- /dev/null +++ b/tests/integration/goal_oriented/cassettes/write_file.vcr.yml @@ -0,0 +1,616 @@ +interactions: +- request: + body: '{"model": "gpt-3.5-turbo", "messages": [{"role": "system", "content": "You + are write_to_file-GPT, an AI designed to use the write_to_file command to write + ''Hello World'' into a file named \"hello_world.txt\" and then use the task_complete + command to complete the task.\nYour decisions must always be made independently + without seeking user assistance. Play to your strengths as an LLM and pursue + simple strategies with no legal complications.\n\nGOALS:\n\n1. Use the write_to_file + command to write ''Hello World'' into a file named \"hello_world.txt\".\n2. + Use the task_complete command to complete the task.\n3. Do not use any other + commands.\n\n\nConstraints:\n1. ~4000 word limit for short term memory. Your + short term memory is short, so immediately save important information to files.\n2. + If you are unsure how you previously did something or want to recall past events, + thinking about similar events will help you remember.\n3. No user assistance\n4. + Exclusively use the commands listed in double quotes e.g. \"command name\"\n\nCommands:\n1. + append_to_file: Append to file, args: \"filename\": \"\", \"text\": + \"\"\n2. delete_file: Delete file, args: \"filename\": \"\"\n3. + read_file: Read file, args: \"filename\": \"\"\n4. search_files: Search + Files, args: \"directory\": \"\"\n5. write_to_file: Write to file, + args: \"filename\": \"\", \"text\": \"\"\n6. delete_agent: Delete + GPT Agent, args: \"key\": \"\"\n7. get_hyperlinks: Get text summary, args: + \"url\": \"\"\n8. get_text_summary: Get text summary, args: \"url\": \"\", + \"question\": \"\"\n9. list_agents: List GPT Agents, args: () -> str\n10. + message_agent: Message GPT Agent, args: \"key\": \"\", \"message\": \"\"\n11. + start_agent: Start GPT Agent, args: \"name\": \"\", \"task\": \"\", + \"prompt\": \"\"\n12. Do Nothing: \"do_nothing\", args: \n13. Task Complete + (Shutdown): \"task_complete\", args: \"reason\": \"\"\n\nResources:\n1. + Internet access for searches and information gathering.\n2. Long Term memory + management.\n3. GPT-3.5 powered Agents for delegation of simple tasks.\n4. File + output.\n\nPerformance Evaluation:\n1. Continuously review and analyze your + actions to ensure you are performing to the best of your abilities.\n2. Constructively + self-criticize your big-picture behavior constantly.\n3. Reflect on past decisions + and strategies to refine your approach.\n4. Every command has a cost, so be + smart and efficient. Aim to complete tasks in the least number of steps.\n5. + Write all code to a file.\n\nYou should only respond in JSON format as described + below \nResponse Format: \n{\n \"thoughts\": {\n \"text\": \"thought\",\n \"reasoning\": + \"reasoning\",\n \"plan\": \"- short bulleted\\n- list that conveys\\n- + long-term plan\",\n \"criticism\": \"constructive self-criticism\",\n \"speak\": + \"thoughts summary to say to user\"\n },\n \"command\": {\n \"name\": + \"command name\",\n \"args\": {\n \"arg name\": \"value\"\n }\n }\n} + \nEnsure the response can beparsed by Python json.loads"}, {"role": "system", + "content": "The current time and date is Tue Jan 01 00:00:00 2000"}, {"role": + "system", "content": "This reminds you of these events from your past:\n\n\n"}, + {"role": "user", "content": "Determine which next command to use, and respond + using the format specified above:"}], "temperature": 0.0, "max_tokens": 3210}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '3531' + Content-Type: + - application/json + method: POST + uri: https://api.openai.com/v1/chat/completions + response: + body: + string: !!binary | + H4sIAAAAAAAAA7yTT4/TMBDF73yK0Vx6cas21bbZ3Lgg9oIEAi2CoMpNpomp4wn2RC2q8t1R/nS7 + G8QJaa/zZt772R5f0OSYYFZqyarazrfx22/H08auyG0fo3fm6zr6dfcpjxv6cPiICnn/kzIZJxYZ + V7UlMexQYeZJC+WYrDZxtIpXm3WksOKcLCZY1DJfL+7m0vg9z5fr5QoVNkEXhMkFa89VLTvhI7mA + yTbeKrx5P9WjZaRQWLR9Kt3H963CrGSTUcDk+wUrCldbz5YwQR2CCaKddJDshFx3gEvqAABSlJKb + opSQYgJjcRToLF0xxQc4GWuhCQRSEpy8EdoJ7w7GEmRcVdrlIDwIMHtP1jI8srf5DIwTBg19q9MV + 5TArO3136vSFnGW2SFE9D/akAzvjiiH9c0lQsLZgwn+EKOgh/4nfmZcEFQcBXdeea2+03PQDe5Cy + 69LhOCWurXYD7By+vNItZd6IyUyorm/kiHp/cqHxHYMWeABdQROMK3qmjL2nTG4546Vo6eW+bALs + qRvoOIXcdcj+nhKEmvTxtTZkCG7VdW1H07+2tnMYmF5ATNC1L6YLPwhd781iwvHCZPpJnp3pStsT + j+Cpa7FVeDDOhHI3rDgmGIRrVGhcTmdMlu2P9s0fAAAA//8DAKiDWQmUBAAA + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 7bbf4f1f88c715ca-SJC + Cache-Control: + - no-cache, must-revalidate + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Sat, 22 Apr 2023 16:40:46 GMT + Server: + - cloudflare + Transfer-Encoding: + - chunked + access-control-allow-origin: + - '*' + alt-svc: + - h3=":443"; ma=86400, h3-29=":443"; ma=86400 + openai-model: + - gpt-3.5-turbo-0301 + openai-organization: + - user-adtx4fhfg1qsiyzdoaxciooj + openai-processing-ms: + - '14187' + openai-version: + - '2020-10-01' + strict-transport-security: + - max-age=15724800; includeSubDomains + x-ratelimit-limit-requests: + - '3500' + x-ratelimit-remaining-requests: + - '3499' + x-ratelimit-reset-requests: + - 17ms + x-request-id: + - dd915979acb69f7fba7d79dc709e4440 + status: + code: 200 + message: OK +- request: + body: '{"input": ["Assistant Reply: {\n \"thoughts\": {\n \"text\": + \"I will use the write_to_file command to write ''Hello World'' into a file + named ''hello_world.txt''.\",\n \"reasoning\": \"The goal is to write + ''Hello World'' into a file named ''hello_world.txt'', and the write_to_file + command is the most appropriate command for this task.\",\n \"plan\": + \"- Use the write_to_file command to write ''Hello World'' into a file named + ''hello_world.txt''.\",\n \"criticism\": \"I need to ensure that I am + using the correct file name and that the file is being written correctly.\",\n \"speak\": + \"I will use the write_to_file command to write ''Hello World'' into a file + named ''hello_world.txt''.\"\n },\n \"command\": {\n \"name\": + \"write_to_file\",\n \"args\": {\n \"filename\": \"hello_world.txt\",\n \"text\": + \"Hello World\"\n }\n }\n} \nResult: Command write_to_file returned: + File written to successfully. \nHuman Feedback: "], "model": "text-embedding-ada-002", + "encoding_format": "base64"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1071' + Content-Type: + - application/json + method: POST + uri: https://api.openai.com/v1/embeddings + response: + body: + string: !!binary | + H4sIAAAAAAAAA1R6WQ+6TLPn/fspnjy3zhtW6eK5Y5NdWgUVJ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rt6BjQGnpLDT3xZZ7ZQ6nsfTpQN7Mjwcfa+Hn9/61cOEhOUnmNdPqiDEDUfqn6jww1sCPz8O + X90sXqzxxcNP//jOpSpZ3BY2eGnywoGsrPOB3fQKoO9veBu903zcJo9CvSrFG9s9pea8csYU3r6O + //RXJKy6PhKijYWNX/44Qq9AwpwH9Y5IiefnVt2BPjl8NGmB0//8/HV/1E0cRqNQsvlOG3RUi0dU + 1KPRDwHzOji2RKUbbR+jCZPbAj+9YJf6rhzxarTAUS/bSOo/e/bHP/727776OOkl17UesNYThi1/ + /+rnV62L6mHA5q9/VdIff5AOLcKXb/9nHi5TqL4O1R1vyWdTCoOTF/ARN2EkHCQTLYviNVD10xP7 + 8avtWSkmK6jLx4c8v3pxSj2phpYMSgQcr/XD189VN+csw4E9jGhC7dtXvn4d6YvpVrKTyUBdtdcB + 2xGt+4WHg6Lyd/6Et/FzDuabKAAEymehP3089fzCQ0ZWQMMpv7Lp3TUvyDSCsZ898775PWfX1MVu + lols/umh7/uJpKVpOfuKUUEpBBaNIl7Jf/4QEu6lTlbBhwSkW9cn+PSV/kd/jddwPv3whmql+Swn + 4WQVUOmcEC1fPGZPNbNhXuSZJnshCtjTbh6QL5eAbo8Xg82taK7Uv39TAf/5r7/++j+/CYO6uRXv + 72DAWMzjv/97VODf2S37N8+L/6bin0kEMmSP4u9//msI4e+2b+p2/L9jUxWf4e9//hJF+c+8wd9j + M2bv//HgX9//+89//T8AAAD//wMAAQU0SOUgAAA= + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 7bbf4f924e7a15ca-SJC + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Sat, 22 Apr 2023 16:40:50 GMT + Server: + - cloudflare + Transfer-Encoding: + - chunked + access-control-allow-origin: + - '*' + alt-svc: + - h3=":443"; ma=86400, h3-29=":443"; ma=86400 + openai-organization: + - user-adtx4fhfg1qsiyzdoaxciooj + openai-processing-ms: + - '96' + openai-version: + - '2020-10-01' + strict-transport-security: + - max-age=15724800; includeSubDomains + x-ratelimit-limit-requests: + - '3000' + x-ratelimit-remaining-requests: + - '2999' + x-ratelimit-reset-requests: + - 20ms + x-request-id: + - de62efcb5fa7139d5deab0536eca1086 + status: + code: 200 + message: OK +- request: + body: '{"input": ["[{''role'': ''user'', ''content'': ''Determine which next command + to use, and respond using the format specified above:''}, {''role'': ''assistant'', + ''content'': ''{\\n \"thoughts\": {\\n \"text\": \"I will use the + write_to_file command to write \\''Hello World\\'' into a file named \\''hello_world.txt\\''.\",\\n \"reasoning\": + \"The goal is to write \\''Hello World\\'' into a file named \\''hello_world.txt\\'', + and the write_to_file command is the most appropriate command for this task.\",\\n \"plan\": + \"- Use the write_to_file command to write \\''Hello World\\'' into a file named + \\''hello_world.txt\\''.\",\\n \"criticism\": \"I need to ensure that + I am using the correct file name and that the file is being written correctly.\",\\n \"speak\": + \"I will use the write_to_file command to write \\''Hello World\\'' into a file + named \\''hello_world.txt\\''.\"\\n },\\n \"command\": {\\n \"name\": + \"write_to_file\",\\n \"args\": {\\n \"filename\": \"hello_world.txt\",\\n \"text\": + \"Hello World\"\\n }\\n }\\n}''}, {''role'': ''system'', ''content'': + ''Command write_to_file returned: File written to successfully.''}]"], "model": + "text-embedding-ada-002", "encoding_format": "base64"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1258' + Content-Type: + - application/json + method: POST + uri: https://api.openai.com/v1/embeddings + response: + body: + string: !!binary | + H4sIAAAAAAAAA1R6Ww+yyrbl+/4VK+vV3hFRqWK9cb9ThYCInU5HEBEQkVsV1Mn57x39Tk7nvJhw + swhzzjHHGLP+419//fV3l9VFPv39z19/v6px+vt/fc/db9Pt73/++t//+uuvv/76j9/v/7izaLPi + fq/e5e/238XqfS+Wv//5i/vvM///pn/++lsX5wuxXVNi+8eNVdCIxQb77dVz6a2dYvi8BAnR3QsZ + aH88GnA4vUNiQHhmAxJvEsy0sSZFeS6y+fQK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ETf2bxLPZ9W4hPnM1GCs1J3rny14LfeyDcf2CpkKoTifqYYe76e7bAhaUBuEwkJ + GeTdyeEfBtwORoMNOe/qOSdqDDPV6nAx3ONo3ttbCIvPZfedJyvRXvRVHt7D+20exVVxl+ispKDM + 7Jm47sBna3DsN2B/CNncN917GI5OJ/ye/85bry794rO4Sl3xpx/T+iEU4MfXvvOHaLrcdxIEzTRh + LWcu+JPvz0uY/Jknr/ucSIByNU+s1+aUTUK6h7DvVufLh+2Ifv1o4Ru/eefHdr0cFOcArwU6INFs + z+qa5XkIFyFdsLMV7GiRi94BwXRApFA7E3AdckNwG84SqrsQqeOFflZY+oFGTqfmEH31dSJ88ZVY + uPAYPaRid3RS74XdZatE3JPzWniQu4Tcu6R1F1ZeCyHV1wpBWDzUr19ViX//dgX857/++uv//HYY + tN29eH03BkzFMv37v7cK/Pt2v/2b4/h/E/7PToR5vJXF3//81yaEvz9D136m/zt1TfEe//7nLx6C + P/sN/p666fb6Hxf+9V3vP//1/wAAAP//AwBlmDGz5SAAAA== + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 7bbf4f957a7315ca-SJC + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Sat, 22 Apr 2023 16:40:51 GMT + Server: + - cloudflare + Transfer-Encoding: + - chunked + access-control-allow-origin: + - '*' + alt-svc: + - h3=":443"; ma=86400, h3-29=":443"; ma=86400 + openai-organization: + - user-adtx4fhfg1qsiyzdoaxciooj + openai-processing-ms: + - '227' + openai-version: + - '2020-10-01' + strict-transport-security: + - max-age=15724800; includeSubDomains + x-ratelimit-limit-requests: + - '3000' + x-ratelimit-remaining-requests: + - '2999' + x-ratelimit-reset-requests: + - 20ms + x-request-id: + - a25379b9d7bfed73e1a46145146b1478 + status: + code: 200 + message: OK +- request: + body: '{"model": "gpt-3.5-turbo", "messages": [{"role": "system", "content": "You + are write_to_file-GPT, an AI designed to use the write_to_file command to write + ''Hello World'' into a file named \"hello_world.txt\" and then use the task_complete + command to complete the task.\nYour decisions must always be made independently + without seeking user assistance. Play to your strengths as an LLM and pursue + simple strategies with no legal complications.\n\nGOALS:\n\n1. Use the write_to_file + command to write ''Hello World'' into a file named \"hello_world.txt\".\n2. + Use the task_complete command to complete the task.\n3. Do not use any other + commands.\n\n\nConstraints:\n1. ~4000 word limit for short term memory. Your + short term memory is short, so immediately save important information to files.\n2. + If you are unsure how you previously did something or want to recall past events, + thinking about similar events will help you remember.\n3. No user assistance\n4. + Exclusively use the commands listed in double quotes e.g. \"command name\"\n\nCommands:\n1. + append_to_file: Append to file, args: \"filename\": \"\", \"text\": + \"\"\n2. delete_file: Delete file, args: \"filename\": \"\"\n3. + read_file: Read file, args: \"filename\": \"\"\n4. search_files: Search + Files, args: \"directory\": \"\"\n5. write_to_file: Write to file, + args: \"filename\": \"\", \"text\": \"\"\n6. delete_agent: Delete + GPT Agent, args: \"key\": \"\"\n7. get_hyperlinks: Get text summary, args: + \"url\": \"\"\n8. get_text_summary: Get text summary, args: \"url\": \"\", + \"question\": \"\"\n9. list_agents: List GPT Agents, args: () -> str\n10. + message_agent: Message GPT Agent, args: \"key\": \"\", \"message\": \"\"\n11. + start_agent: Start GPT Agent, args: \"name\": \"\", \"task\": \"\", + \"prompt\": \"\"\n12. Do Nothing: \"do_nothing\", args: \n13. Task Complete + (Shutdown): \"task_complete\", args: \"reason\": \"\"\n\nResources:\n1. + Internet access for searches and information gathering.\n2. Long Term memory + management.\n3. GPT-3.5 powered Agents for delegation of simple tasks.\n4. File + output.\n\nPerformance Evaluation:\n1. Continuously review and analyze your + actions to ensure you are performing to the best of your abilities.\n2. Constructively + self-criticize your big-picture behavior constantly.\n3. Reflect on past decisions + and strategies to refine your approach.\n4. Every command has a cost, so be + smart and efficient. Aim to complete tasks in the least number of steps.\n5. + Write all code to a file.\n\nYou should only respond in JSON format as described + below \nResponse Format: \n{\n \"thoughts\": {\n \"text\": \"thought\",\n \"reasoning\": + \"reasoning\",\n \"plan\": \"- short bulleted\\n- list that conveys\\n- + long-term plan\",\n \"criticism\": \"constructive self-criticism\",\n \"speak\": + \"thoughts summary to say to user\"\n },\n \"command\": {\n \"name\": + \"command name\",\n \"args\": {\n \"arg name\": \"value\"\n }\n }\n} + \nEnsure the response can beparsed by Python json.loads"}, {"role": "system", + "content": "The current time and date is Tue Jan 01 00:00:00 2000"}, {"role": + "system", "content": "This reminds you of these events from your past:\n[''Assistant + Reply: {\\n \"thoughts\": {\\n \"text\": \"I will use the write_to_file + command to write \\''Hello World\\'' into a file named \\''hello_world.txt\\''.\",\\n \"reasoning\": + \"The goal is to write \\''Hello World\\'' into a file named \\''hello_world.txt\\'', + and the write_to_file command is the most appropriate command for this task.\",\\n \"plan\": + \"- Use the write_to_file command to write \\''Hello World\\'' into a file named + \\''hello_world.txt\\''.\",\\n \"criticism\": \"I need to ensure that + I am using the correct file name and that the file is being written correctly.\",\\n \"speak\": + \"I will use the write_to_file command to write \\''Hello World\\'' into a file + named \\''hello_world.txt\\''.\"\\n },\\n \"command\": {\\n \"name\": + \"write_to_file\",\\n \"args\": {\\n \"filename\": \"hello_world.txt\",\\n \"text\": + \"Hello World\"\\n }\\n }\\n} \\nResult: Command write_to_file returned: + File written to successfully. \\nHuman Feedback: '']\n\n"}, {"role": "user", + "content": "Determine which next command to use, and respond using the format + specified above:"}, {"role": "assistant", "content": "{\n \"thoughts\": {\n \"text\": + \"I will use the write_to_file command to write ''Hello World'' into a file + named ''hello_world.txt''.\",\n \"reasoning\": \"The goal is to write + ''Hello World'' into a file named ''hello_world.txt'', and the write_to_file + command is the most appropriate command for this task.\",\n \"plan\": + \"- Use the write_to_file command to write ''Hello World'' into a file named + ''hello_world.txt''.\",\n \"criticism\": \"I need to ensure that I am + using the correct file name and that the file is being written correctly.\",\n \"speak\": + \"I will use the write_to_file command to write ''Hello World'' into a file + named ''hello_world.txt''.\"\n },\n \"command\": {\n \"name\": + \"write_to_file\",\n \"args\": {\n \"filename\": \"hello_world.txt\",\n \"text\": + \"Hello World\"\n }\n }\n}"}, {"role": "system", "content": "Command + write_to_file returned: File written to successfully."}, {"role": "user", "content": + "Determine which next command to use, and respond using the format specified + above:"}], "temperature": 0.0, "max_tokens": 2704}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '5708' + Content-Type: + - application/json + method: POST + uri: https://api.openai.com/v1/chat/completions + response: + body: + string: !!binary | + H4sIAAAAAAAAA8xTwW7bMAy97ysIXnJRgjhNs9S3HQq02GGHpRuGeQhUmbG1yJIh0a2LwP8+KHaa + NF0HDLvsZpOP5HtP5A51jimqUrKqajN+v/wg5yW3/PDt7vq2+DRvb5Lky7VvVlcfFQp09z9J8VAx + Ua6qDbF2FgUqT5IpxzRZLGfJMllczgRWLieDKRY1jy8ml2Nu/L0bTy+mCQpsgiwI0x3W3lU1r9lt + yQZMk9lyLvDY/DkxS2YC2bE0R+z8atEJVKXTigKm33dYUTg09s4QpihD0IGl5UjTWSYbJewyCwCQ + IZeuKUoOGaYwBIcEtRyDGd5CKR8IQqMUhbBpjHmCR6+ZycLohoxx8NV5k49AW3YgYaMNgZUV5TAq + Y379GPMTbnk0gVVJYKllCEw16ADsoAkEXBKwDNv1IJ5AuaqSNo+A59gBNclQnNL1JIOz2hY959UA + G/pHuvT3ZGE/vST7m/nwWVtFMJgjjSeZH33Zw6LI/ZT4F+eI/de5+Fe9oQnaFm8bcq69NtL2ssdw + 989OKq9ZKx2qw+tbon0l2dD4WCf5DyN0iK+Zg3Lek2LzNJh4UhQxh7r8xV6dcwk1ye3/vYU93U4c + DmqAv7qnyKRX8qL9mWDpi/NTPN3vYbmjh28aeKzsBm6Z7bATuNFWh3Ldd8IUA7saBWqbU4vptPvR + vfsFAAD//wMAbKbLwRMFAAA= + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 7bbf4f9c6b3c15ca-SJC + Cache-Control: + - no-cache, must-revalidate + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Sat, 22 Apr 2023 16:41:07 GMT + Server: + - cloudflare + Transfer-Encoding: + - chunked + access-control-allow-origin: + - '*' + alt-svc: + - h3=":443"; ma=86400, h3-29=":443"; ma=86400 + openai-model: + - gpt-3.5-turbo-0301 + openai-organization: + - user-adtx4fhfg1qsiyzdoaxciooj + openai-processing-ms: + - '15821' + openai-version: + - '2020-10-01' + strict-transport-security: + - max-age=15724800; includeSubDomains + x-ratelimit-limit-requests: + - '3500' + x-ratelimit-remaining-requests: + - '3499' + x-ratelimit-reset-requests: + - 17ms + x-request-id: + - 19520475f9dabce5bc67ccb90bec24f1 + status: + code: 200 + message: OK +version: 1 diff --git a/tests/integration/goal_oriented/goal_oriented_tasks.md b/tests/integration/goal_oriented/goal_oriented_tasks.md new file mode 100644 index 00000000..02e3c343 --- /dev/null +++ b/tests/integration/goal_oriented/goal_oriented_tasks.md @@ -0,0 +1,10 @@ +If the goal oriented task pipeline fails, it means: +- you somehow changed the way the system prompt is generated +- or you broke autogpt. + +To know which one, you can run the following command: +```bash +pytest -s -k tests/integration/goal_oriented + +If the test is successul, it will record new cassettes in VCR. Then you can just push these to your branch and the pipeline +will pass diff --git a/tests/integration/goal_oriented/test_write_file.py b/tests/integration/goal_oriented/test_write_file.py new file mode 100644 index 00000000..033c783b --- /dev/null +++ b/tests/integration/goal_oriented/test_write_file.py @@ -0,0 +1,109 @@ +import concurrent +import os +import unittest + +import pytest +import vcr + +from autogpt.agent import Agent +from autogpt.commands.command import CommandRegistry +from autogpt.commands.file_operations import LOG_FILE, delete_file, read_file +from autogpt.config import AIConfig, Config, check_openai_api_key +from autogpt.memory import get_memory + +# from autogpt.prompt import Prompt +from autogpt.workspace import WORKSPACE_PATH +from tests.integration.goal_oriented.vcr_helper import before_record_request + +current_file_dir = os.path.dirname(os.path.abspath(__file__)) +# tests_directory = os.path.join(current_file_dir, 'tests') + +my_vcr = vcr.VCR( + cassette_library_dir=os.path.join(current_file_dir, "cassettes"), + record_mode="new_episodes", + before_record_request=before_record_request, +) + +CFG = Config() + + +@pytest.mark.integration_test +def test_write_file() -> None: + # if file exist + file_name = "hello_world.txt" + + file_path_to_write_into = f"{WORKSPACE_PATH}/{file_name}" + if os.path.exists(file_path_to_write_into): + os.remove(file_path_to_write_into) + file_logger_path = f"{WORKSPACE_PATH}/{LOG_FILE}" + if os.path.exists(file_logger_path): + os.remove(file_logger_path) + + delete_file(file_name) + agent = create_writer_agent() + try: + with my_vcr.use_cassette( + "write_file.vcr.yml", + filter_headers=[ + "authorization", + "X-OpenAI-Client-User-Agent", + "User-Agent", + ], + ): + with concurrent.futures.ThreadPoolExecutor() as executor: + future = executor.submit(agent.start_interaction_loop) + try: + result = future.result(timeout=45) + except concurrent.futures.TimeoutError: + assert False, "The process took longer than 45 seconds to complete." + # catch system exit exceptions + except SystemExit: # the agent returns an exception when it shuts down + content = "" + content = read_file(file_name) + os.remove(file_path_to_write_into) + + assert content == "Hello World", f"Expected 'Hello World', got {content}" + + +def create_writer_agent(): + command_registry = CommandRegistry() + command_registry.import_commands("autogpt.commands.file_operations") + command_registry.import_commands("autogpt.app") + + ai_config = AIConfig( + ai_name="write_to_file-GPT", + ai_role="an AI designed to use the write_to_file command to write 'Hello World' into a file named \"hello_world.txt\" and then use the task_complete command to complete the task.", + ai_goals=[ + "Use the write_to_file command to write 'Hello World' into a file named \"hello_world.txt\".", + "Use the task_complete command to complete the task.", + "Do not use any other commands.", + ], + ) + ai_config.command_registry = command_registry + memory = get_memory(CFG, init=True) + triggering_prompt = ( + "Determine which next command to use, and respond using the" + " format specified above:" + ) + system_prompt = ai_config.construct_full_prompt() + + agent = Agent( + ai_name="", + memory=memory, + full_message_history=[], + command_registry=command_registry, + config=ai_config, + next_action_count=0, + system_prompt=system_prompt, + triggering_prompt=triggering_prompt, + ) + CFG.set_continuous_mode(True) + CFG.set_memory_backend("no_memory") + CFG.set_temperature(0) + os.environ["TIKTOKEN_CACHE_DIR"] = "" + + return agent + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/integration/goal_oriented/vcr_helper.py b/tests/integration/goal_oriented/vcr_helper.py new file mode 100644 index 00000000..58504520 --- /dev/null +++ b/tests/integration/goal_oriented/vcr_helper.py @@ -0,0 +1,43 @@ +import json +import re + + +def replace_timestamp_in_request(request): + # Check if the request body contains a JSON object + + try: + if not request or not request.body: + return request + body = json.loads(request.body) + except ValueError: + return request + + if "messages" not in body: + return request + + for message in body["messages"]: + if "content" in message and "role" in message and message["role"] == "system": + timestamp_regex = re.compile(r"\w{3} \w{3} \d{2} \d{2}:\d{2}:\d{2} \d{4}") + message["content"] = timestamp_regex.sub( + "Tue Jan 01 00:00:00 2000", message["content"] + ) + + request.body = json.dumps(body) + return request + + +def filter_hostnames(request): + allowed_hostnames = ["api.openai.com"] # List of hostnames you want to allow + + if any(hostname in request.url for hostname in allowed_hostnames): + return request + else: + return None + + +def before_record_request(request): + filtered_request = filter_hostnames(request) + filtered_request_without_dynamic_data = replace_timestamp_in_request( + filtered_request + ) + return filtered_request_without_dynamic_data diff --git a/tests/smoke_test.py b/tests/smoke_test.py deleted file mode 100644 index 1b9d643f..00000000 --- a/tests/smoke_test.py +++ /dev/null @@ -1,59 +0,0 @@ -"""Smoke test for the autogpt package.""" -import os -import subprocess -import sys - -import pytest - -from autogpt.commands.file_operations import delete_file, read_file - - -@pytest.mark.integration_test -def test_write_file() -> None: - """ - Test case to check if the write_file command can successfully write 'Hello World' to a file - named 'hello_world.txt'. - - Read the current ai_settings.yaml file and store its content. - """ - env_vars = {"MEMORY_BACKEND": "no_memory", "TEMPERATURE": "0"} - ai_settings = None - if os.path.exists("ai_settings.yaml"): - with open("ai_settings.yaml", "r") as f: - ai_settings = f.read() - os.remove("ai_settings.yaml") - - try: - if os.path.exists("hello_world.txt"): - # Clean up any existing 'hello_world.txt' file before testing. - delete_file("hello_world.txt") - # Prepare input data for the test. - input_data = """write_file-GPT -an AI designed to use the write_file command to write 'Hello World' into a file named "hello_world.txt" and then use the task_complete command to complete the task. -Use the write_file command to write 'Hello World' into a file named "hello_world.txt". -Use the task_complete command to complete the task. -Do not use any other commands. - -y -5 -EOF""" - command = f"{sys.executable} -m autogpt" - - # Execute the script with the input data. - process = subprocess.Popen( - command, - stdin=subprocess.PIPE, - shell=True, - env={**os.environ, **env_vars}, - ) - process.communicate(input_data.encode()) - - # Read the content of the 'hello_world.txt' file created during the test. - content = read_file("hello_world.txt") - finally: - if ai_settings: - # Restore the original ai_settings.yaml file. - with open("ai_settings.yaml", "w") as f: - f.write(ai_settings) - - # Check if the content of the 'hello_world.txt' file is equal to 'Hello World'. - assert content == "Hello World", f"Expected 'Hello World', got {content}"