-
Notifications
You must be signed in to change notification settings - Fork 46
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
OpenAIClient: implement close() #128
Comments
Which service methods are you using by the way? I'd be interested to understand if we're missing closing a response body somewhere in the SDK. That seems not entirely related to making I do think having a openai-java/openai-java-core/src/main/kotlin/com/openai/core/http/AsyncStreamResponse.kt Lines 15 to 21 in fb0d4a6
|
yes, just the
I would like to understand it too! Bloody async. code, a bit difficult to debug )) The general idea: |
You didn't answer my question about which methods you're using |
Methods used:
Wait! In the past I was using maxRetries(1) and saw |
I stared at the code a bit today and I think we're not properly closing failed responses in all cases when retrying Planning to write some more tests and fix it this upcoming week |
A good thing would be to change the log level of this message:
One of the reasons I do not see it any more - I do not run my application with log level set to FINE. You are controlling everything related to okhttp3.OkHttpClient - pls change the log level to WARNING |
The
com.openai.client.OpenAIClient
has no close() method.Please implement it!
Better: implement AutoClosable
Additional info:
com.openai.client.okhttp.OkHttpClient
haspublic void close()
Running my code using OpenAIClient I get (sometimes) this text in log:
It can be that my code is not correct: having OpenAIClient.close() would prevent this.
The text was updated successfully, but these errors were encountered: