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

Connected

Exercise

Providing context through sample conversations

Suppose there is a delivery service named MyPersonalDelivery that offers a wide range of delivery options for various items. You want to create a customer service chatbot that supports customers with whatever they need. To accomplish this, you will provide a context_question and a context_answer about items the company delivers via previous conversations, and you will test if the model recognizes this context through a new user prompt.

The OpenAI package, the context_question and context_answer strings have been pre-loaded for you.

Instructions

100 XP
  • Define a system_prompt that defines the purpose of the chatbot and guides it to answer queries in a gentle way.
  • Use the system_prompt, the context_question, and context_answer to formulate a conversation that the chatbot can use as context in order to respond to the new user query.