-
-
Notifications
You must be signed in to change notification settings - Fork 520
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
Wrong JsonPropertyNames in OpenAI.SDK/ObjectModels/ResponseModels/CreateModerationResponse.cs #214
Comments
Thank you for bringing this to our attention. It appears to be a bug in the OpenAI.SDK/ObjectModels/ResponseModels/CreateModerationResponse.cs file where the special characters ("-", "/") are missing from the JsonPropertyNames for the "self-harm", "sexual/minors", "hate/threatening", and "violence/graphic" properties. To fix this issue, you can manually edit the CreateModerationResponse.cs file to add the missing special characters to the JsonPropertyNames. For example: [JsonPropertyName("sexual/minors")] [JsonPropertyName("hate/threatening")] [JsonPropertyName("violence/graphic")] Alternatively, you can wait for a patch or update from OpenAI that addresses this issue. In the meantime, you may want to implement additional checks and validations in your code to ensure that the correct properties and values are being used for moderation responses. |
Describe the bug
The corresponding JsonPropertyNames "self-harm", "sexual/minors", "hate/threatening" and "violence/graphic" within CreateModerationResponse.cs are mapped incorrectly. All eight occurrences within the file are missing their special characters ("-", "/"). This prevents SDK clients from correct decision making based on community guidelines and general terms and services when relying on moderation responses.
Result
Moderation requests with immanent violations currently result in incorrect scores and categories on four out of seven possible properties. The corresponding values either always return "false" or "0.0".
Expected behavior
The received moderation values from the openai-API should be correctly mapped and propagated to the SDK.
Screenshots
Desktop
Additional
I further recommend adjusting "Violencegraphic" to its UpperCamelCase version "ViolenceGraphic".
I further recommend replacing the float result types with either decimal or double, as of the already given double precision values originating from the openai-API.
Thank you! Keep up the good work.
The text was updated successfully, but these errors were encountered: