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

Connected

Exercise

Role-Based Inputs

Using the input and instructions arguments to provide string inputs has gotten you a long way, but sometimes, a role-based approach can better suit your application.

Here, you've been provided with a complete Responses API request, and your job is to update it to use role-based messages, keeping the prompts the same. This will set your application up for success when you begin to integrate image inputs.

Instructions

100 XP
  • Convert the input/instruction Responses request into the role-based messages format.