Text file loaders (#3031)

* adding requiered packages for loading pdf, docx, md, tex files (preferably pure python packages)

* adding text file utils providing function to load file based on extension && adding read_text_file command

* adding test cases for text file loading (pdf file creation is hardcoded due to external package requierment for creation (a sample file can be added))

* formatting

* changing command name from 'read_text_file' to 'parse_text_document'

* fallback to txtParser if file extension is not known to read script and code files

* adding extension respective parsers

* adding binary file check function

* adding file existance check && raising valueError for unsupported binary file formats

* adding check file type (binary) in test_parsers for specific extensions && fixing mock pdf generation to include null bytes

* adding .yml extension parser

* removal of .doc parser

* updating file loading commands names

* updating test (removing .doc mock function)

* fix: import sort

* new cassette for mem A

* feat: update Cassettes

* feat: consolidate commands

* feat: linting

* feat: updates to cassettes

---------

Co-authored-by: Reinier van der Leer <github@pwuts.nl>
Co-authored-by: Nicholas Tindle <nick@ntindle.com>
Co-authored-by: k-boikov <64261260+k-boikov@users.noreply.github.com>
This commit is contained in:
sherif-med
2023-05-21 21:48:40 +02:00
committed by GitHub
parent e1c6778c3a
commit 31525dfef7
7 changed files with 4053 additions and 622 deletions

View File

@@ -442,4 +442,505 @@ interactions:
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 below e.g. command_name\n\nCommands:\n1.
append_to_file: Append to file, args: \"filename\": \"<filename>\", \"text\":
\"<text>\"\n2. delete_file: Delete file, args: \"filename\": \"<filename>\"\n3.
list_files: List Files in Directory, args: \"directory\": \"<directory>\"\n4.
read_file: Read text from file, args: \"filename\": \"<filename>\"\n5. read_raw_file:
Read file, args: \"filename\": \"<filename>\"\n6. write_to_file: Write to file,
args: \"filename\": \"<filename>\", \"text\": \"<text>\"\n7. delete_agent: Delete
GPT Agent, args: \"key\": \"<key>\"\n8. get_hyperlinks: Get text summary, args:
\"url\": \"<url>\"\n9. get_text_summary: Get text summary, args: \"url\": \"<url>\",
\"question\": \"<question>\"\n10. list_agents: List GPT Agents, args: () ->
str\n11. message_agent: Message GPT Agent, args: \"key\": \"<key>\", \"message\":
\"<message>\"\n12. start_agent: Start GPT Agent, args: \"name\": \"<name>\",
\"task\": \"<short_task_desc>\", \"prompt\": \"<prompt>\"\n13. task_complete:
Task Complete (Shutdown), args: \"reason\": \"<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 be parsed by Python json.loads"}, {"role": "system",
"content": "The current time and date is Tue Jan 1 00:00:00 2000"}, {"role":
"user", "content": "Determine which next command to use, and respond using the
format specified above:"}], "temperature": 0, "max_tokens": 0}'
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '3467'
Content-Type:
- application/json
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: !!binary |
H4sIAAAAAAAAA7STz27TQBDG7zzFaC65OFFC2iT1ExCEWqAFhDCytuuJvcTeMbvjJijyuyP/SdIY
9QScVppv5pvf7M4e0CQYos6U6KLMx8v1/e2T0p/f36YfVh/5/m579fbu3fRhtf6qPAbIjz9IS18x
0VyUOYlhiwFqR0oowXC2WF0t5vP5chZgwQnlGGJayng+uR5L5R55PJ1PZxhg5VVKGB6wdFyUEgtv
yXoMl8tFgGfvU/z17DpAYVH5KXRzM6sD1BkbTR7DbwcsyB9tHeeEISrvjRdlpYFkK2SbAQ6RBQCI
UDKu0kx8hCH0wV6gvTTBCNewM3kOlSeQjGDnjFAsHG9MTqC5KJRNQLgTYPSG8pzhC7s8GYGxwqCg
TbWqoARGWaPHu0afyF5GkwiD540dKc/W2LTr/pARiPJbcPSzMo48FPQX3QJoaV+cw/hWLNgLqLJ0
XDqjhGDDDiRrVOW3Q+QyV7ajHcOn/3ZNkT27NxRxvyQX7qfYMWvIqp0Ro40vjo9ridpKsr5yTZ0S
WEOmnjoPzc6RljNbf4FKWrkNGw/9/oOxF1WJaQ52v4YYviS1fXm/GqB/t19d4zo4Ln1v+sfONw4d
08XrDdCVS4ffpROa3LPFgOPCZPjFns10pG2Je/DI1lgHuDHW+CzuPgiG6IVLDNDYhPYYTuvv9avf
AAAA//8DANPpphvSBAAA
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 7ca920092efb0c34-DFW
Cache-Control:
- no-cache, must-revalidate
Connection:
- keep-alive
Content-Encoding:
- gzip
Content-Type:
- application/json
Date:
- Sun, 21 May 2023 01:43:08 GMT
Server:
- cloudflare
access-control-allow-origin:
- '*'
alt-svc:
- h3=":443"; ma=86400, h3-29=":443"; ma=86400
openai-model:
- gpt-3.5-turbo-0301
openai-organization:
- significant-gravitas
openai-processing-ms:
- '17065'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=15724800; includeSubDomains
x-ratelimit-limit-requests:
- '3500'
x-ratelimit-limit-tokens:
- '90000'
x-ratelimit-remaining-requests:
- '3499'
x-ratelimit-remaining-tokens:
- '86497'
x-ratelimit-reset-requests:
- 17ms
x-ratelimit-reset-tokens:
- 2.335s
x-request-id:
- 90577bd1f9895f3d042b1a9287fa5f73
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 below e.g. command_name\n\nCommands:\n1.
append_to_file: Append to file, args: \"filename\": \"<filename>\", \"text\":
\"<text>\"\n2. delete_file: Delete file, args: \"filename\": \"<filename>\"\n3.
list_files: List Files in Directory, args: \"directory\": \"<directory>\"\n4.
read_file: Read text from file, args: \"filename\": \"<filename>\"\n5. read_raw_file:
Read file, args: \"filename\": \"<filename>\"\n6. write_to_file: Write to file,
args: \"filename\": \"<filename>\", \"text\": \"<text>\"\n7. delete_agent: Delete
GPT Agent, args: \"key\": \"<key>\"\n8. get_hyperlinks: Get text summary, args:
\"url\": \"<url>\"\n9. get_text_summary: Get text summary, args: \"url\": \"<url>\",
\"question\": \"<question>\"\n10. list_agents: List GPT Agents, args: () ->
str\n11. message_agent: Message GPT Agent, args: \"key\": \"<key>\", \"message\":
\"<message>\"\n12. start_agent: Start GPT Agent, args: \"name\": \"<name>\",
\"task\": \"<short_task_desc>\", \"prompt\": \"<prompt>\"\n13. task_complete:
Task Complete (Shutdown), args: \"reason\": \"<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 be parsed by Python json.loads"}, {"role": "system",
"content": "The current time and date is Tue Jan 1 00:00:00 2000"}, {"role":
"system", "content": "This reminds you of these events from your past: \nI was
created and nothing new has happened."}, {"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 task requires me
to write ''Hello World'' into a file named ''hello_world.txt'', and the write_to_file
command is the most appropriate for this task.\",\n \"plan\": \"- Use
the write_to_file command to write ''Hello World'' into a file named ''hello_world.txt''.\\n-
Use the task_complete command to complete the task.\",\n \"criticism\":
\"I need to ensure that I have the correct file name and that the file is created
in the correct directory.\",\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,
"max_tokens": 0}'
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '4790'
Content-Type:
- application/json
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: !!binary |
H4sIAAAAAAAAA6ySTW/TQBCG7/yK0Vxy2UQJIWnwEYlCqkpFUIRUjKLtehIvWe+Y3TFJFfm/I8fO
R4OQkOA6H+88M/Pu0GaYoMm1mKJ0/av5p7vr+7fTh+ub4c3dx3e3byrzYaZ5ph+eblEhP34nI13H
wHBROhLLHhWaQFoow2Q0nb2ajsfj1yOFBWfkMMFVKf3xYNKXKjxyfzgejlBhFfWKMNlhGbgoZSG8
Jh8xGQ0nM4Un8VNicqVQWLQ7hV6OJrVCk7M1FDH5usOC4kE4sCNMUMdoo2gvDSZ7Id+ssEs9AECK
knO1yiWmmEAX7BK0lSaY4hw21jmoIoHkBKLjetEBEhguCu0zEIZj7FA1SFGdSwbSkb31q1b3viuD
QD8qGyhCQY3OJlgh6L0n5xi+cHBZD6wXBg1L6wi8LiiDXt7kF5smP5Ct9BQ0HHPI9U+CWBlDMS4r
556OYBlIbmOLBvc5BVpyIAVzMNr/h/1Kp327Wh8+/7OaCVassbE4fMET7TvJxyo0fVr2ze1ZYcmh
PefJPGAj6LIMXAarhS4nxJL0+o8/hr+lbiVrdbBUV/6bo5q/tdOeHeUCSofVpRnP3dNZ55wve/bt
I9AeqmNLfY21wqX1NuaLVgkTjMIlKrQ+oy0mw/pb/eIXAAAA//8DAKgaLA4VBAAA
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 7ca920871f130c34-DFW
Cache-Control:
- no-cache, must-revalidate
Connection:
- keep-alive
Content-Encoding:
- gzip
Content-Type:
- application/json
Date:
- Sun, 21 May 2023 01:43:24 GMT
Server:
- cloudflare
access-control-allow-origin:
- '*'
alt-svc:
- h3=":443"; ma=86400, h3-29=":443"; ma=86400
openai-model:
- gpt-3.5-turbo-0301
openai-organization:
- significant-gravitas
openai-processing-ms:
- '13071'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=15724800; includeSubDomains
x-ratelimit-limit-requests:
- '3500'
x-ratelimit-limit-tokens:
- '90000'
x-ratelimit-remaining-requests:
- '3499'
x-ratelimit-remaining-tokens:
- '86478'
x-ratelimit-reset-requests:
- 17ms
x-ratelimit-reset-tokens:
- 2.348s
x-request-id:
- 137423c120d49f49824a2fbbd7cbb558
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 below e.g. command_name\n\nCommands:\n1.
append_to_file: Append to file, args: \"filename\": \"<filename>\", \"text\":
\"<text>\"\n2. delete_file: Delete file, args: \"filename\": \"<filename>\"\n3.
list_files: List Files in Directory, args: \"directory\": \"<directory>\"\n4.
read_file: Read a file, args: \"filename\": \"<filename>\"\n5. write_to_file:
Write to file, args: \"filename\": \"<filename>\", \"text\": \"<text>\"\n6.
delete_agent: Delete GPT Agent, args: \"key\": \"<key>\"\n7. get_hyperlinks:
Get text summary, args: \"url\": \"<url>\"\n8. get_text_summary: Get text summary,
args: \"url\": \"<url>\", \"question\": \"<question>\"\n9. list_agents: List
GPT Agents, args: () -> str\n10. message_agent: Message GPT Agent, args: \"key\":
\"<key>\", \"message\": \"<message>\"\n11. start_agent: Start GPT Agent, args:
\"name\": \"<name>\", \"task\": \"<short_task_desc>\", \"prompt\": \"<prompt>\"\n12.
task_complete: Task Complete (Shutdown), args: \"reason\": \"<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 be parsed by Python json.loads"}, {"role": "system",
"content": "The current time and date is Tue Jan 1 00:00:00 2000"}, {"role":
"user", "content": "Determine which next command to use, and respond using the
format specified above:"}], "temperature": 0, "max_tokens": 0}'
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '3393'
Content-Type:
- application/json
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: !!binary |
H4sIAAAAAAAAA7yTT2/TQBDF73yK0Vxy2URJ0/zBRyoBEQL1UIQKRtHWnsRLdnfM7phEivzdK9tJ
2hpxQnCdN37vN7PjI5ocE8wKLZkr7XCxuru9f1PZ6+qde6tvPn74db843Mw+XX3d21tUyA8/KJPT
F6OMXWlJDHtUmAXSQjkmk/nyej5dTCdzhY5zspjgtpThdDQbShUeeDiejieosIp6S5gcsQzsSlkL
78hHTBazpcIn70v9ajxWKCzaXkqvZ8taYVawyShi8u2IjuLZNrAlTFDHaKJoLw0keyHfDHBMPQBA
ilJwtS0kppjAqXgS6CBNMcUVeKIchKGKBFIQ7IMRWguvN8YSZOyc9m1DK8DgPVnL8IWDzQdgvDBo
aFu9dpTDoGj09b7RR3KQwShF9Tw7kI7sjd92AHcFgei4g0A/KxMogqO/SFPQ0v5xDhNb0XEU0GUZ
uAxGC8GGA0jRqDru+sil1b6jHcLn/7SmLBgxmYmu/07kYxUaBi2wurxaxiFQJm1Ek9CtgQ7yhCTc
djYd/bBYkt6dg/bG2n95DV1wrc5XejL97Ugbh47pBUQPXYdt/7474byJzqLH8cKk/088m+lM2xKf
wFNfY61wY7yJxbo7Z0wwCpeo0PicDpiM6+/1q0cAAAD//wMAx8X8+IMEAAA=
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 7ca9805e4d7328e0-DFW
Cache-Control:
- no-cache, must-revalidate
Connection:
- keep-alive
Content-Encoding:
- gzip
Content-Type:
- application/json
Date:
- Sun, 21 May 2023 02:48:51 GMT
Server:
- cloudflare
access-control-allow-origin:
- '*'
alt-svc:
- h3=":443"; ma=86400, h3-29=":443"; ma=86400
openai-model:
- gpt-3.5-turbo-0301
openai-organization:
- significant-gravitas
openai-processing-ms:
- '14375'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=15724800; includeSubDomains
x-ratelimit-limit-requests:
- '3500'
x-ratelimit-limit-tokens:
- '90000'
x-ratelimit-remaining-requests:
- '3499'
x-ratelimit-remaining-tokens:
- '86497'
x-ratelimit-reset-requests:
- 17ms
x-ratelimit-reset-tokens:
- 2.335s
x-request-id:
- dd442d3790e304394237402085fd3bc5
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 below e.g. command_name\n\nCommands:\n1.
append_to_file: Append to file, args: \"filename\": \"<filename>\", \"text\":
\"<text>\"\n2. delete_file: Delete file, args: \"filename\": \"<filename>\"\n3.
list_files: List Files in Directory, args: \"directory\": \"<directory>\"\n4.
read_file: Read a file, args: \"filename\": \"<filename>\"\n5. write_to_file:
Write to file, args: \"filename\": \"<filename>\", \"text\": \"<text>\"\n6.
delete_agent: Delete GPT Agent, args: \"key\": \"<key>\"\n7. get_hyperlinks:
Get text summary, args: \"url\": \"<url>\"\n8. get_text_summary: Get text summary,
args: \"url\": \"<url>\", \"question\": \"<question>\"\n9. list_agents: List
GPT Agents, args: () -> str\n10. message_agent: Message GPT Agent, args: \"key\":
\"<key>\", \"message\": \"<message>\"\n11. start_agent: Start GPT Agent, args:
\"name\": \"<name>\", \"task\": \"<short_task_desc>\", \"prompt\": \"<prompt>\"\n12.
task_complete: Task Complete (Shutdown), args: \"reason\": \"<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 be parsed by Python json.loads"}, {"role": "system",
"content": "The current time and date is Tue Jan 1 00:00:00 2000"}, {"role":
"system", "content": "This reminds you of these events from your past: \nI was
created and nothing new has happened."}, {"role": "user", "content": "Determine
which next command to use, and respond using the format specified above:"},
{"role": "assistant", "content": "{\n \"thoughts\": {\n \"text\":
\"I need to use the write_to_file command to write ''Hello World'' into a file
named ''hello_world.txt''.\",\n \"reasoning\": \"The task requires me
to write ''Hello World'' into a file named ''hello_world.txt'', and the write_to_file
command is the most appropriate 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 use the correct filename and text to write to the
file.\",\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,
"max_tokens": 0}'
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '4637'
Content-Type:
- application/json
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: !!binary |
H4sIAAAAAAAAA7RSwY4SQRC9+xWVunAZCOzILpmbFyOHTUwWo0YM6e0pZlp6utruGsAQ/t00zMi6
sheN13qvXr3X/Q5oSixQ10p04+3wbr547x+mn+/X929pnHPc3dWfHt5ow7Npgxny4zfS0m2MNDfe
khh2mKEOpIRKLCa3s9e3+V2e5xk2XJLFAisvw3w0HUobHnk4zscTzLCNqiIsDugDN15WwhtyEYvJ
+Gaa4UX8AszyDIVF2cvoZjw7ZqhrNpoiFl8O2FDshQNbwgJVjCaKcpJsshNyKcJh6QAAlig1t1Ut
cYkFdMMOoL2k4RLnUKstQWy1phjXrbU/YBeMCDkYvCNrGT5ysOUAjBMGBWtjCZxqqIRBnfDVLuEj
2ctgBIuawNFeIAp5MBGEoY0EUhOIiptVF55Ac9MoVybCr1nPGi0xe2o3kIrsjKvOnhcdDQJ9b02g
CA1d1QG1FgqnPMZV1/IkZkqUwcnLiy5Tkpqg4SigvA/sg1FCsOYAUif0im1vlTs7HsKHf34EnVJo
E5v+4xzRaZNcbEPaUwJz8IG3piRQsFXWlHB+u5PRvniuevFI9KQ2/YGdsfbvfu8secz6Inb0P3qY
enS+9pv8M1MqVM8r/LQX/6PIfYRTjC7N0h3xmOHaOBPr1fk2FhiFPWZoXEl7LMbHr8dXPwEAAP//
AwCEJsUGfQQAAA==
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 7ca980c86e2128e0-DFW
Cache-Control:
- no-cache, must-revalidate
Connection:
- keep-alive
Content-Encoding:
- gzip
Content-Type:
- application/json
Date:
- Sun, 21 May 2023 02:49:08 GMT
Server:
- cloudflare
access-control-allow-origin:
- '*'
alt-svc:
- h3=":443"; ma=86400, h3-29=":443"; ma=86400
openai-model:
- gpt-3.5-turbo-0301
openai-organization:
- significant-gravitas
openai-processing-ms:
- '14391'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=15724800; includeSubDomains
x-ratelimit-limit-requests:
- '3500'
x-ratelimit-limit-tokens:
- '90000'
x-ratelimit-remaining-requests:
- '3499'
x-ratelimit-remaining-tokens:
- '86481'
x-ratelimit-reset-requests:
- 17ms
x-ratelimit-reset-tokens:
- 2.346s
x-request-id:
- 7efa7a4b949a3c79b750abf348c98545
status:
code: 200
message: OK
version: 1