Interface ContentBlockParam.Visitor
-
- All Implemented Interfaces:
public interface ContentBlockParam.Visitor<T extends Object>An interface that defines how to map each variant of ContentBlockParam to a value of type T.
-
-
Method Summary
Modifier and Type Method Description abstract TvisitServerToolUse(ServerToolUseBlockParam serverToolUse)abstract TvisitWebSearchToolResult(WebSearchToolResultBlockParam webSearchToolResult)abstract TvisitText(TextBlockParam text)Regular text content. abstract TvisitImage(ImageBlockParam image)Image content specified directly as base64 data or as a reference via a URL. abstract TvisitToolUse(ToolUseBlockParam toolUse)A block indicating a tool use by the model. abstract TvisitToolResult(ToolResultBlockParam toolResult)A block specifying the results of a tool use by the model. abstract TvisitDocument(DocumentBlockParam document)Document content, either specified directly as base64 data, as text, or as a reference via a URL. abstract TvisitThinking(ThinkingBlockParam thinking)A block specifying internal thinking by the model. abstract TvisitRedactedThinking(RedactedThinkingBlockParam redactedThinking)A block specifying internal, redacted thinking by the model. Tunknown(JsonValue json)Maps an unknown variant of ContentBlockParam to a value of type T. -
-
Method Detail
-
visitServerToolUse
abstract T visitServerToolUse(ServerToolUseBlockParam serverToolUse)
-
visitWebSearchToolResult
abstract T visitWebSearchToolResult(WebSearchToolResultBlockParam webSearchToolResult)
-
visitText
abstract T visitText(TextBlockParam text)
Regular text content.
-
visitImage
abstract T visitImage(ImageBlockParam image)
Image content specified directly as base64 data or as a reference via a URL.
-
visitToolUse
abstract T visitToolUse(ToolUseBlockParam toolUse)
A block indicating a tool use by the model.
-
visitToolResult
abstract T visitToolResult(ToolResultBlockParam toolResult)
A block specifying the results of a tool use by the model.
-
visitDocument
abstract T visitDocument(DocumentBlockParam document)
Document content, either specified directly as base64 data, as text, or as a reference via a URL.
-
visitThinking
abstract T visitThinking(ThinkingBlockParam thinking)
A block specifying internal thinking by the model.
-
visitRedactedThinking
abstract T visitRedactedThinking(RedactedThinkingBlockParam redactedThinking)
A block specifying internal, redacted thinking by the model.
-
unknown
T unknown(JsonValue json)
Maps an unknown variant of ContentBlockParam to a value of type T.
An instance of ContentBlockParam 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.
-
-
-
-