From the course: OpenAI API for Python Developers
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Solution: Create a funny chatbot - part 2
From the course: OpenAI API for Python Developers
Solution: Create a funny chatbot - part 2
(upbeat music) - [Instructor] So let's continue with our funny chatbot challenge, and that's going to be part two. And you'll see that I have provided with an extra persona option if you'd like. And we're going to specify that you are a skilled standup comedian. Same below. You're going to say you are a skilled standup comedian with a knack for telling one to two sentence funny stories. And this is just to tell that we want you to act this way. And I am also providing with specific instructions as to how long we expect the completions to be. So we know that we can expect short but funny stories from the bot. So let's go here to complete our function here, which is to generate chat completions. And first we're going to create a message object. Remember that this is going to be a response with this format. We're going to access choices, then the first object, and then that's going to be message like this. And the next step will be to then add it to the list of messages, so we can add it…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Introduction to conversational AI2m 26s
-
(Locked)
Project setup and overview3m 11s
-
(Locked)
Authentication and configuration2m 38s
-
(Locked)
Define a system message with instructions2m 11s
-
(Locked)
Making requests and generating chat completions6m 6s
-
(Locked)
Challenge: Create a funny chatbot2m 11s
-
(Locked)
Solution: Create a funny chatbot - part 14m 26s
-
(Locked)
Solution: Create a funny chatbot - part 24m 51s
-
-
-
-
-