Class StructuredOutputConfig
-
- All Implemented Interfaces:
public final class StructuredOutputConfig<T extends Object>A wrapper for OutputConfig that provides a type-safe Builder that can record the outputType used to derive a JSON schema for the output format when using the Structured Outputs feature. Unlike passing only the output type to MessageCreateParams.Builder.outputConfig, this allows the other output configuration options (such as the effort level) to be set alongside the output type. See the SDK documentation for more details on Structured Outputs.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classStructuredOutputConfig.BuilderA builder for StructuredOutputConfig.
-
Field Summary
Fields Modifier and Type Field Description private final Class<T>outputTypeprivate final OutputConfigrawOutputConfig
-
Method Summary
Modifier and Type Method Description final Class<T>outputType()final OutputConfigrawOutputConfig()The raw, underlying output configuration wrapped by this structured instance. final Optional<OutputConfig.Effort>effort()final Optional<JsonOutputFormat>format()final JsonField<OutputConfig.Effort>_effort()Returns the raw JSON value of effort. final JsonField<JsonOutputFormat>_format()Returns the raw JSON value of format. final Map<String, JsonValue>_additionalProperties()final StructuredOutputConfig<T>validate()final BooleanisValid()final StructuredOutputConfig.Builder<T>toBuilder()Booleanequals(Object other)IntegerhashCode()StringtoString()final static <T extends Any> StructuredOutputConfig.Builder<T>builder()Returns a mutable builder for constructing an instance of StructuredOutputConfig. -
-
Method Detail
-
outputType
final Class<T> outputType()
-
rawOutputConfig
final OutputConfig rawOutputConfig()
The raw, underlying output configuration wrapped by this structured instance.
-
effort
final Optional<OutputConfig.Effort> effort()
-
format
final Optional<JsonOutputFormat> format()
-
_effort
final JsonField<OutputConfig.Effort> _effort()
Returns the raw JSON value of effort.
Unlike effort, this method doesn't throw if the JSON field has an unexpected type.
-
_format
final JsonField<JsonOutputFormat> _format()
Returns the raw JSON value of format.
Unlike format, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
validate
final StructuredOutputConfig<T> validate()
-
toBuilder
final StructuredOutputConfig.Builder<T> toBuilder()
-
builder
final static <T extends Any> StructuredOutputConfig.Builder<T> builder()
Returns a mutable builder for constructing an instance of StructuredOutputConfig.
The following fields are required:
.format()
-
-
-
-