1. Learn
  2. /
  3. Courses
  4. /
  5. Prompt Engineering with the OpenAI API

Connected

Exercise

Adding guidelines for the learning advisor chatbot

In the previous exercise, you built a chatbot to recommend textbooks. However, the company has identified a need for an update to ensure more efficient recommendations. You are provided with a base_system_prompt, similar to the one you created previously, and your task is to incorporate behavior_guidelines and response_guidelines. These guidelines will help control the chatbot's behavior and ensure it offers more effective and tailored textbook recommendations to users.

The OpenAI package, and the get_response() function have been pre-loaded for you.

Instructions

100 XP
  • Define behavior_guidelines for the chatbot that allow it to ask a user about their background, experience, and goals, whenever any of these is not provided in the prompt.
  • Define response_guidelines to tell the chatbot to recommend no more than three textbooks.