sashabaranov / go-openai

OpenAI ChatGPT, GPT-3, GPT-4, DALL·E, Whisper API wrapper for Go
Apache License 2.0
9.25k stars 1.42k forks source link

Adding new moderation model constants #875

Closed Mhjacobs closed 1 month ago

Mhjacobs commented 1 month ago

Describe the change This change enables go-openai to use the omni moderation models that are now available to us from openai. Provide OpenAI documentation link Provide a relevant API doc from https://platform.openai.com/docs/models/moderation

Describe your solution These changes define the constants for the new moderation models as specified by openAI, and then puts them into the map of allowed models for the moderation endpoint. I have tested these strings directly against the moderation api to confirm that these requests return a non-error response and specify the same model that is passed in. Tests Briefly describe how you have tested these changes. If possible — please add integration tests. Unit tests, with the addition of the new models.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.04%. Comparing base (774fc9d) to head (65da6fc). Report is 62 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #875 +/- ## ========================================== + Coverage 98.46% 99.04% +0.58% ========================================== Files 24 26 +2 Lines 1364 1461 +97 ========================================== + Hits 1343 1447 +104 + Misses 15 8 -7 Partials 6 6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.