ToolChoice implements JsonSerializable
FinalYes
Controls how the model uses tools during sampling.
since protocol revision 2026-07-28 (SEP-2577), earliest removal 2027-07-28. Integrate with an LLM provider's API directly instead.
Table of Contents
Interfaces
- JsonSerializable
Properties
Methods
- __construct() : mixed
- fromArray() : self
- jsonSerialize() : array{mode: string}
Properties
$mode read-only
public
ToolChoiceMode
$mode
= ToolChoiceMode::Auto
Methods
__construct()
public
__construct([ToolChoiceMode $mode = ToolChoiceMode::Auto ]) : mixed
Parameters
- $mode : ToolChoiceMode = ToolChoiceMode::Auto
fromArray()
public
static fromArray(array{mode?: string} $data) : self
Parameters
- $data : array{mode?: string}
Return values
selfjsonSerialize()
public
jsonSerialize() : array{mode: string}