From the course: Hands-On OpenAI API: Building a Real-World Solution

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Creating the assistant using the Assitants API

Creating the assistant using the Assitants API - OpenAI API Tutorial

From the course: Hands-On OpenAI API: Building a Real-World Solution

Creating the assistant using the Assitants API

- [Instructor] In this video, we're going to create the assistant that will be used by the KinderLogger solution. The thing about large language models is that they're stateless by nature. With the assistant API, we can create threaded conversations that automatically remember the previous messages. So let's import both OS and OpenAI, and then let's specify this model constant with the name of the model that we want to use in this case, GPT-3.5 turbo 1106. And then let's obtain the OpenAI API key environment variable value, and let's create the OpenAI client object. So now let's create a new viable named assistant. And here I want to invoke client beta assistance. Speaking of which, at the time of this recording, the assistance API is in a beta state. So client beta assistance, and then create. And we need to specify some of the parameters here, such as name. In this case, I want it to be KinderLogger. And then instructions, let's keep it simple. Something like you are an intelligent…

Contents