PlexPt / chatgpt-java

ChatGPT Java SDK。支持 GPT-4o、 GPT4 API。开箱即用。An unofficial Java SDK for seamless integration with ChatGPT's GPT-3.5 and GPT-4 APIs. Ready-to-use, simple setup, and efficient for building AI-powered applications.
https://chat.plexpt.com/
GNU General Public License v3.0
3.58k stars 704 forks source link

com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "completion_tokens_details" (class com.plexpt.chatgpt.entity.billing.Usage), not marked as ignorable (3 known properties: "prompt_tokens", "completion_tokens", "total_tokens"]) #320

Open 165149324 opened 1 month ago

165149324 commented 1 month ago

Exception in thread "main" java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "completion_tokens_details" (class com.plexpt.chatgpt.entity.billing.Usage), not marked as ignorable (3 known properties: "prompt_tokens", "completion_tokens", "total_tokens"]) at [Source: (okhttp3.ResponseBody$BomAwareReader); line: 22, column: 35] (through reference chain: com.plexpt.chatgpt.entity.chat.ChatCompletionResponse["usage"]->com.plexpt.chatgpt.entity.billing.Usage["completion_tokens_details"]) at io.reactivex.internal.util.ExceptionHelper.wrapOrThrow(ExceptionHelper.java:45) at io.reactivex.internal.observers.BlockingMultiObserver.blockingGet(BlockingMultiObserver.java:90)

OleksandrMiadelets commented 1 month ago

I have the same issue

PlexPt commented 1 month ago

show your code

wanggang1997 commented 1 month ago

api 更新了,我之前一直正确使用,现在也出现这个错误了: java.lang.RuntimeException: API调用异常: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "completion_tokens_details" (class com.plexpt.chatgpt.entity.billing.Usage), not marked as ignorable (3 known properties: "prompt_tokens", "completion_tokens", "total_tokens"]) at [Source: (okhttp3.ResponseBody$BomAwareReader); line: 22, column: 35] (through reference chain: com.plexpt.chatgpt.entity.chat.ChatCompletionResponse["usage"]->com.plexpt.chatgpt.entity.billing.Usage["completion_tokens_details"])

OleksandrMiadelets commented 1 month ago

Looks like ChatGPT started returning an extra field completion_tokens_details in entity Usage

PlexPt commented 1 month ago

updating

PlexPt commented 1 month ago

fixed

已修复, 5.1.1

wanggang1997 commented 1 month ago

maven仓库多久更新呢?目前还获取不到

PlexPt commented 1 month ago

数小时延迟