質問編集履歴
2
前回の修正に伴う文章の微修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
主に参考にしているのは[こちら](https://qiita.com/blue_islands/items/dd078af9266960a777c4)の記事で,[TheoKanning/openai-java](https://github.com/TheoKanning/openai-java)を利用しています.
|
4
4
|
EclipseでMavenを使って下記のコードを実行しても,結果表示が出る前にエラーとなってしまいます.
|
5
|
-
どうやら20行目で
|
5
|
+
どうやら20行目のところでタイムアウトしているようですが,原因がよくわからず困っています.
|
6
6
|
|
7
7
|
あとこの件と関係があるのかはわかりませんが,Eclipse上でソースコードの`OpenAiService`の部分に取り消し線がついているのですが,これはなぜなのでしょうか.
|
8
8
|
|
1
使用していたキーの間違いによる,エラーメッセージの変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -42,17 +42,44 @@
|
|
42
42
|
|
43
43
|
### エラーメッセージ
|
44
44
|
```
|
45
|
-
JavaでGPT3のAPIを使う方法を教えてください.
|
45
|
+
JavaをでGPT3のAPIを使う方法を教えてください.
|
46
|
-
Exception in thread "main"
|
46
|
+
Exception in thread "main" java.lang.RuntimeException: java.net.SocketTimeoutException: timeout
|
47
|
+
at io.reactivex.internal.util.ExceptionHelper.wrapOrThrow(ExceptionHelper.java:45)
|
47
|
-
at ret
|
48
|
+
at io.reactivex.internal.observers.BlockingMultiObserver.blockingGet(BlockingMultiObserver.java:90)
|
49
|
+
at io.reactivex.Single.blockingGet(Single.java:2002)
|
50
|
+
at com.theokanning.openai.OpenAiService.createCompletion(OpenAiService.java:122)
|
51
|
+
at test_gpt.GPT3Chatbot.main(GPT3Chatbot.java:20)
|
52
|
+
Caused by: java.net.SocketTimeoutException: timeout
|
53
|
+
at okhttp3.internal.http2.Http2Stream$StreamTimeout.newTimeoutException(Http2Stream.java:678)
|
54
|
+
at okhttp3.internal.http2.Http2Stream$StreamTimeout.exitAndThrowIfTimedOut(Http2Stream.java:686)
|
55
|
+
at okhttp3.internal.http2.Http2Stream.takeHeaders(Http2Stream.java:154)
|
56
|
+
at okhttp3.internal.http2.Http2ExchangeCodec.readResponseHeaders(Http2ExchangeCodec.java:136)
|
57
|
+
at okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.java:115)
|
58
|
+
at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:94)
|
59
|
+
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
|
60
|
+
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:43)
|
61
|
+
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
|
62
|
+
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
|
63
|
+
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94)
|
64
|
+
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
|
65
|
+
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
|
48
|
-
at
|
66
|
+
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
|
67
|
+
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
|
68
|
+
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88)
|
69
|
+
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
|
70
|
+
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
|
71
|
+
at com.theokanning.openai.AuthenticationInterceptor.intercept(AuthenticationInterceptor.java:26)
|
72
|
+
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
|
73
|
+
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
|
74
|
+
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:229)
|
75
|
+
at okhttp3.RealCall.execute(RealCall.java:81)
|
76
|
+
at retrofit2.OkHttpCall.execute(OkHttpCall.java:204)
|
49
|
-
at retrofit2.adapter.rxjava2.CallExecuteObservable.subscribeActual(CallExecuteObservable.java:4
|
77
|
+
at retrofit2.adapter.rxjava2.CallExecuteObservable.subscribeActual(CallExecuteObservable.java:46)
|
50
78
|
at io.reactivex.Observable.subscribe(Observable.java:10151)
|
51
79
|
at retrofit2.adapter.rxjava2.BodyObservable.subscribeActual(BodyObservable.java:35)
|
52
80
|
at io.reactivex.Observable.subscribe(Observable.java:10151)
|
53
81
|
at io.reactivex.internal.operators.observable.ObservableSingleSingle.subscribeActual(ObservableSingleSingle.java:35)
|
54
82
|
at io.reactivex.Single.subscribe(Single.java:2517)
|
55
83
|
at io.reactivex.Single.blockingGet(Single.java:2001)
|
56
|
-
at com.theokanning.openai.OpenAiService.createCompletion(OpenAiService.java:122)
|
57
|
-
|
84
|
+
... 2 more
|
58
85
|
```
|