Skip to content
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

Open
stargazer33 opened this issue Jan 16, 2025 · 0 comments
Open

OpenAIClient: implement close() #128

stargazer33 opened this issue Jan 16, 2025 · 0 comments

Comments

@stargazer33
Copy link

The com.openai.client.OpenAIClient has no close() method.
Please implement it!
Better: implement AutoClosable

Additional info:
com.openai.client.okhttp.OkHttpClient has public void close()

Running my code using OpenAIClient I get (sometimes) this text in log:

okhttp3.OkHttpClient           A connection to <url> was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);

It can be that my code is not correct: having OpenAIClient.close() would prevent this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant