Grt1228 / chatgpt-java

ChatGPT Java SDK支持流式输出、Gpt插件、联网。支持OpenAI官方所有接口。ChatGPT的Java客户端。OpenAI GPT-3.5-Turb GPT-4 Api Client for Java
https://chatgpt-java.unfbx.com
Apache License 2.0
3.31k stars 811 forks source link

openAI的Moderation接口,Categories有更新,接口调用抛出异常 #178

Closed sjl1989 closed 1 year ago

sjl1989 commented 1 year ago

openAi的接口新增了新类型,https://platform.openai.com/docs/guides/moderation/overview

调用时返回异常: java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "harassment" (class com.unfbx.chatgpt.entity.moderations.Categories), not marked as ignorable (7 known properties: "sexual/minors", "violence/graphic", "self-harm", "hate", "violence", "sexual", "hate/threatening"]) at [Source: okhttp3.ResponseBody$BomAwareReader@27b74cb4; line: 1, column: 162] (through reference chain: com.unfbx.chatgpt.entity.moderations.ModerationResponse["results"]->java.util.ArrayList[0]->com.unfbx.chatgpt.entity.moderations.Result["categories"]->com.unfbx.chatgpt.entity.moderations.Categories["harassment"])

Grt1228 commented 1 year ago

@sjl1989 谢谢你分反馈。

openAi的接口新增了新类型,https://platform.openai.com/docs/guides/moderation/overview

调用时返回异常: java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "harassment" (class com.unfbx.chatgpt.entity.moderations.Categories), not marked as ignorable (7 known properties: "sexual/minors", "violence/graphic", "self-harm", "hate", "violence", "sexual", "hate/threatening"]) at [Source: okhttp3.ResponseBody$BomAwareReader@27b74cb4; line: 1, column: 162] (through reference chain: com.unfbx.chatgpt.entity.moderations.ModerationResponse["results"]->java.util.ArrayList[0]->com.unfbx.chatgpt.entity.moderations.Result["categories"]->com.unfbx.chatgpt.entity.moderations.Categories["harassment"])