FileHandlerImpl

class FileHandlerImpl(requestHelper: RequestHelper, endpoint: String) : FileHandler

Constructors

Link copied to clipboard
constructor(requestHelper: RequestHelper, endpoint: String)

Functions

Link copied to clipboard

Attempts to delete the given file. To confirm deletion, you should check FileDeletionStatus.deleted.

open override fun delete(id: String): FileDeletionStatus

Attempts to delete the file with the given id. To confirm deletion, you should check FileDeletionStatus.deleted.

Link copied to clipboard
@Contract(pure = true)
open fun list(): ListFilesResponse

Lists the 20 most recent files.

open override fun list(request: ListFilesRequest?): ListFilesResponse

Lists files with the given query parameters.

Link copied to clipboard
@Contract(pure = true)
open fun retrieve(file: FileObject): FileObject

Retrieves the file associated with the given file. This method will return a new instance of the file, and will not modify the given instance.

open override fun retrieve(id: String): FileObject

Retrieve the file with the given id.

Link copied to clipboard
@Contract(pure = true)
open fun retrieveContents(file: FileObject): String

Retrieves the content of the given file.

open override fun retrieveContents(id: String): String

Retrieves the content of the file with the given id.

Link copied to clipboard
open override fun upload(request: UploadFileRequest): FileObject

Uploads the given file. Returns the data associated with the file, including the id (the id is useful for fine-tuning and assistants).