Class StructuredChatCompletion
-
- All Implemented Interfaces:
public final class StructuredChatCompletion<T extends Object>A wrapper for ChatCompletion that provides type-safe access to the choices 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 classStructuredChatCompletion.Choice
-
Field Summary
Fields Modifier and Type Field Description private final Class<T>responseTypeprivate final ChatCompletionrawChatCompletion
-
Constructor Summary
Constructors Constructor Description StructuredChatCompletion(Class<T> responseType, ChatCompletion rawChatCompletion)
-
Method Summary
Modifier and Type Method Description final Class<T>responseType()final ChatCompletionrawChatCompletion()final Stringid()final List<StructuredChatCompletion.Choice<T>>choices()final Longcreated()final Stringmodel()final JsonValue_object_()final Optional<ChatCompletion.ServiceTier>serviceTier()final Optional<String>systemFingerprint()final Optional<CompletionUsage>usage()final JsonField<String>_id()final JsonField<List<StructuredChatCompletion.Choice<T>>>_choices()final JsonField<Long>_created()final JsonField<String>_model()final JsonField<ChatCompletion.ServiceTier>_serviceTier()final JsonField<String>_systemFingerprint()final JsonField<CompletionUsage>_usage()final Map<String, JsonValue>_additionalProperties()final StructuredChatCompletion<T>validate()final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()-
-
Constructor Detail
-
StructuredChatCompletion
StructuredChatCompletion(Class<T> responseType, ChatCompletion rawChatCompletion)
-
-
Method Detail
-
responseType
final Class<T> responseType()
-
rawChatCompletion
final ChatCompletion rawChatCompletion()
-
choices
final List<StructuredChatCompletion.Choice<T>> choices()
-
serviceTier
final Optional<ChatCompletion.ServiceTier> serviceTier()
-
systemFingerprint
final Optional<String> systemFingerprint()
-
usage
final Optional<CompletionUsage> usage()
-
_choices
final JsonField<List<StructuredChatCompletion.Choice<T>>> _choices()
-
_serviceTier
final JsonField<ChatCompletion.ServiceTier> _serviceTier()
-
_systemFingerprint
final JsonField<String> _systemFingerprint()
-
_usage
final JsonField<CompletionUsage> _usage()
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
validate
final StructuredChatCompletion<T> validate()
-
-
-
-