Class StructuredTextBlock
-
- All Implemented Interfaces:
public final class StructuredTextBlock<T extends Object>A wrapper for BetaTextBlock 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 final classStructuredTextBlock.BuilderA builder for StructuredTextBlock.
-
Field Summary
Fields Modifier and Type Field Description private final Class<T>outputTypeprivate final BetaTextBlockrawTextBlock
-
Method Summary
Modifier and Type Method Description final Class<T>outputType()final BetaTextBlockrawTextBlock()final Optional<List<BetaTextCitation>>citations()final Ttext()final JsonValue_type()final JsonField<List<BetaTextCitation>>_citations()Returns the raw JSON value of citations. final JsonField<T>_text()Returns the raw JSON value of text. final Map<String, JsonValue>_additionalProperties()final StructuredTextBlock<T>validate()final BooleanisValid()final StructuredTextBlock.Builder<T>toBuilder()Booleanequals(Object other)IntegerhashCode()StringtoString()final static <T extends Any> StructuredTextBlock.Builder<T>builder(Class<T> outputType)Returns a mutable builder for constructing an instance of StructuredTextBlock. -
-
Method Detail
-
outputType
final Class<T> outputType()
-
rawTextBlock
final BetaTextBlock rawTextBlock()
-
citations
final Optional<List<BetaTextCitation>> citations()
-
_citations
final JsonField<List<BetaTextCitation>> _citations()
Returns the raw JSON value of citations.
Unlike citations, this method doesn't throw if the JSON field has an unexpected type.
-
_text
final JsonField<T> _text()
Returns the raw JSON value of text.
Unlike text, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
validate
final StructuredTextBlock<T> validate()
-
toBuilder
final StructuredTextBlock.Builder<T> toBuilder()
-
builder
final static <T extends Any> StructuredTextBlock.Builder<T> builder(Class<T> outputType)
Returns a mutable builder for constructing an instance of StructuredTextBlock.
The following fields are required:
.citations() .text()
-
-
-
-