OllamaClient.chatCompletions

Performs an OpenAI-style chat completion.

class OllamaClient
@trusted
JSONValue
chatCompletions
(
string model
,,
int maxTokens = 0
,
float temperature = 1.0
,
bool stream = false
)

Parameters

model string

Model name.

messages Message[]

Chat history as Message array.

maxTokens int

Maximum tokens to generate (0 = unlimited).

temperature float

Sampling temperature (default 1.0).

stream bool

Whether to stream (not fully supported).

Return Value

Type: JSONValue

A JSONValue in OpenAI ChatCompletion format.

Meta