Package io.github.sashirestela.openai
Class SimpleOpenAI
- java.lang.Object
-
- io.github.sashirestela.openai.base.OpenAIProvider
-
- io.github.sashirestela.openai.SimpleOpenAI
-
- All Implemented Interfaces:
AssistantServices,AudioServices,BatchServices,ChatCompletionServices,CompletionServices,EmbeddingServices,FileServices,FineTunningServices,ImageServices,ModelServices,ModerationServices,RealtimeServices,ResponseServices,SessionServices,UploadServices
public class SimpleOpenAI extends OpenAIProvider implements AssistantServices, AudioServices, BatchServices, ChatCompletionServices, CompletionServices, EmbeddingServices, FileServices, FineTunningServices, ImageServices, ModelServices, ModerationServices, RealtimeServices, SessionServices, UploadServices, ResponseServices
The standard OpenAI implementation which implements the full services.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classSimpleOpenAI.StandardConfigurator
-
Field Summary
-
Fields inherited from class io.github.sashirestela.openai.base.OpenAIProvider
cleverClient, realtime
-
-
Constructor Summary
Constructors Constructor Description SimpleOpenAI(@NonNull String apiKey, String organizationId, String projectId, String baseUrl, HttpClient httpClient, io.github.sashirestela.cleverclient.client.HttpClientAdapter clientAdapter, io.github.sashirestela.cleverclient.retry.RetryConfig retryConfig, com.fasterxml.jackson.databind.ObjectMapper objectMapper, RealtimeConfig realtimeConfig)Constructor used to generate a builder.
-
Method Summary
-
Methods inherited from class io.github.sashirestela.openai.base.OpenAIProvider
getOrCreateService, shutDown
-
-
-
-
Constructor Detail
-
SimpleOpenAI
public SimpleOpenAI(@NonNull @NonNull String apiKey, String organizationId, String projectId, String baseUrl, HttpClient httpClient, io.github.sashirestela.cleverclient.client.HttpClientAdapter clientAdapter, io.github.sashirestela.cleverclient.retry.RetryConfig retryConfig, com.fasterxml.jackson.databind.ObjectMapper objectMapper, RealtimeConfig realtimeConfig)Constructor used to generate a builder.- Parameters:
apiKey- Identifier to be used for authentication. Mandatory.organizationId- Organization's id to be charged for usage. Optional.projectId- Project's id to provide access to a single project. Optional.baseUrl- Host's url, If not provided, it'll be 'https://api.openai.com'. Optional.httpClient- AHttpClientobject. One is created by default if not provided. Optional. Deprecated in favor of clientAdapter.clientAdapter- Component to make http services. If none is passed the JavaHttpClientAdapter will be used. Optional.retryConfig- Configuration for request retrying. If not provided, default values will be used. Optional.objectMapper- Provides Json conversions either to and from objects. Optional.realtimeConfig- Configuration for websocket Realtime API. Optional.
-
-
Method Detail
-
audios
public OpenAI.Audios audios()
- Specified by:
audiosin interfaceAudioServices
-
batches
public OpenAI.Batches batches()
- Specified by:
batchesin interfaceBatchServices
-
chatCompletions
public OpenAI.ChatCompletions chatCompletions()
- Specified by:
chatCompletionsin interfaceChatCompletionServices
-
completions
public OpenAI.Completions completions()
- Specified by:
completionsin interfaceCompletionServices
-
embeddings
public OpenAI.Embeddings embeddings()
- Specified by:
embeddingsin interfaceEmbeddingServices
-
files
public OpenAI.Files files()
- Specified by:
filesin interfaceFileServices
-
fineTunings
public OpenAI.FineTunings fineTunings()
- Specified by:
fineTuningsin interfaceFineTunningServices
-
images
public OpenAI.Images images()
- Specified by:
imagesin interfaceImageServices
-
models
public OpenAI.Models models()
- Specified by:
modelsin interfaceModelServices
-
moderations
public OpenAI.Moderations moderations()
- Specified by:
moderationsin interfaceModerationServices
-
uploads
public OpenAI.Uploads uploads()
- Specified by:
uploadsin interfaceUploadServices
-
sessionTokens
public OpenAI.SessionTokens sessionTokens()
- Specified by:
sessionTokensin interfaceSessionServices
-
responses
public OpenAI.Responses responses()
- Specified by:
responsesin interfaceResponseServices
-
assistants
public OpenAIBeta2.Assistants assistants()
- Specified by:
assistantsin interfaceAssistantServices
-
threads
public OpenAIBeta2.Threads threads()
- Specified by:
threadsin interfaceAssistantServices
-
threadMessages
public OpenAIBeta2.ThreadMessages threadMessages()
- Specified by:
threadMessagesin interfaceAssistantServices
-
threadRuns
public OpenAIBeta2.ThreadRuns threadRuns()
- Specified by:
threadRunsin interfaceAssistantServices
-
threadRunSteps
public OpenAIBeta2.ThreadRunSteps threadRunSteps()
- Specified by:
threadRunStepsin interfaceAssistantServices
-
vectorStores
public OpenAIBeta2.VectorStores vectorStores()
- Specified by:
vectorStoresin interfaceAssistantServices
-
vectorStoreFiles
public OpenAIBeta2.VectorStoreFiles vectorStoreFiles()
- Specified by:
vectorStoreFilesin interfaceAssistantServices
-
vectorStoreFileBatches
public OpenAIBeta2.VectorStoreFileBatches vectorStoreFileBatches()
- Specified by:
vectorStoreFileBatchesin interfaceAssistantServices
-
realtime
public OpenAIRealtime realtime()
- Specified by:
realtimein interfaceRealtimeServices
-
-