3 ms·
This was an experiment from a couple of years back with making the agent basically re-write itself based on the instructions you provide. You could probably cod
by joshka 2y ago
This was an experiment from a couple of years back with making the agent basically re-write itself based on the instructions you provide. You could probably code golf this shorter depending on the language. Arguably, this doesn't solve the problem directly, but it allows you to vibe your way there.
import os
import openai
instruction = input("Enter an instruction: ")
script_name = os.path.basename(__file__)
script_code = open(script_name).read()
response = openai.Edit.create(
model="code-davinci-edit-001",
input=script_code,
instruction=instruction,
temperature=0)
new_script_code = response["choices"][0]["text"]
with open(script_name, "w") as f:
f.write(new_script_code)