openai-php / client

⚡️ OpenAI PHP is a supercharged community-maintained PHP API client that allows you to interact with OpenAI API.
MIT License
4.98k stars 519 forks source link

Moderation Omni - New Categories (Illicit*) support. #495

Closed iBotPeaches closed 1 week ago

iBotPeaches commented 2 weeks ago

What:

Description:

The Omni Moderation models were released, thus deprecating the older models (now referred to as Legacy). This introduced the illicit and illicit/violent moderation category, but ONLY for Omni. This presented an issue as this library iterated all known types and assumed all models will have it.

Now we only set a Category if we have it and thus support partial support of Omni Moderation.

Ref: https://platform.openai.com/docs/guides/moderation

This does NOT add support for the new category_applied_input_types field.

gehrisandro commented 1 week ago

Thanks @iBotPeaches for the PR 🥳