All Bundles

Conversation

Chat conversation assistant

Operations

New

Constructor

New(assistant:Assistant, enable_spinner:Bool, token:String)
Parameters
NameTypeDescription
assistantAssistantassistant
enable_spinnerBooltrue to enable console spinner, false to disable
tokenStringAPI token

Constructor

New(assistant:Assistant, token:String)
Parameters
NameTypeDescription
assistantAssistantassistant
tokenStringAPI token

AddFunction

Maps an OpenAI function call (via webhooks)

method : public : AddFunction(name:String, func:(JsonElement)~JsonElement) ~ Bool
Parameters
NameTypeDescription
nameStringOpenAI function name
func(JsonElement)~JsonElementfunction to map

Return
TypeDescription
Booltrue if successful, false otherwise

Close

Closes the chat session

method : public : Close() ~ Bool
Return
TypeDescription
Booltrue if successful, false otherwise

Send

Sends a message to the assistant

method : public : Send(query:String, user:String) ~ Message
Parameters
NameTypeDescription
queryStringmessage to send
userStringuser name

Return
TypeDescription
Messageresponse message, Nil of error