fileFromPath

fun fileFromPath(path: String, purpose: OpenAIFilePurpose = defaultPurpose)

Loads a file from the given path and adds it to the upload list.

Parameters

path

The path to the file.

purpose

The file's purpose. Defaults to defaultPurpose.

Throws

if the file does not exist.