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 represents the audio model of the OpenAI API, which is used and get returned while using the OpenAIAudio methods.
OpenAIChatCompletionChoiceMessageContentItemModel
This represents the content item of the OpenAIChatCompletionChoiceMessageModel model of the OpenAI API, which is used in the OpenAIChat methods.
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 by the OpenAICompletion methods.
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 method is used to convert a Map<String, dynamic> object to a OpenAIEditModelUsage object.
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.
OpenAIFunctionModel
This class is used to represent an OpenAI function.
OpenAIFunctionProperty
This class is used to represent an OpenAI function property.
OpenAIImageData
This class is used to represent an OpenAI image data.
OpenAIImageModel
OpenAIModelModel
This class is used to represent an OpenAI model.
OpenAIModerationModel
This class is used to represent an OpenAI moderation job.
OpenAIModerationResultCategoriesModel
This class is used to represent an OpenAI moderation job result categories.
OpenAIModerationResultModel
This class is used to represent an OpenAI moderation job result.
OpenAIModerationResultScoresModel
This class is used to represent an OpenAI moderation job result scores.
OpenAIResponseToolCall
This represents the tool call of the OpenAIChatCompletionChoiceMessageModel model of the OpenAI API, which is used and get returned while using the OpenAIChat methods.
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.
OpenAIStreamResponseToolCall
This represents the stream tool call of the OpenAIChatCompletionChoiceMessageModel model of the OpenAI API, which is used and get returned while using the OpenAIChat methods.
OpenAIToolModel
This class is used to represent an OpenAI tool.
RequestFunctionMessage
This represents the message of the RequestFunctionMessage model of the OpenAI API, which is used while using the OpenAIChat methods, precisely to send a response function message as a request function message for next requests.
Segment
Word

Exceptions / Errors

MissingApiKeyException
This exception is thrown when the API key is not set and the user tries to make a request.
OpenAIUnexpectedException
This exception is thrown when an unexpected non-error response is got, this means that the response from the request does not have an error sign (the error field), but it is not no the success response as well.
RequestFailedException
This exception is thrown when a request fails, from the API.