v2026.5.3
All Bundles
Bundle Ollama local LLM client. Runs models (Llama, Mistral, Phi, etc.) locally via the Ollama server. Supports streaming completions, chat sessions, embeddings, and model management. Compile with -lib ollama.

Chat

Ollama chat client

Inherits: EndPoint
chat := Chat->New("llama3");
chat->Send("How many people like in San Pablo, CA?")->PrintLine();
chat->Send("How of the population identify as Latino??")->PrintLine();
chat->Send("Thanks, what are the major landmarks?")->PrintLine();
chat->Send("Goodbye?")->PrintLine();

Operations

New # constructor

Constructor

New(model:String)

Parameters

NameTypeDescription
modelStringmodel name (i.e. llama3, llava)

Send #

Chat response from the model given an input

method : public : Send(message:String) ~ String

Parameters

NameTypeDescription
messageStringchat message

Return

TypeDescription
Stringchat response

Example

chat := Chat->New("llama3");
chat->Send("What year did the Berlin Wall fall?")->PrintLine();
chat->Send("Who was the US president at the time?")->PrintLine();

Send #

Chat response with options

method : public : Send(message:String, options:Options) ~ String

Parameters

NameTypeDescription
messageStringchat message
optionsOptionsgeneration options

Return

TypeDescription
Stringchat response

Example

opts := Options->New()->SetTemperature(0.5);
chat := Chat->New("llama3");
chat->Send("Write a haiku about mountains.", opts)->PrintLine();

Send #

Chat response with format and options

method : public : Send(message:String, format:String, options:Options, tools:Vector<Tool>) ~ String

Parameters

NameTypeDescription
messageStringchat message
formatStringoutput format ("json" or Nil)
optionsOptionsgeneration options
toolsVector<Tool>tool definitions for function calling

Return

TypeDescription
Stringchat response

Example

opts := Options->New()->SetTemperature(0.0);
chat := Chat->New("llama3");
json_reply := chat->Send("List three colors as JSON.", "json", opts, Nil);
json_reply->PrintLine();

Send #

Chat response from the model given an input

method : public : Send(message:String, image:File) ~ String

Parameters

NameTypeDescription
messageStringchat message
imageFileimage file

Return

TypeDescription
Stringchat response

Example

chat := Chat->New("llava");
image := System.IO.Filesystem.File->New("diagram.png");
chat->Send("What does this diagram show?", image)->PrintLine();

Send #

Chat response from the model given an input

method : public : Send(message:String, images:File[]) ~ String

Parameters

NameTypeDescription
messageStringchat query
imagesFile[]image files

Return

TypeDescription
Stringchat response