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

Explain OpenAIOkHttpClientAsync (In JavaDoc and in README) #138

Open
stargazer33 opened this issue Jan 18, 2025 · 1 comment
Open

Explain OpenAIOkHttpClientAsync (In JavaDoc and in README) #138

stargazer33 opened this issue Jan 18, 2025 · 1 comment

Comments

@stargazer33
Copy link

stargazer33 commented Jan 18, 2025

I am thinking about using this library in async. way.
I see com.openai.client.okhttp.OpenAIOkHttpClientAsync

Would be great to have explanation and example of async calls.

First of all: async. calls to /chat/completion API

@TomerAberbach
Copy link
Collaborator

Yes, agreed we should have documentation on async in the README!

For now, you can construct the client the same way and then call async() to swap to async client. Then pretty much all the methods and parameters and response types are the same. The only difference is whether CompletableFuture is returned or AsyncStreamResponse (instead of just StreamResponse). Should be mostly self-explanatory for now, but let me know if you encounter any specific confusions and I can make sure those are included in the documentation when we tackle that

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

2 participants