Class StructuredOutputConfig
-
- All Implemented Interfaces:
public final class StructuredOutputConfig<T extends Object>A wrapper for BetaOutputConfig 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 BetaOutputConfigrawOutputConfig
-
Method Summary
Modifier and Type Method Description final Class<T>outputType()final BetaOutputConfigrawOutputConfig()The raw, underlying output configuration wrapped by this structured instance. final Optional<BetaOutputConfig.Effort>effort()final Optional<BetaJsonOutputFormat>format()final Optional<BetaTokenTaskBudget>taskBudget()final JsonField<BetaOutputConfig.Effort>_effort()Returns the raw JSON value of effort. final JsonField<BetaJsonOutputFormat>_format()Returns the raw JSON value of format. final JsonField<BetaTokenTaskBudget>_taskBudget()Returns the raw JSON value of taskBudget. 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 BetaOutputConfig rawOutputConfig()
The raw, underlying output configuration wrapped by this structured instance.
-
effort
final Optional<BetaOutputConfig.Effort> effort()
-
format
final Optional<BetaJsonOutputFormat> format()
-
taskBudget
final Optional<BetaTokenTaskBudget> taskBudget()
-
_effort
final JsonField<BetaOutputConfig.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<BetaJsonOutputFormat> _format()
Returns the raw JSON value of format.
Unlike format, this method doesn't throw if the JSON field has an unexpected type.
-
_taskBudget
final JsonField<BetaTokenTaskBudget> _taskBudget()
Returns the raw JSON value of taskBudget.
Unlike taskBudget, 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()
-
-
-
-