dart_openai library

Classes

OpenAI
The main class of the package. It is a singleton class, so you can only have one instance of it. You can also access the instance by calling the OpenAI.instance getter.
OpenAIAudioModel
This class is responsible for handling all audio requests, such as creating a transcription or translation for a given audio file.
OpenAIChatCompletionChoiceMessageModel
This represents the message of the OpenAIChatCompletionChoiceModel model of the OpenAI API, which is used and get returned while using the OpenAIChat methods.
OpenAIChatCompletionChoiceModel
This class represents a choice of the OpenAIChatCompletionModel model of the OpenAI API, which is used and get returned while using the OpenAIChat methods.
OpenAIChatCompletionModel
This class represents the chat completion response model of the OpenAI API, which is used and get returned while using the OpenAIChat methods.
OpenAIChatCompletionUsageModel
This class represents the chat completion usage model of the OpenAI API, which is used and get returned while using the OpenAIChat methods.
OpenAICompletionModel
This represents the response from a completion request.
OpenAICompletionModelChoice
This class is used to represent a choice generated by a completion request.
OpenAICompletionModelUsage
This represents the usage of a completion response.
OpenAIEditModel
This class is used to represent an OpenAI edit.
OpenAIEditModelChoice
This class is used to represent a choice generated by an OpenAI edit.
OpenAIEditModelUsage
This class is used to represent the usage of an OpenAI completion.
OpenAIEmbeddingsDataModel
This class is used to represent the data returned by an OpenAI embeddings request.
OpenAIEmbeddingsModel
This class is used to represent an OpenAI embeddings request.
OpenAIEmbeddingsUsageModel
This class is used to represent the usage of an OpenAI embeddings.
OpenAIFileModel
This class is used to represent an OpenAI file.
OpenAIFineTuneEventModel
This class is used to represent an OpenAI fine-tune event.
OpenAIFineTuneEventStreamModel
Creates a new instance of OpenAIFineTuneEventStreamModel.
OpenAIFineTuneHyperParamsModel
This class is used to represent the hyper-parameters used for fine-tuning.
OpenAIFineTuneModel
This class is used to represent an OpenAI fine-tuning job.
OpenAIFineTuneTrainingFilesModel
This class is used to represent an OpenAI fine-tune training file.
OpenAIImageData
OpenAIImageEditDataModel
OpenAiImageEditModel
OpenAIImageModel
OpenAIImageVariationModel
OpenAIModelModel
OpenAIModelModelPermission
OpenAIModerationModel
OpenAIModerationResultCategoriesModel
OpenAIModerationResultModel
OpenAIModerationResultScoresModel
OpenAIStreamChatCompletionChoiceDeltaModel
This contains the role and content of the choice of the chat response.
OpenAIStreamChatCompletionChoiceModel
The OpenAIStreamChatCompletionChoiceModel class represents the chat completion choice response model of the OpenAI API, which is used and get returned while using the chat methods that leverages Stream functionality.
OpenAIStreamChatCompletionModel
The OpenAIStreamChatCompletionModel class represents the chat completion response model of the OpenAI API, which is used and get returned while using the chat methods that leverages Stream functionality.
OpenAIStreamChatCompletionUsageModel
The OpenAIStreamChatCompletionUsageModel class represents the usage model of the OpenAI API, which is used and get returned while using the chat methods that leverages Stream functionality.
OpenAIStreamCompletionModel
This class is used to represent an OpenAI stream completion.
OpenAIStreamCompletionModelChoice
This class is used to represent a choice generated by an OpenAI stream completion.
OpenAIVariationData

Exceptions / Errors

MissingApiKeyException
This exception is thrown when the API key is not set and the user tries to make a request.
RequestFailedException
This exception is thrown when a request fails, from the API.