v2026.5.3
All Bundles
Bundle OpenAI API client. Supports Chat Completions (GPT-4o, o1, etc.), Embeddings, Image Generation (DALL-E), and function/tool calling. Set OPENAI_API_KEY environment variable before use. Compile with -lib openai.

Assistant

Builds assistants that can call models and use tools to perform tasks

Inherits: EndPoint

Operations

AddFile #

Adds a file to assistant

method : public : AddFile(file:API.OpenAI.File) ~ Bool

Parameters

NameTypeDescription
fileFilefile to add to assistant

Return

TypeDescription
Booltrue if successful, false otherwise

Create # function

Create an assistant with a model and instructions

function : Create(model:String, token:String) ~ API.OpenAI.Assistant

Parameters

NameTypeDescription
modelStringID of the model to use
tokenStringAPI token

Return

TypeDescription
Assistantassistant

Create # function

Create an assistant with a model and instructions

function : Create(model:String, name:String, description:String, instructions:String, token:String) ~ API.OpenAI.Assistant

Parameters

NameTypeDescription
modelStringID of the model to use
nameStringname to use
descriptionStringdescription of the assistant.
instructionsStringthe system instructions that the assistant uses
tokenStringAPI token

Return

TypeDescription
Assistantnewly created assistant

Create # function

Creates an assistant with a model and instructions

function : Create(model:String, name:String, description:String, instructions:String, tools:Vector<String>, files:Vector<API.OpenAI.File>, token:String) ~ API.OpenAI.Assistant

Parameters

NameTypeDescription
modelStringID of the model to use
nameStringname to use
descriptionStringdescription of the assistant.
instructionsStringthe system instructions that the assistant uses
toolsVector<String>list of tool enabled on the assistant
filesVector<APIOpenAIFile>list of file IDs attached to this assistant
tokenStringAPI token

Return

TypeDescription
Assistantnewly created assistant

Create # function

Creates an assistant with a model and instructions

function : Create(model:String, name:String, description:String, instructions:String, tools:Vector<String>, files:Vector<API.OpenAI.File>, funcs:Vector<FunctionType>, token:String) ~ API.OpenAI.Assistant

Parameters

NameTypeDescription
modelStringID of the model to use
nameStringname to use
descriptionStringdescription of the assistant.
instructionsStringthe system instructions that the assistant uses
toolsVector<String>list of tool enabled on the assistant
filesVector<APIOpenAIFile>list of file IDs attached to this assistant
funcsVector<FunctionType>list of callback function definitions
tokenStringAPI token

Return

TypeDescription
Assistantnewly created assistant

Delete # function

Deletes an assistant with a model and instructions

function : Delete(id:String, token:String) ~ Bool

Parameters

NameTypeDescription
idStringmodel ID
tokenStringAPI token

Return

TypeDescription
Booltrue if successful, false otherwise

DeleteAll # function

Deletes all assistants

function : DeleteAll(token:String) ~ Bool

Parameters

NameTypeDescription
tokenStringAPI token

Return

TypeDescription
Booltrue if successful, false otherwise

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

GetDescription #

Description of the assistant

method : public : GetDescription() ~ String

Return

TypeDescription
Stringdescription of the assistant

GetId #

Get object instance API ID

method : public : GetId() ~ String

Return

TypeDescription
Stringinstance ID

GetInstructions #

System instructions that the assistant uses

method : public : GetInstructions() ~ String

Return

TypeDescription
Stringsystem instructions

GetModel #

ID of the model to use

method : public : GetModel() ~ String

Return

TypeDescription
StringID of the model to use

GetName #

Name of the assistant

method : public : GetName() ~ String

Return

TypeDescription
Stringname of the assistant

GetObject #

Get the object type

method : public : GetObject() ~ String

Return

TypeDescription
Stringobject type

GetVectorStores #

List of vector stores associated with the assistant

method : public : GetVectorStores() ~ Vector<String>

Return

TypeDescription
Vector<String>vector stores associated with the assistant

ListAssistants # function

Returns a list of assistants

function : ListAssistants(token:String) ~ Vector<API.OpenAI.Assistant>

Parameters

NameTypeDescription
tokenStringAPI token

Return

TypeDescription
Vector<APIOpenAIAssistant>list of assistants

Load # function

Loads an assistant with a model and instructions

function : Load(id:String, token:String) ~ API.OpenAI.Assistant

Parameters

NameTypeDescription
idStringmodel ID of the model to use
tokenStringAPI token

Return

TypeDescription
Assistantloaded assistant

LoadByName # function

Loads or creates an OpenAI file from the local filesystem

function : LoadByName(name:String, token:String) ~ API.OpenAI.Assistant

Parameters

NameTypeDescription
nameStringname lookup
tokenStringAPI token

Return

TypeDescription
Assistantfile reference

ToString #

String representation of the object

method : public : ToString() ~ String

Return

TypeDescription
Stringstring representation