From the course: ChatGPT for Web Developers

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Create a chat completion and generate conversations

Create a chat completion and generate conversations - ChatGPT Tutorial

From the course: ChatGPT for Web Developers

Create a chat completion and generate conversations

- [Instructor] To get started with the project, we're going to find instructions under API Reference and here, Chats. So here we're going to see instructions as to how to create a chat completion. And here what you need to do is to define first a request. Inside this request, you're going to find the model. We're going to specify the model endpoints and the prompt will be a list of messages. So we can see an example request on the right. So first we configure the project with OpenAI with the OpenAI key and recreate an object OpenAI and from here we can then generate a completion. So we must specify the model and also the prompt which will be a list of messages. And from the top you can select the model and also select the library which will be the node JS library for our example. So from here, I can copy this example and go back to my projects. So we're going to complete it in order to get started. And first we need to…

Contents