Class ResponseTextConfig.Builder
-
- All Implemented Interfaces:
public final class ResponseTextConfig.Builder
A builder for ResponseTextConfig.
-
-
Method Summary
-
-
Method Detail
-
format
final ResponseTextConfig.Builder format(ResponseFormatTextConfig format)
An object specifying the format that the model must output.
Configuring
{ "type": "json_schema" }
enables Structured Outputs, which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.The default format is
{ "type": "text" }
with no additional options.Not recommended for gpt-4o and newer models:
Setting to
{ "type": "json_object" }
enables the older JSON mode, which ensures the message the model generates is valid JSON. Usingjson_schema
is preferred for models that support it.
-
format
final ResponseTextConfig.Builder format(JsonField<ResponseFormatTextConfig> format)
Sets Builder.format to an arbitrary JSON value.
You should usually call Builder.format with a well-typed ResponseFormatTextConfig value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
format
final ResponseTextConfig.Builder format(ResponseFormatText text)
Alias for calling format with
ResponseFormatTextConfig.ofText(text)
.
-
format
final ResponseTextConfig.Builder format(ResponseFormatTextJsonSchemaConfig jsonSchema)
Alias for calling format with
ResponseFormatTextConfig.ofJsonSchema(jsonSchema)
.
-
format
final ResponseTextConfig.Builder format(ResponseFormatJsonObject jsonObject)
Alias for calling format with
ResponseFormatTextConfig.ofJsonObject(jsonObject)
.
-
verbosity
final ResponseTextConfig.Builder verbosity(ResponseTextConfig.Verbosity verbosity)
Constrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low
,medium
, andhigh
.
-
verbosity
final ResponseTextConfig.Builder verbosity(Optional<ResponseTextConfig.Verbosity> verbosity)
Alias for calling Builder.verbosity with
verbosity.orElse(null)
.
-
verbosity
final ResponseTextConfig.Builder verbosity(JsonField<ResponseTextConfig.Verbosity> verbosity)
Sets Builder.verbosity to an arbitrary JSON value.
You should usually call Builder.verbosity with a well-typed Verbosity value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
additionalProperties
final ResponseTextConfig.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final ResponseTextConfig.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final ResponseTextConfig.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final ResponseTextConfig.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final ResponseTextConfig.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final ResponseTextConfig build()
Returns an immutable instance of ResponseTextConfig.
Further updates to this Builder will not mutate the returned instance.
-
-
-
-