Jump-starting the ChatGPT API
The original ChatGPT is a GPT-3.5 model that includes GPT-3.5-turbo. These models are an evolution of the GPT-3 model. You are just a step away from home. But what a step!
Open Jump_Starting_ChatGPT_with_the_OpenAI_API.ipynb
.
Install and import OpenAI and enter the API key.
This is the same process applied in Chapter 7, The Rise of Suprahuman Transformers with GPT-3 Engines. Review this chapter if necessary.
Content generation
OpenAI has introduced an innovative request approach:
- The request is formulated with a ChatCompletion call.
- The model called is
gpt-3.5-turbo
, a powerful conversational AI better known to the public as ChatGPT. - Each object of a message has a role: system, assistant, and user. The system role can be a general message, the assistant can provide factual information for the model, and the user role contains the core of the request. Once our prompt is designed, we run it:
response=openai...