Class ResponseFormatTextJsonSchemaConfig
-
- All Implemented Interfaces:
public final class ResponseFormatTextJsonSchemaConfig
JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
ResponseFormatTextJsonSchemaConfig.Builder
A builder for ResponseFormatTextJsonSchemaConfig.
public final class
ResponseFormatTextJsonSchemaConfig.Schema
The 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 String
name()
The name of the response format. final ResponseFormatTextJsonSchemaConfig.Schema
schema()
The schema for the response format, described as a JSON Schema object. final JsonValue
_type()
The type of response format being defined. 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<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<ResponseFormatTextJsonSchemaConfig.Schema>
_schema()
Returns the raw JSON value of schema. final JsonField<String>
_description()
Returns the raw JSON value of description. final JsonField<Boolean>
_strict()
Returns the raw JSON value of strict. final Map<String, JsonValue>
_additionalProperties()
final ResponseFormatTextJsonSchemaConfig.Builder
toBuilder()
final ResponseFormatTextJsonSchemaConfig
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static ResponseFormatTextJsonSchemaConfig.Builder
builder()
Returns a mutable builder for constructing an instance of ResponseFormatTextJsonSchemaConfig. -
-
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.
-
schema
final ResponseFormatTextJsonSchemaConfig.Schema schema()
The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
_type
final JsonValue _type()
The type of response format being defined. Always
json_schema
.Expected to always return the following:
JsonValue.from("json_schema")
However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
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.
-
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
schema
field. Only a subset of JSON Schema is supported whenstrict
istrue
. 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.
-
_schema
final JsonField<ResponseFormatTextJsonSchemaConfig.Schema> _schema()
Returns the raw JSON value of schema.
Unlike schema, 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.
-
_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 ResponseFormatTextJsonSchemaConfig.Builder toBuilder()
-
validate
final ResponseFormatTextJsonSchemaConfig validate()
-
builder
final static ResponseFormatTextJsonSchemaConfig.Builder builder()
Returns a mutable builder for constructing an instance of ResponseFormatTextJsonSchemaConfig.
The following fields are required:
.name() .schema()
-
-
-
-