Don’t feel like coding today? Use the power of GPT3 to execute any function inside your programs just by giving some doctests.
How is this different from Copilot? Is that what you said? Copilot generates code that you run. This beauty uses GPT3 to compute the answer to each function call.
$ pip install git+https://github.com/nilp0inter/gptrun@main
First you need an OPENAI API key. Get it here: https://openai.com/api/
$ export OPENAI_API_KEY="<your OPENAI key>"
A code sample:
@gptrun def capital(country): """ Return the capital of a country. >>> capital("Angola") "Luanda" >>> capital("France") "Paris" >>> capital("Spain") "Madrid" """ pass # I don't feel like coding today (: >>> capital.test() # You can test your "code". Don't let them blame you on coverage. ... >>> capital("China") "Beijing"
You can adjust GPT3 parameters using the decorator. See
This code is production ready and ?% certified by the Ministry of Silly Walks.