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

make ONLINE JavaDoc availiable. Fix README #88

Open
stargazer33 opened this issue Jan 7, 2025 · 2 comments
Open

make ONLINE JavaDoc availiable. Fix README #88

stargazer33 opened this issue Jan 7, 2025 · 2 comments

Comments

@stargazer33
Copy link

stargazer33 commented Jan 7, 2025

OK, there is no working JavaDoc in IDE (see #72 ) but as a workaround - please create ONLINE JavaDoc. I really want to understand the idea behind some classes, especially the OpenAIClient.

OpenAIClient - what to do if my application is long-running and performs, let say, 10000 cals/day? The app not multi-threaded: one single thread which do /chat/completion sequentially.

Can one instance of OpenAIClient handle all these calls?
Should I create new instance for each call?
How expensive are these instances?
Should I close the OpenAIClient if my code exit? (because TCP sockets are not managed by garbage collector...)

Compare this class to okhttp3.OkHttpClient - it contains extensive JavaDoc describing things like "OkHttpClients should be shared", "Shutdown isn't necessary" etc...

Fix README:
instead of

builder.putAdditionalProperty("secret_param", JsonValue.from("4242"))

it is probably this:

builder.putAdditionalBodyProperty( "secret_param", JsonValue.from("4242"));
@TomerAberbach
Copy link
Collaborator

  1. We now have some javadocs! As mentioned in the other issue, please be patient as we go through and document more things. Regarding the client, using one instance for all of your calls makes sense (assuming you don't need a different client config for different calls). Shutdown should not be necessary because as you noted, okhttp3.OkHttpClient does not require shutdown. We also make an effort to automatically clean up resources that are left open (look for closeWhenPhantomReachable in our code to see what I mean)

  2. Top-level params objects use putAdditionalBodyProperty, since they also have putAdditionalHeaderProperty and putAdditionalQueryProperty, while internal objects that are entirely JSON, headers, or queries, use putAdditionalProperty. I'll get that into the README :)

@stargazer33
Copy link
Author

Looks good, just do not forget to describe OpenAIClient in your JavaDoc

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