CreateMessageRequest

Parameters of a sampling/createMessage request the server sends to the client. Build one, call toJson, and pass it to RequestContext.sample.

@safe
struct CreateMessageRequest {
SamplingMessage[] messages;
ModelPreferences modelPreferences;
Nullable!string systemPrompt;
Nullable!double temperature;
Nullable!long maxTokens;
string[] stopSequences;
}

Members

Variables

includeContext
Nullable!string includeContext;

"none" | "thisServer" | "allServers"

metadata
Json metadata;

opaque provider-specific metadata

toolChoice
ToolChoice toolChoice;

optional tool-choice mode; omitted when unset

tools
Tool[] tools;

tools the model may call during sampling (2025-11-25 / draft)