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.34k stars 816 forks source link

报错:`请求openai异常,错误code:null`,这个错误貌似应用上层没办法捕捉? #166

Closed CodingOX closed 1 year ago

CodingOX commented 1 year ago
16:32:40.363 [main] ERROR com.unfbx.chatgpt.interceptor.DynamicKeyOpenAiAuthInterceptor - --------> 请求openai异常,错误code:null
16:32:40.366 [main] ERROR com.unfbx.chatgpt.interceptor.DynamicKeyOpenAiAuthInterceptor - --------> 请求异常:{
  "error": {
    "message": "The server had an error while processing your request. Sorry about that!",
    "type": "server_error",
    "param": null,
    "code": null
  }
}

Exception in thread "main" com.unfbx.chatgpt.exception.BaseException: The server had an error while processing your request. Sorry about that!
    at com.unfbx.chatgpt.interceptor.DynamicKeyOpenAiAuthInterceptor.intercept(DynamicKeyOpenAiAuthInterceptor.java:72)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
    at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
    at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
    at retrofit2.OkHttpCall.execute(OkHttpCall.java:204)
    at retrofit2.adapter.rxjava2.CallExecuteObservable.subscribeActual(CallExecuteObservable.java:46)
    at io.reactivex.Observable.subscribe(Observable.java:12284)
    at retrofit2.adapter.rxjava2.BodyObservable.subscribeActual(BodyObservable.java:35)
    at io.reactivex.Observable.subscribe(Observable.java:12284)
    at io.reactivex.internal.operators.observable.ObservableSingleSingle.subscribeActual(ObservableSingleSingle.java:35)
    at io.reactivex.Single.subscribe(Single.java:3666)
    at io.reactivex.Single.blockingGet(Single.java:2869)
    at com.unfbx.chatgpt.OpenAiClient.chatCompletion(OpenAiClient.java:658)
        xxxxxxxx
CodingOX commented 1 year ago

应该可以的,我代码问题。