From the course: Fine-Tune Your LLMs

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Solution: Develop a chatbot based on a fine-tuned model

Solution: Develop a chatbot based on a fine-tuned model

From the course: Fine-Tune Your LLMs

Start my 1-month free trial

Solution: Develop a chatbot based on a fine-tuned model

(upbeat dance music) - [Instructor] How did you do? Let's look at how I solved this challenge. Here we are in code spaces. I've already executed all the cells in this notebook for efficiency. Don't forget to put your API key in a local environment variable or hard code it within the notebook before executing the code. Let's scroll down to cell 57, all the way at the bottom. The section is the Customer Support Chatbot. The first step is to set the persona for the AI assistant. I'm using an array to keep track of the conversation history. The first message I set is the system message, and it says, "This is a customer support chatbot designed to help with common inquiries for Kesha's Boutique." Remember, the goal is to manage a multi-turn conversation, which is a back and forth dialogue with ChatGPT. When holding a multi-turn conversation, we'll need to send the entire conversation history with each request. I've created this collect messages function that keeps track of the messages…

Contents