1. Learn
  2. /
  3. Courses
  4. /
  5. Multi-Modal Systems with the OpenAI API

Connected

Exercise

Moderating the customer call

To ensure quality and safety, you'll now moderate the processed customer message. This step helps identify and flag potentially inappropriate content such as harassment.

The corrected transcript from the previous exercise is available as corrected_text.

Instructions

100 XP
  • Create a moderation request with corrected_text as input.
  • Extract response's category scores and convert them to a dictionary using .model_dump().
  • Extract the harassment score from the scores dictionary and check if it is greater than 0.8.