Package com.anthropic.models.messages
Class StructuredMessage
-
- All Implemented Interfaces:
public final class StructuredMessage<T extends Object>A wrapper for Message 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 MessagerawMessage
-
Method Summary
Modifier and Type Method Description final Class<T>outputType()final MessagerawMessage()final Stringid()final List<StructuredContentBlock<T>>content()final Modelmodel()final JsonValue_role()final Optional<StopReason>stopReason()final Optional<String>stopSequence()final JsonValue_type()final Optional<Container>container()final Usageusage()final JsonField<String>_id()final JsonField<List<StructuredContentBlock<T>>>_content()final JsonField<Container>_container()final JsonField<Model>_model()final JsonField<StopReason>_stopReason()final JsonField<String>_stopSequence()final JsonField<Usage>_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 Message rawMessage()
-
content
final List<StructuredContentBlock<T>> content()
-
stopReason
final Optional<StopReason> stopReason()
-
stopSequence
final Optional<String> stopSequence()
-
_content
final JsonField<List<StructuredContentBlock<T>>> _content()
-
_container
final JsonField<Container> _container()
-
_stopReason
final JsonField<StopReason> _stopReason()
-
_stopSequence
final JsonField<String> _stopSequence()
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
validate
final StructuredMessage<T> validate()
-
-
-
-