Class OpenAIClientImpl
-
- All Implemented Interfaces:
-
com.openai.client.OpenAIClient
public final class OpenAIClientImpl implements OpenAIClient
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classOpenAIClientImpl.WithRawResponseImpl
-
Constructor Summary
Constructors Constructor Description OpenAIClientImpl(ClientOptions clientOptions)
-
Method Summary
Modifier and Type Method Description OpenAIClientAsyncasync()Returns a version of this client that uses asynchronous execution. OpenAIClient.WithRawResponsewithRawResponse()Returns a view of this service that provides access to raw HTTP responses for each method. OpenAIClientwithOptions(Consumer<ClientOptions.Builder> modifier)Returns a view of this service with the given option modifications applied. CompletionServicecompletions()Given a prompt, the model will return one or more predicted completions, and can also return the probabilities of alternative tokens at each position. ChatServicechat()EmbeddingServiceembeddings()Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms. FileServicefiles()Files are used to upload documents that can be used with features like Assistants and Fine-tuning. ImageServiceimages()Given a prompt and/or an input image, the model will generate a new image. AudioServiceaudio()ModerationServicemoderations()Given text and/or image inputs, classifies if those inputs are potentially harmful. ModelServicemodels()List and describe the various models available in the API. FineTuningServicefineTuning()GraderServicegraders()VectorStoreServicevectorStores()WebhookServicewebhooks()BetaServicebeta()BatchServicebatches()Create large batches of API requests to run asynchronously. UploadServiceuploads()Use Uploads to upload large files in multiple parts. ResponseServiceresponses()RealtimeServicerealtime()ConversationServiceconversations()Manage conversations and conversation items. EvalServiceevals()Manage and run evals in the OpenAI platform. ContainerServicecontainers()SkillServiceskills()VideoServicevideos()Unitclose()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.
-
withRawResponse
OpenAIClient.WithRawResponse withRawResponse()
Returns a view of this service that provides access to raw HTTP responses for each method.
-
withOptions
OpenAIClient withOptions(Consumer<ClientOptions.Builder> modifier)
Returns a view of this service with the given option modifications applied.
The original service is not modified.
-
completions
CompletionService completions()
Given a prompt, the model will return one or more predicted completions, and can also return the probabilities of alternative tokens at each position.
-
chat
ChatService chat()
-
embeddings
EmbeddingService embeddings()
Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.
-
files
FileService files()
Files are used to upload documents that can be used with features like Assistants and Fine-tuning.
-
images
ImageService images()
Given a prompt and/or an input image, the model will generate a new image.
-
audio
AudioService audio()
-
moderations
ModerationService moderations()
Given text and/or image inputs, classifies if those inputs are potentially harmful.
-
models
ModelService models()
List and describe the various models available in the API.
-
fineTuning
FineTuningService fineTuning()
-
graders
GraderService graders()
-
vectorStores
VectorStoreService vectorStores()
-
webhooks
WebhookService webhooks()
-
beta
BetaService beta()
-
batches
BatchService batches()
Create large batches of API requests to run asynchronously.
-
uploads
UploadService uploads()
Use Uploads to upload large files in multiple parts.
-
responses
ResponseService responses()
-
realtime
RealtimeService realtime()
-
conversations
ConversationService conversations()
Manage conversations and conversation items.
-
evals
EvalService evals()
Manage and run evals in the OpenAI platform.
-
containers
ContainerService containers()
-
skills
SkillService skills()
-
videos
VideoService videos()
-
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.
-
-
-
-