Easy-open-ai
Easy-open-ai copied to clipboard
getAsync* methods are actually synchronous
All getAsync methods are actually synchronous.
For example, getAsyncChatCompletion (in AsyncDAOImpl) returns a POJO object: ChatCompletionResponse, and it should return a Future<ChatCompletionResponse>.
You create a CompletableFuture (all well for now), but the method ends in
return (ChatCompletionResponse)future.get();
Basically, it blocks the current thread until the future completes.
For the methods to be actually async they need to return Call<> or Future
@mircea-cm you are absolutely right, making a PR for this right now, should be fixed easily