Package com.openai.client
Class OpenAIClientImpl
-
- All Implemented Interfaces:
-
com.openai.client.OpenAIClient
public final class OpenAIClientImpl implements OpenAIClient
-
-
Constructor Summary
Constructors Constructor Description OpenAIClientImpl(ClientOptions clientOptions)
-
Method Summary
Modifier and Type Method Description OpenAIClientAsync
async()
Returns a version of this client that uses asynchronous execution. CompletionService
completions()
ChatService
chat()
EmbeddingService
embeddings()
FileService
files()
ImageService
images()
ModerationService
moderations()
ModelService
models()
FineTuningService
fineTuning()
BetaService
beta()
BatchService
batches()
UploadService
uploads()
Unit
close()
Closes this client, relinquishing any underlying resources. -
-
Constructor Detail
-
OpenAIClientImpl
OpenAIClientImpl(ClientOptions clientOptions)
-
-
Method Detail
-
async
OpenAIClientAsync async()
Returns a version of this client that uses asynchronous execution.
The returned client shares its resources, like its connection pool and thread pools, with this client.
-
completions
CompletionService completions()
-
chat
ChatService chat()
-
embeddings
EmbeddingService embeddings()
-
files
FileService files()
-
images
ImageService images()
-
moderations
ModerationService moderations()
-
models
ModelService models()
-
fineTuning
FineTuningService fineTuning()
-
beta
BetaService beta()
-
batches
BatchService batches()
-
uploads
UploadService 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.
-
-
-
-