Class StructuredMessage
-
- All Implemented Interfaces:
public final class StructuredMessage<T extends Object>A wrapper for BetaMessage that provides type-safe access to the content 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.
-
-
Field Summary
Fields Modifier and Type Field Description private final Class<T>outputTypeprivate final BetaMessagerawMessage
-
Method Summary
Modifier and Type Method Description final Class<T>outputType()final BetaMessagerawMessage()final Stringid()final Optional<BetaContainer>container()final List<StructuredContentBlock<T>>content()final Optional<BetaContextManagementResponse>contextManagement()final Modelmodel()final JsonValue_role()final Optional<BetaStopReason>stopReason()final Optional<String>stopSequence()final JsonValue_type()final BetaUsageusage()final JsonField<String>_id()final JsonField<BetaContainer>_container()final JsonField<List<StructuredContentBlock<T>>>_content()final JsonField<BetaContextManagementResponse>_contextManagement()final JsonField<Model>_model()final JsonField<BetaStopReason>_stopReason()final JsonField<String>_stopSequence()final JsonField<BetaUsage>_usage()final Map<String, JsonValue>_additionalProperties()final StructuredMessage<T>validate()final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()-
-
Method Detail
-
outputType
final Class<T> outputType()
-
rawMessage
final BetaMessage rawMessage()
-
container
final Optional<BetaContainer> container()
-
content
final List<StructuredContentBlock<T>> content()
-
contextManagement
final Optional<BetaContextManagementResponse> contextManagement()
-
stopReason
final Optional<BetaStopReason> stopReason()
-
stopSequence
final Optional<String> stopSequence()
-
_container
final JsonField<BetaContainer> _container()
-
_content
final JsonField<List<StructuredContentBlock<T>>> _content()
-
_contextManagement
final JsonField<BetaContextManagementResponse> _contextManagement()
-
_stopReason
final JsonField<BetaStopReason> _stopReason()
-
_stopSequence
final JsonField<String> _stopSequence()
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
validate
final StructuredMessage<T> validate()
-
-
-
-