From the course: OpenAI API for Python Developers

Challenge: Create a funny chatbot

From the course: OpenAI API for Python Developers

Challenge: Create a funny chatbot

(upbeat music) - [Instructor] I really hope that you like the last example because the next one is about to get even more interesting and amusing, to say the least. For the next project, we are building another chatbot, but with a twist. We are infusing the chatbot with a comical persona and a good sense of humor. And for the next project, we use the same tools and follow the same steps. First, you're going to download the starter project, you're going to follow all the steps, install the packages here, which is going to be step three. Then you'll be ready to start the app. But before that, you must remember also to set up an API key to authorize API calls. And the plus for this new demonstration is that we create a user interface for our funny chat bots. And so we use StreamLit, which is an open source Python library, which is designed to create web applications with a user interface. And remember also that the key is to set up a system message to give instructions and context to the assistant bots. By defining a persona, you can help the bot behave as expected. For example, here you can then indicate that you are a helpful assistant, just like prompt engineering. So prompt engineering is the art of writing effective prompts to get the AI to behave as you want. And so the language model will shape and return the responses based on the wealth of knowledge that it was trained on and based on jokes, specifically for the next example. So after going through all the steps and instructions, you're going to run the app by running here with Streamlit Run Main.PY. Main.PY is the entry point of your application. So mine is already up and running. So we're going to see the results here. We're going to start this one and see how this looks. And so here it is. This is the starting points of your app. You can certainly change here the title with funny chatbots, and I recommend that you check out the documentation on StreamLit.io. You're going to see that the syntax is very easy. This is very easy and simple to get started with Streamlits. So now the stage is yours. Now this is your turn to shape and build a funny chatbot, AKA, also known as the AI standup comedian.

Contents