1. 学习
  2. /
  3. 课程
  4. /
  5. Multi-Modal Systems with the OpenAI API

Connected

练习

Moderating the model response

Even though the chatbot has generated a tailored response, it's important to verify that the content is safe to send to the customer. In this step, you'll moderate the response to ensure all category scores fall below the customer safety threshold.

The model's reply from the previous exercise is available as chatbot_reply.

说明

100 XP
  • Send a moderation request with chatbot_reply as input.
  • Extract the response's category scores, convert them to a dictionary using .model_dump(), and check if any score exceeds 0.7.