All Bundles

File

Open AI file

Derived from: EndPoint

Operations

Create

Upload a file that can be used across various endpoints

function : Create(name:String, content:Byte[], token:String) ~ Bool
Parameters
NameTypeDescription
nameStringfile object name
contentByte[]file content
tokenStringAPI token

Return
TypeDescription
Boolstring representation

Delete

Deletes a file

function : Delete(id:String, token:String) ~ Bool
Parameters
NameTypeDescription
idStringfile ID
tokenStringAPI token

Return
TypeDescription
Booltrue if successful, false otherwise

GetBytes

Get the size of the file

method : public : GetBytes() ~ Int
Return
TypeDescription
Intsize of the file

GetCreatedAt

Unix timestamp (in seconds) of when the object instance was created

method : public : GetCreatedAt() ~ Int
Return
TypeDescription
Inttime with the object instance was created

GetFilename

Get the name of the file

method : public : GetFilename() ~ String
Return
TypeDescription
Stringname of the file

GetId

Get object instance API ID

method : public : GetId() ~ String
Return
TypeDescription
Stringinstance ID

GetObject

Get the object type

method : public : GetObject() ~ String
Return
TypeDescription
Stringobject type

GetPurpose

Get the purpose

method : public : GetPurpose() ~ String
Return
TypeDescription
Stringpurpose

ListFiles

Loads a list available OpenAI files

function : ListFiles(token:String) ~ Vector<API.OpenAI.File>
Parameters
NameTypeDescription
tokenStringAPI token

Return
TypeDescription
File<>file reference

Load

Loads a file

function : Load(id:String, token:String) ~ API.OpenAI.File
Parameters
NameTypeDescription
idStringfile ID
tokenStringAPI token

Return
TypeDescription
Filefile reference

LoadByName

Loads an OpenAI file from the local filesystem

function : LoadByName(filename:String, token:String) ~ API.OpenAI.File
Parameters
NameTypeDescription
filenameStringlocal file path
tokenStringAPI token

Return
TypeDescription
Filefile reference

LoadOrCreate

Loads or creates an OpenAI file from the local filesystem

function : LoadOrCreate(filename:String, token:String) ~ API.OpenAI.File
Parameters
NameTypeDescription
filenameStringlocal file path
tokenStringAPI token

Return
TypeDescription
Filefile reference

Retrieve

Returns the contents of the specified file

function : Retrieve(id:String, token:String) ~ Byte[]
Parameters
NameTypeDescription
idStringfile ID
tokenStringAPI token

Return
TypeDescription
Byte[]file content

ToString

String representation of the object

method : public : ToString() ~ String
Return
TypeDescription
Stringstring representation