Generative AI using OpenAI
Let's discover Generative AI using OpenAI in less than 5 minutes.
Getting Started
Get started by creating a new OpenAI account.
Or try OpenAI immediately with openai.com.
What you'll need
- An OpenAI account
- You can create a new account at OpenAI.
Generate new content
Generate new content using the OpenAI GPT models.
The GPT models will automatically be available in your account after you sign up.
You can use the OpenAI API to generate content. Here is an example of how you can do it:
import openai
openai.api_key = 'your-api-key'
response = openai.Completion.create(
engine="text-davinci-003",
prompt="Once upon a time,",
max_tokens=50
)
print(response.choices[0].text.strip())
You can type this code into your Python environment and run it.
The code also requires you to install the OpenAI Python package. You can install it using pip:
pip install openai
Start generating content
Run the Python script:
python your_script.py
The python your_script.py command runs your script and generates content.
Open your script and edit some lines: the content generates automatically and displays your changes.
You can customize the content according to your needs. This is a basic template to get you started with Generative AI using OpenAI.
Open docs/intro.md (this page) and edit some lines: the site reloads automatically and displays your changes.