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

Connected

Exercise

Specifying an OpenAI model

OpenAI offers multiple models for different use cases. In this exercise, you'll specify the model and define the role to structure your API requests.

The OpenAI class has already been imported for you from the openai library.

Instructions

100 XP
  • Specify the gpt-4o-mini model.
  • Assign the correct role in the messages list.