retrieve_file {openai}R Documentation

Retrieve file

Description

Provides information about a specific file. See this page for details.

Usage

retrieve_file(
  file_id,
  openai_api_key = Sys.getenv("OPENAI_API_KEY"),
  openai_organization = NULL
)

Arguments

file_id

required; a length one character vector.

openai_api_key

required; defaults to Sys.getenv("OPENAI_API_KEY") (i.e., the value is retrieved from the .Renviron file); a length one character vector. Specifies OpenAI API key.

openai_organization

optional; defaults to NULL; a length one character vector. Specifies OpenAI organization.

Details

For arguments description please refer to the official documentation.

Value

Returns a list, elements of which contains information about the file.

See Also

Other file functions: delete_file(), list_files(), retrieve_file_content(), upload_file()

Examples

## Not run: 
file <- system.file("extdata", "classification-file.jsonl", package = "openai")
file_info <- upload_file(file = file, purpose = "classification")
retrieve_file(file_info$id)

## End(Not run)

[Package openai version 0.4.1 Index]