OpenAIService class abstract

Annotations
  • @ChopperApi()

Constructors

OpenAIService()

Properties

client ↔ ChopperClient
getter/setter pairinherited
definitionType Type
Used internally to retrieve the service from ChopperClient.
no setterinherited
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}) Future<Response<FineTune>>
Immediately cancel a fine-tune job.
createCompletion(CompletionRequest request) Future<Response<Completion>>
Creates a completion for the provided prompt and parameters
createEdit(EditRequest request) Future<Response<Edit>>
Creates a new edit for the provided input, instruction, and parameters
createEmbeddings(EmbeddingRequest request) Future<Response<Embedding>>
Creates an embedding vector representing the input text.
createFineTune(FineTuneRequest request) 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.
createImage(ImageRequest request) Future<Response<Data<ImageUrl>>>
Returns an image given a prompt.
createImageEdit(List<int> image, {required String prompt, List<int>? mask, int n = 1, String? size, String? responseFormat, String? user}) Future<Response<Data<ImageUrl>>>
Returns an edited or extended image given an original image and a prompt.
createImageVariation(List<int> image, {int n = 1, String? size, String? responseFormat, String? user}) Future<Response<Data<ImageUrl>>>
Returns a variation of a given image.
createModeration(ModerationRequest request) Future<Response<Moderation>>
Classifies if text violates OpenAI's Content Policy.
deleteFile({required String fileId}) Future<Response<DeleteResult>>
Delete a file.
deleteFineTune({required String fineTuneId}) Future<Response<DeleteResult>>
Delete a fine-tuned model. You must have the Owner role in your organization.
getFile({required String fileId}) Future<Response<File>>
Returns information about a specific file.
getFiles() Future<Response<Data<File>>>
Returns a list of files that belong to the user's organization.
getFineTune({required String fineTuneId}) Future<Response<FineTune>>
Gets info about the fine-tune job.
getFineTuneEvents({required String fineTuneId}) Future<Response<Data<FineTuneEvent>>>
Get fine-grained status updates for a fine-tune job.
getFineTunes() Future<Response<Data<FineTune>>>
List your organization's fine-tuning jobs.
getModel({required String modelId}) Future<Response<Model>>
Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
getModels() Future<Response<Data<Model>>>
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
toString() String
A string representation of this object.
inherited
uploadFile(String purpose, List<int> file) Future<Response<File>>
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.

Operators

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

Static Methods

create({required String apiToken, Uri? customUri, bool enableLogging = false}) OpenAIService
Returns the OpenAIService instance.

Constants

factories → const Map<Type, JsonFactory>
Factory methods to generate type from JSON
headerKeyAuthentication → const String
Key used in header