Multi-Modal Systems with the OpenAI API
James Chapman
Curriculum Manager, DataCamp
Traditionally,
from openai import OpenAI client = OpenAI(api_key="ENTER API KEY")
response = client.moderations.create(
model="text-moderation-latest",
input="I could kill for a hamburger."
)
categories
true
/false
indicator of category violationcategory_scores
flagged
true
/false
indicator of a violationCategoryScores(harassment=2.775943e-05,
harassment_threatening=1.3526056e-06,
hate=2.733528e-07,
hate_threatening=4.930576e-08,
...,
violence=0.0500854030251503,
...)
Multi-Modal Systems with the OpenAI API