ToolChoice

Controls the tool-use ability of the model during tool-enabled sampling. mode is one of "auto" (model decides, the default), "required" (model MUST use at least one tool before completing), or "none" (model MUST NOT use any tools). Added by the 2025-11-25 / draft revisions; see client/sampling Tool Choice Modes.

@safe
struct ToolChoice {}

Members

Functions

empty
bool empty()

True when no mode is set (so CreateMessageRequest.toJson can decide whether to emit a toolChoice object at all).

Variables

mode
Nullable!string mode;

"auto" | "required" | "none"