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)
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(ResponseFormatText text)
Default response format. Used to generate text responses.
-
format
final ResponseTextConfig.Builder format(ResponseFormatTextJsonSchemaConfig jsonSchema)
JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
format
final ResponseTextConfig.Builder format(ResponseFormatJsonObject jsonObject)
JSON object response format. An older method of generating JSON responses. Using
json_schema
is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.
-
jsonSchemaFormat
final ResponseTextConfig.Builder jsonSchemaFormat(ResponseFormatTextJsonSchemaConfig.Schema schema)
JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
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()
-
-
-
-