OpenAIServiceWrapper
Attributes
- Graph
- Supertypes
Members list
Type members
Inherited classlikes
Attributes
- Inherited from:
- OpenAIServiceConsts
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
Value members
Abstract methods
Concrete methods
Immediately cancel a fine-tune job.
Immediately cancel a fine-tune job.
Attributes
- fineTuneId
The ID of the fine-tune job to cancel
- Returns:
fine tune info or None if not found
- See also:
- Definition Classes
Transcribes audio into the input language.
Transcribes audio into the input language.
Attributes
- file
The audio file to transcribe, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.
- prompt
An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language.
- Returns:
transcription text
- See also:
- Definition Classes
Translates audio into into English.
Translates audio into into English.
Attributes
- file
The audio file to translate, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.
- prompt
An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language.
- Returns:
translation text
- See also:
- Definition Classes
Creates a completion for the chat message(s).
Creates a completion for the chat message(s).
Attributes
- messages
The messages to generate chat completions.
- Returns:
chat completion response
- See also:
- Definition Classes
Creates a completion for the provided prompt and parameters.
Creates a completion for the provided prompt and parameters.
Attributes
- prompt
The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays. Note that <|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document.
- Returns:
text completion response
- See also:
- Definition Classes
Creates a new edit for the provided input, instruction, and parameters.
Creates a new edit for the provided input, instruction, and parameters.
Attributes
- input
The input text to use as a starting point for the edit.
- instruction
The instruction that tells the model how to edit the prompt.
- Returns:
text edit response
- See also:
- Definition Classes
Creates an embedding vector representing the input text.
Creates an embedding vector representing the input text.
Attributes
- input
Input text to get embeddings for, encoded as a string or array of tokens. To get embeddings for multiple inputs in a single request, pass an array of strings or array of token arrays. Each input must not exceed 8192 tokens in length.
- Returns:
list of embeddings inside an envelope
- See also:
- Definition Classes
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.
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.
Attributes
- training_file
The ID of an uploaded file that contains training data. See
uploadFile
for how to upload a file. Your dataset must be formatted as a JSONL file, where each training example is a JSON object with the keys "prompt" and "completion". Additionally, you must upload your file with the purpose fine-tune.- validation_file
The ID of an uploaded file that contains validation data. If you provide this file, the data is used to generate validation metrics periodically during fine-tuning. These metrics can be viewed in the fine-tuning results file. Your train and validation data should be mutually exclusive. Your dataset must be formatted as a JSONL file, where each validation example is a JSON object with the keys "prompt" and "completion". Additionally, you must upload your file with the purpose fine-tune.
- Returns:
fine tune response
- See also:
- Definition Classes
Creates an image given a prompt.
Creates an image given a prompt.
Attributes
- prompt
A text description of the desired image(s). The maximum length is 1000 characters.
- Returns:
image response (might contain multiple data items - one per image)
- See also:
- Definition Classes
Creates an edited or extended image given an original image and a prompt.
Creates an edited or extended image given an original image and a prompt.
Attributes
- image
The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask is not provided, image must have transparency, which will be used as the mask.
- mask
An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as image.
- prompt
A text description of the desired image(s). The maximum length is 1000 characters.
- Returns:
image response (might contain multiple data items - one per image)
- See also:
- Definition Classes
Creates a variation of a given image.
Creates a variation of a given image.
Attributes
- image
The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.
- Returns:
image response (might contain multiple data items - one per image)
- See also:
- Definition Classes
Classifies if text violates OpenAI's Content Policy.
Classifies if text violates OpenAI's Content Policy.
Attributes
- input
The input text to classify
- Returns:
moderation results
- See also:
- Definition Classes
Delete a file.
Delete a file.
Attributes
- fileId
The ID of the file to use for this request
- Returns:
enum indicating whether the file was deleted
- See also:
- Definition Classes
Delete a fine-tuned model. You must have the Owner role in your organization.
Delete a fine-tuned model. You must have the Owner role in your organization.
Attributes
- modelId
The ID of the file to use for this request
- Returns:
enum indicating whether the model was deleted
- See also:
- Definition Classes
Returns a list of files that belong to the user's organization.
Returns a list of files that belong to the user's organization.
Attributes
- Returns:
file infos
- See also:
- Definition Classes
Get fine-grained status updates for a fine-tune job.
Get fine-grained status updates for a fine-tune job.
Attributes
- fineTuneId
The ID of the fine-tune job to get events for.
- Returns:
fine tune events or None if not found
- See also:
- Definition Classes
List your organization's fine-tuning jobs.
List your organization's fine-tuning jobs.
Attributes
- Returns:
fine tunes
- See also:
- Definition Classes
Lists the currently available models, and provides basic information about each one such as the owner and availability.
Lists the currently available models, and provides basic information about each one such as the owner and availability.
Attributes
- Returns:
models
- See also:
- Definition Classes
Returns information about a specific file.
Returns information about a specific file.
Attributes
- fileId
The ID of the file to use for this request
- Returns:
file info or None if not found
- See also:
- Definition Classes
Returns the contents of the specified file.
Returns the contents of the specified file.
Attributes
- fileId
The ID of the file to use for this request
- Returns:
file content or None if not found
- See also:
- Definition Classes
Gets info about the fine-tune job.
Gets info about the fine-tune job.
Attributes
- fineTuneId
The ID of the fine-tune job
- Returns:
fine tune info
- See also:
- Definition Classes
Retrieves a model instance, providing basic information about the model such as the owner and permissions.
Retrieves a model instance, providing basic information about the model such as the owner and permissions.
Attributes
- modelId
The ID of the model to use for this request
- Returns:
model or None if not found
- See also:
- Definition Classes
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.
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.
Attributes
- displayFileName
(Explicit) display file name; if not specified a full path is used instead.
- file
Name of the JSON Lines file to be uploaded. If the purpose is set to "fine-tune", each line is a JSON record with "prompt" and "completion" fields representing your training examples.
- Returns:
file info
- See also:
- Definition Classes
Inherited methods
Closes the underlying ws client, and releases all its resources.
Closes the underlying ws client, and releases all its resources.
Attributes
- Inherited from:
- OpenAIService
Inherited fields
Attributes
- Inherited from:
- OpenAIServiceConsts
Attributes
- Inherited from:
- OpenAIServiceConsts
Attributes
- Inherited from:
- OpenAIServiceConsts
Attributes
- Inherited from:
- OpenAIServiceConsts
Attributes
- Inherited from:
- OpenAIServiceConsts