ToolChoice
class ToolChoice
Controls whether and which tool a model must call, mapped to each provider's native tool_choice field.
Constants
| auto |
|
| none |
|
| required |
|
| tool |
|
Methods
__construct(string $mode, string|null $toolName = null)
Create a tool choice.
static ToolChoice
tool(string $name)
Require the model to call the tool with the given name.
static ToolChoice
from(ToolChoice|string|array $value)
Coerce a ToolChoice, a mode string, or a ['tool' => 'name'] array into a ToolChoice instance.
Details
at line 29
__construct(string $mode, string|null $toolName = null)
Create a tool choice.
at line 49
static ToolChoice
tool(string $name)
Require the model to call the tool with the given name.
at line 59
static ToolChoice
from(ToolChoice|string|array $value)
Coerce a ToolChoice, a mode string, or a ['tool' => 'name'] array into a ToolChoice instance.