#ai #programming
# [[Epistemic status]]
#shower-thought
# Programming a singularity using GPT3 codex
#to-digest
```py
import openai
# ...
generation_prompt = """
def singularity(goal: str, code: Optional[str]):
# exit condition: goal achieved
# execute code
# [END FN]
"""
def singularity(goal: str, code: Optional[str]):
if code: # execute code and return
prompt = f"""
This is how to generate a recursive singularity using Python code
'
{generation_prompt}
'
Generate recursively with the ultimate goal to {goal}:"""
openai.call(prompt, stop=["[END FN]"])
openai.apikey = "skfoobar..."
singularity("build a rocket to visit Mars (without destroying humanity)")
```
# External links