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

Connected

Exercise

Adding assistant messages

Chat models are great for creating conversational applications, but they can be further improved by providing part of a conversation for the model to build on.

Improve this geography tutor application by including this example student prompt and ideal model response in the messages:

  • Example Question: Give me a quick summary of Portugal.
  • Example Answer: Portugal is a country in Europe that borders Spain. The capital city is Lisboa.

Instructions

100 XP
  • Add the example question and answer provided as a user-assistant pair in the messages sent to the model.
    • Example Question: Give me a quick summary of Portugal.
    • Example Answer: Portugal is a country in Europe that borders Spain. The capital city is Lisboa.