Class ResponseFormatJsonSchema.JsonSchema
-
- All Implemented Interfaces:
public final class ResponseFormatJsonSchema.JsonSchemaStructured Outputs configuration options, including a JSON Schema.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classResponseFormatJsonSchema.JsonSchema.BuilderA builder for JsonSchema.
public final classResponseFormatJsonSchema.JsonSchema.SchemaThe schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
Method Summary
Modifier and Type Method Description final Stringname()The name of the response format. final Optional<String>description()A description of what the response format is for, used by the model to determine how to respond in the format. final Optional<ResponseFormatJsonSchema.JsonSchema.Schema>schema()The schema for the response format, described as a JSON Schema object. final Optional<Boolean>strict()Whether to enable strict schema adherence when generating the output. final JsonField<String>_name()Returns the raw JSON value of name. final JsonField<String>_description()Returns the raw JSON value of description. final JsonField<ResponseFormatJsonSchema.JsonSchema.Schema>_schema()Returns the raw JSON value of schema. final JsonField<Boolean>_strict()Returns the raw JSON value of strict. final Map<String, JsonValue>_additionalProperties()final ResponseFormatJsonSchema.JsonSchema.BuildertoBuilder()final ResponseFormatJsonSchema.JsonSchemavalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static ResponseFormatJsonSchema.JsonSchema.Builderbuilder()Returns a mutable builder for constructing an instance of JsonSchema. -
-
Method Detail
-
name
final String name()
The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
description
final Optional<String> description()
A description of what the response format is for, used by the model to determine how to respond in the format.
-
schema
final Optional<ResponseFormatJsonSchema.JsonSchema.Schema> schema()
The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
strict
final Optional<Boolean> strict()
Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
_name
final JsonField<String> _name()
Returns the raw JSON value of name.
Unlike name, this method doesn't throw if the JSON field has an unexpected type.
-
_description
final JsonField<String> _description()
Returns the raw JSON value of description.
Unlike description, this method doesn't throw if the JSON field has an unexpected type.
-
_schema
final JsonField<ResponseFormatJsonSchema.JsonSchema.Schema> _schema()
Returns the raw JSON value of schema.
Unlike schema, this method doesn't throw if the JSON field has an unexpected type.
-
_strict
final JsonField<Boolean> _strict()
Returns the raw JSON value of strict.
Unlike strict, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final ResponseFormatJsonSchema.JsonSchema.Builder toBuilder()
-
validate
final ResponseFormatJsonSchema.JsonSchema validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
builder
final static ResponseFormatJsonSchema.JsonSchema.Builder builder()
Returns a mutable builder for constructing an instance of JsonSchema.
The following fields are required:
.name()
-
-
-
-