OLLMchat.Call
Description:
API call implementations namespace.
The OLLMchat.Call namespace provides classes for making API calls to Ollama and OpenAI-compatible servers. All call classes extend
Call.Base which handles HTTP communication, URL building, streaming, and error management.
Content:
Classes:
- Base - Abstract base class for all Ollama
API calls.
- Chat - Chat API call implementation for sending
messages and receiving responses.
- ChatBase - Shared chat call surface:
state, signals, and tool recursion helpers. Subclasses implement send
for protocol-specific request paths.
- ChatCompletions - OpenAI-compatible chat
completions API call.
- Completions - OpenAI-compatible completions
API call (prompt → text). Uses v1/completions; same URL pattern as Call.Models. Request: model, prompt (required), optional
max_tokens, temperature, top_p, n, stop, presence_penalty, frequency_penalty. Options: same Call.Options as Generate; used as fallback
when top-level param not set (options.num_predict → max_tokens, etc.). Returns Response.Generate; v1 JSON is parsed via
deserialize_property.
- Create - API call to create a model using the
Ollama create API endpoint.
- Delete - API call to delete a model from the
Ollama server.
- Embed - API call to generate embeddings for input
text.
- Embeddings - OpenAI-compatible embeddings API
call. Uses v1/embeddings; same URL pattern as Call.Models. Request: model, input (string array). Returns Response.Embed (v1 response
parsed into Embed).
- Generate - API call to generate a response for a
prompt.
- Models - API call to list available models (OpenAI
-compatible).
- Options - Options object for Ollama API calls.
- Ps - API call to list currently running models on the
Ollama server.
- Pull - API call to pull a model from the Ollama
server.
- ReplayChat - Chat implementation that returns
replayed content instead of calling the LLM. Takes the raw message list; each send() returns the next relevant message's content,
skipping roles that are not LLM content (e.g. ui, system, project). Used by tests to drive the real Runner/List flow with session
messages.
- ShowModel - API call to get detailed
information about a specific model.
- Version - API call to get the version of the
Ollama server.