Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moderation: Update Response&Request #894

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

chenhhA
Copy link
Contributor

@chenhhA chenhhA commented Nov 10, 2024

Describe the change
Moderation

  • Add new response fields
  • Support new request formats

Provide OpenAI documentation link

Describe your solution

  • Add missed response filed
  • Add ModerationArrayRequest,ModerationStrArrayRequest f

Tests
modified TestModerations support three differenct reqeuest

Copy link

codecov bot commented Nov 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.70%. Comparing base (774fc9d) to head (afd0628).
Report is 77 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #894      +/-   ##
==========================================
+ Coverage   98.46%   98.70%   +0.24%     
==========================================
  Files          24       26       +2     
  Lines        1364     1778     +414     
==========================================
+ Hits         1343     1755     +412     
- Misses         15       16       +1     
- Partials        6        7       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ZeroYuJie
Copy link

hope this PR can be released as soon as possible.

IllicitViolent float32 `json:"illicit/violent"`
}

type CategoryAppliedInputType struct {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chenhhA thank you for the PR! In the OpenAI API reference, items here might contain text or image values, while ModerationItemType contains text and image_url.

Could you please add an integration test as well, it is challenging to nail down all the details!

Doc link: https://platform.openai.com/docs/api-reference/moderations/create?lang=curl

image

@chenhhA
Copy link
Contributor Author

chenhhA commented Dec 15, 2024

Hi @sashabaranov, I've added missed testcase, could you help me check this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants