OpenAI provides a no code web based interface called Playground to interact with the GPT-3 API without writing any code. It enables you to prompt the GPT-3 API right in the browser.
It’s good place to try and see how the GPT-3 API works and arrive at a good enough prompt that works for your case.
But once you are done with that, you need to convert the prompt into code so that use it programmiticvally, whether in automation or in GPT-3 enabled product.
In this article, I am going to show you how to use the OpenAI Playground to convert the prompts into code.
Table of Contents
Playground to Code
This is how a prompt looks like in the OpenAI Playground
But, what if you want the same prompt wrapped in some code to use in your app?
You can get Python Code equivalent for the GPT-3 prompt by clicking on the Export Code “<>” button right in the Playground
Get the cURL command also right from the Playground too.
You can run this from your command line program.
You can also do this for other language like R, PHP, Go, Rust, etc.
Do you want to prompt GPT-3 from those languages? Check out the cURL to Code converter tool to do these conversions.
Going from writing a prompt in GPT-3 playground to calling that prompt right from your code is easy. We can use various tools provided by OpenAI or 3rd party to convert the prompts into code.