You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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...
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)
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 :)
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
it is probably this:
The text was updated successfully, but these errors were encountered: