OpenAIApi class

Constructors

OpenAIApi(Dio _dio, Serializers _serializers)
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

cancelFineTune({required String fineTuneId, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<FineTune>>
Immediately cancel a fine-tune job.
createAnswer({required CreateAnswerRequest createAnswerRequest, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<CreateAnswerResponse>>
Answers the specified question using the provided documents and examples. The endpoint first searches over provided documents or files to find relevant context. The relevant context is combined with the provided examples and question to create the prompt for completion.
createChatCompletion({required CreateChatCompletionRequest createChatCompletionRequest, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<CreateChatCompletionResponse>>
Creates a completion for the chat message
createClassification({required CreateClassificationRequest createClassificationRequest, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<CreateClassificationResponse>>
Classifies the specified `query` using provided examples. The endpoint first searches over the labeled examples to select the ones most relevant for the particular query. Then, the relevant examples are combined with the query to construct a prompt to produce the final label via the completions endpoint. Labeled examples can be provided via an uploaded `file`, or explicitly listed in the request using the `examples` parameter for quick tests and small scale use cases.
createCompletion({required CreateCompletionRequest createCompletionRequest, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<CreateCompletionResponse>>
Creates a completion for the provided prompt and parameters
createEdit({required CreateEditRequest createEditRequest, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<CreateEditResponse>>
Creates a new edit for the provided input, instruction, and parameters.
createEmbedding({required CreateEmbeddingRequest createEmbeddingRequest, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<CreateEmbeddingResponse>>
Creates an embedding vector representing the input text.
createFile({required MultipartFile file, required String purpose, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<OpenAIFile>>
Upload a file that contains document(s) to be used across various endpoints/features. Currently, the size of all the files uploaded by one organization can be up to 1 GB. Please contact us if you need to increase the storage limit.
createFineTune({required CreateFineTuneRequest createFineTuneRequest, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<FineTune>>
Creates a job that fine-tunes a specified model from a given dataset. Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete. Learn more about Fine-tuning
createImage({required CreateImageRequest createImageRequest, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<ImagesResponse>>
Creates an image given a prompt.
createImageEdit({required MultipartFile image, required String prompt, MultipartFile? mask, int? n, String? size, String? responseFormat, String? user, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<ImagesResponse>>
Creates an edited or extended image given an original image and a prompt.
createImageVariation({required MultipartFile image, int? n, String? size, String? responseFormat, String? user, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<ImagesResponse>>
Creates a variation of a given image.
createModeration({required CreateModerationRequest createModerationRequest, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<CreateModerationResponse>>
Classifies if text violates OpenAI's Content Policy
createSearch({required String engineId, required CreateSearchRequest createSearchRequest, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<CreateSearchResponse>>
The search endpoint computes similarity scores between provided query and documents. Documents can be passed directly to the API if there are no more than 200 of them. To go beyond the 200 document limit, documents can be processed offline and then used for efficient retrieval at query time. When `file` is set, the search endpoint searches over all the documents in the given file and returns up to the `max_rerank` number of documents. These documents will be returned along with their search scores. The similarity score is a positive score that usually ranges from 0 to 300 (but can sometimes go higher), where a score above 200 usually means the document is semantically similar to the query.
createTranscription({required MultipartFile file, required String model, String? prompt, String? responseFormat, num? temperature, String? language, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<CreateTranscriptionResponse>>
Transcribes audio into the input language.
createTranslation({required MultipartFile file, required String model, String? prompt, String? responseFormat, num? temperature, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<CreateTranslationResponse>>
Translates audio into into English.
deleteFile({required String fileId, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<DeleteFileResponse>>
Delete a file.
deleteModel({required String model, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<DeleteModelResponse>>
Delete a fine-tuned model. You must have the Owner role in your organization.
downloadFile({required String fileId, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<String>>
Returns the contents of the specified file
listEngines({CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<ListEnginesResponse>>
Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
listFiles({CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<ListFilesResponse>>
Returns a list of files that belong to the user's organization.
listFineTuneEvents({required String fineTuneId, bool? stream = false, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<ListFineTuneEventsResponse>>
Get fine-grained status updates for a fine-tune job.
listFineTunes({CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<ListFineTunesResponse>>
List your organization's fine-tuning jobs
listModels({CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<ListModelsResponse>>
Lists the currently available models, and provides basic information about each one such as the owner and availability.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
retrieveEngine({required String engineId, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<Engine>>
Retrieves a model instance, providing basic information about it such as the owner and availability.
retrieveFile({required String fileId, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<OpenAIFile>>
Returns information about a specific file.
retrieveFineTune({required String fineTuneId, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<FineTune>>
Gets info about the fine-tune job. Learn more about Fine-tuning
retrieveModel({required String model, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<Model>>
Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited