Interface BetaCompactionBlockParam.ToolChange.Visitor
-
- All Implemented Interfaces:
public interface BetaCompactionBlockParam.ToolChange.Visitor<T extends Object>An interface that defines how to map each variant of ToolChange to a value of type T.
-
-
Method Summary
Modifier and Type Method Description abstract TvisitAddition(BetaRequestToolAdditionBlock addition)Mid-conversation directive to make a tool available. abstract TvisitRemoval(BetaRequestToolRemovalBlock removal)Mid-conversation directive to withdraw a tool. Tunknown(JsonValue json)Maps an unknown variant of ToolChange to a value of type T. -
-
Method Detail
-
visitAddition
abstract T visitAddition(BetaRequestToolAdditionBlock addition)
Mid-conversation directive to make a tool available.
`tool`is a reference to a tool (or MCP toolset) declared in the request's`tools`. Under the`inline-tools-2026-09-15`beta it may instead be a reference to a tool defined earlier in`messages`, or a`tool_definition`object that carries an inline tool definition in`definition`(the same object a`tools`entry holds). An`mcp_toolset`definition also requires the`mcp-client-2026-09-15`beta. The tool is offered to the model from this point in the conversation onward.
-
visitRemoval
abstract T visitRemoval(BetaRequestToolRemovalBlock removal)
Mid-conversation directive to withdraw a tool.
`tool`references a tool (or MCP toolset) by name: one declared in the request's`tools`or defined earlier in`messages`. It is no longer offered to the model from this point in the conversation onward.
-
unknown
T unknown(JsonValue json)
Maps an unknown variant of ToolChange to a value of type T.
An instance of ToolChange can contain an unknown variant if it was deserialized from data that doesn't match any known variant. For example, if the SDK is on an older version than the API, then the API may respond with new variants that the SDK is unaware of.
-
-
-
-