In this walkthrough, we will get our API tokens from OpenAI and generate some business ideas with OpenAI/ChatGPT/Davinci and Python.
We will break this down to three parts: Get your API tokens, setting up python then the code.
First you need to create an account on https://openai.com/.
1) Navigate to https://openai.com
Running this PIP install will setup the OpenAI sdk. You will have access to ChatGPT, Dalle etc.
pip install --upgrade openai
Below is an example of a python app that will brainstorm bike business plans and write the first result to the console.
import openai openai.api_key = "[keyfromabove]" response = openai.Completion.create( model="text-davinci-003", prompt="Brainstorm business plans on bikes", temperature=0.8, max_tokens=60, top_p=1.0, frequency_penalty=0.0, presence_penalty=0.0 ) print(response['choices'][0]['text'])



