Learn R Programming

openaistream (version 0.2.0)

files: Files Class

Description

Files Class

Files Class

Arguments

Super class

openaistream::openai -> files

Methods

Inherited methods


Method upload()

Upload a file that can be used across various endpoints. The size of all the files uploaded by one organization can be up to 100 GB.The size of individual files can be a maximum of 512 MB or 2 million tokens for Assistants. See the Assistants Tools guide to learn more about the types of files supported. The Fine-tuning API only supports .jsonl files.

Usage

files$upload(path = NULL, verbosity = 0, purpose = "fine-tune")

Arguments

path

character Required. Path to the file that needs to be uploaded.

verbosity

numeric. Verbosity level for the API call(0:no output;1:show headers; 2:show headers and bodies;3: show headers, bodies, and curl status messages.).

purpose

The intended purpose of the uploaded file. Use "fine-tune" for Fine-tuning and "assistants" for Assistants and Messages. This allows us to validate the format of the uploaded file is correct for fine-tuning.

Returns

The uploaded File object.


Method list()

Returns a list of files that belong to the user's organization.

Usage

files$list(..., verbosity = 0)

Arguments

...

Additional parameters as required by the OpenAI API.For example:purpose

verbosity

numeric. Verbosity level for the API call(0:no output;1:show headers; 2:show headers and bodies;3: show headers, bodies, and curl status messages.).

Returns

A list of File objects.


Method delete()

Delete a file.

Usage

files$delete(file_id, verbosity = 0)

Arguments

file_id

character Required. The ID of the file to use for this request.

verbosity

numeric. Verbosity level for the API call(0:no output;1:show headers; 2:show headers and bodies;3: show headers, bodies, and curl status messages.).

Returns

Deletion status.


Method retrieve()

Returns information about a specific file.

Usage

files$retrieve(file_id, verbosity = 0)

Arguments

file_id

character Required. The ID of the file to retrieve details for.

verbosity

numeric. Verbosity level for the API call(0:no output;1:show headers; 2:show headers and bodies;3: show headers, bodies, and curl status messages.).

Returns

The File object matching the specified ID.


Method retrieve_content()

Returns information about a specific file content.

Usage

files$retrieve_content(file_id, verbosity = 0)

Arguments

file_id

character Required. The ID of the file to retrieve details for.

verbosity

numeric. Verbosity level for the API call(0:no output;1:show headers; 2:show headers and bodies;3: show headers, bodies, and curl status messages.).

Returns

The File object matching the specified ID.


Method clone()

The objects of this class are cloneable with this method.

Usage

files$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.