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 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 TvisitDocument(DocumentBlockParam document)Document content, either specified directly as base64 data, as text, or as a reference via a URL. abstract TvisitSearchResult(SearchResultBlockParam searchResult)A search result block containing source, title, and content from search operations. 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. 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 TvisitServerToolUse(ServerToolUseBlockParam serverToolUse)abstract TvisitWebSearchToolResult(WebSearchToolResultBlockParam webSearchToolResult)abstract TvisitWebFetchToolResult(WebFetchToolResultBlockParam webFetchToolResult)abstract TvisitCodeExecutionToolResult(CodeExecutionToolResultBlockParam codeExecutionToolResult)abstract TvisitBashCodeExecutionToolResult(BashCodeExecutionToolResultBlockParam bashCodeExecutionToolResult)abstract TvisitTextEditorCodeExecutionToolResult(TextEditorCodeExecutionToolResultBlockParam textEditorCodeExecutionToolResult)abstract TvisitToolSearchToolResult(ToolSearchToolResultBlockParam toolSearchToolResult)abstract TvisitContainerUpload(ContainerUploadBlockParam containerUpload)A content block that represents a file to be uploaded to the container Files uploaded via this block will be available in the container's input directory. Tunknown(JsonValue json)Maps an unknown variant of ContentBlockParam to a value of type T. -
-
Method Detail
-
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.
-
visitDocument
abstract T visitDocument(DocumentBlockParam document)
Document content, either specified directly as base64 data, as text, or as a reference via a URL.
-
visitSearchResult
abstract T visitSearchResult(SearchResultBlockParam searchResult)
A search result block containing source, title, and content from search operations.
-
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.
-
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.
-
visitServerToolUse
abstract T visitServerToolUse(ServerToolUseBlockParam serverToolUse)
-
visitWebSearchToolResult
abstract T visitWebSearchToolResult(WebSearchToolResultBlockParam webSearchToolResult)
-
visitWebFetchToolResult
abstract T visitWebFetchToolResult(WebFetchToolResultBlockParam webFetchToolResult)
-
visitCodeExecutionToolResult
abstract T visitCodeExecutionToolResult(CodeExecutionToolResultBlockParam codeExecutionToolResult)
-
visitBashCodeExecutionToolResult
abstract T visitBashCodeExecutionToolResult(BashCodeExecutionToolResultBlockParam bashCodeExecutionToolResult)
-
visitTextEditorCodeExecutionToolResult
abstract T visitTextEditorCodeExecutionToolResult(TextEditorCodeExecutionToolResultBlockParam textEditorCodeExecutionToolResult)
-
visitToolSearchToolResult
abstract T visitToolSearchToolResult(ToolSearchToolResultBlockParam toolSearchToolResult)
-
visitContainerUpload
abstract T visitContainerUpload(ContainerUploadBlockParam containerUpload)
A content block that represents a file to be uploaded to the container Files uploaded via this block will be available in the container's input directory.
-
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.
-
-
-
-