An iterative Python call to a recursive LLM prompt? ;)
Why not make the Python part recursive too? Or better yet, wait until an LLM comes out with the capability to execute arbitrary code!
Why not make the Python part recursive too? Or better yet, wait until an LLM comes out with the capability to execute arbitrary code!
https://github.com/andyk/recursive_llm/blob/main/run_recursi...
def recursively_prompt_llm(prompt, n=1):
if prompt.startswith("You are a recursive function"):
prompt = openai.Completion.create(
model="text-davinci-003",
prompt=prompt,
temperature=0,
max_tokens=2048,
)["choices"][0]["text"].strip()
print(f"response #{n}: {prompt}\n")
recursively_prompt_llm(prompt, n + 1)
recursively_prompt_llm(sys.stdin.readline())