Package com.openai.client
Class OpenAIClientAsyncImpl
-
- All Implemented Interfaces:
-
com.openai.client.OpenAIClientAsync
public final class OpenAIClientAsyncImpl implements OpenAIClientAsync
-
-
Constructor Summary
Constructors Constructor Description OpenAIClientAsyncImpl(ClientOptions clientOptions)
-
Method Summary
Modifier and Type Method Description OpenAIClient
sync()
Returns a version of this client that uses synchronous execution. CompletionServiceAsync
completions()
ChatServiceAsync
chat()
EmbeddingServiceAsync
embeddings()
FileServiceAsync
files()
ImageServiceAsync
images()
ModerationServiceAsync
moderations()
ModelServiceAsync
models()
FineTuningServiceAsync
fineTuning()
BetaServiceAsync
beta()
BatchServiceAsync
batches()
UploadServiceAsync
uploads()
Unit
close()
Closes this client, relinquishing any underlying resources. -
-
Constructor Detail
-
OpenAIClientAsyncImpl
OpenAIClientAsyncImpl(ClientOptions clientOptions)
-
-
Method Detail
-
sync
OpenAIClient sync()
Returns a version of this client that uses synchronous execution.
The returned client shares its resources, like its connection pool and thread pools, with this client.
-
completions
CompletionServiceAsync completions()
-
chat
ChatServiceAsync chat()
-
embeddings
EmbeddingServiceAsync embeddings()
-
files
FileServiceAsync files()
-
images
ImageServiceAsync images()
-
moderations
ModerationServiceAsync moderations()
-
models
ModelServiceAsync models()
-
fineTuning
FineTuningServiceAsync fineTuning()
-
beta
BetaServiceAsync beta()
-
batches
BatchServiceAsync batches()
-
uploads
UploadServiceAsync uploads()
-
close
Unit close()
Closes this client, relinquishing any underlying resources.
This is purposefully not inherited from AutoCloseable because the client is long-lived and usually should not be synchronously closed via try-with-resources.
It's also usually not necessary to call this method at all. the default HTTP client automatically releases threads and connections if they remain idle, but if you are writing an application that needs to aggressively release unused resources, then you may call this method.
-
-
-
-