Package com.anthropic.models.messages
Class StructuredContentBlock
-
- All Implemented Interfaces:
public final class StructuredContentBlock<T extends Object>A wrapper for ContentBlock that provides type-safe access to the text when using the Structured Outputs feature to deserialize a JSON response to an instance of an arbitrary class. See the SDK documentation for more details on Structured Outputs.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceStructuredContentBlock.Visitor
-
Field Summary
Fields Modifier and Type Field Description private final Class<T>outputTypeprivate final ContentBlockrawContentBlock
-
Method Summary
-
-
Method Detail
-
outputType
final Class<T> outputType()
-
rawContentBlock
final ContentBlock rawContentBlock()
-
text
final Optional<StructuredTextBlock<T>> text()
-
thinking
final Optional<ThinkingBlock> thinking()
-
redactedThinking
final Optional<RedactedThinkingBlock> redactedThinking()
-
toolUse
final Optional<ToolUseBlock> toolUse()
-
serverToolUse
final Optional<ServerToolUseBlock> serverToolUse()
-
webSearchToolResult
final Optional<WebSearchToolResultBlock> webSearchToolResult()
-
isThinking
final Boolean isThinking()
-
isRedactedThinking
final Boolean isRedactedThinking()
-
isServerToolUse
final Boolean isServerToolUse()
-
isWebSearchToolResult
final Boolean isWebSearchToolResult()
-
asText
final StructuredTextBlock<T> asText()
-
asThinking
final ThinkingBlock asThinking()
-
asRedactedThinking
final RedactedThinkingBlock asRedactedThinking()
-
asToolUse
final ToolUseBlock asToolUse()
-
asServerToolUse
final ServerToolUseBlock asServerToolUse()
-
asWebSearchToolResult
final WebSearchToolResultBlock asWebSearchToolResult()
-
validate
final StructuredContentBlock<T> validate()
-
-
-
-