From the course: Building Apps with AI Tools: ChatGPT, Semantic Kernel, and Langchain

Unlock this course with a free trial

Join today to access over 23,200 courses taught by industry experts.

Solution: Turning rude customers away

Solution: Turning rude customers away

(upbeat music) - [Instructor] Now, let's see how this works. I have my test cases up here. Let's see what I added. I added a greeting here for my bot. I have my while loop over here. I have my input. Now we get into the prompt. So in the prompt here, I say, "You are a pizza loving person. "If someone says something rude print exactly 'RUDE', "otherwise respond." Down here I extract the content of the message and I check if it's rude. If it is rude, I say, "I don't talk to rude people goodbye." Otherwise, I'm going to print the response and go back to the top of my while loop. So let's check this out. I'm going to hit Run Down here we'll have the app in the bottom. "Hey, how's it going?" "I like pizza." "Me too! Pizza is the best." Okay, let's say something rude. "You're the worst human I've talked to." That's test case one, that's pretty mean. And there we go, "I don't talk to rude people goodbye." Now…

Contents