Interface ResponseFormatTextConfig.Visitor
-
- All Implemented Interfaces:
public interface ResponseFormatTextConfig.Visitor<T extends Object>
An interface that defines how to map each variant of ResponseFormatTextConfig to a value of type T.
-
-
Method Summary
Modifier and Type Method Description abstract T
visitText(ResponseFormatText text)
Default response format. abstract T
visitJsonSchema(ResponseFormatTextJsonSchemaConfig jsonSchema)
JSON Schema response format. abstract T
visitJsonObject(ResponseFormatJsonObject jsonObject)
JSON object response format. T
unknown(JsonValue json)
Maps an unknown variant of ResponseFormatTextConfig to a value of type T. -
-
Method Detail
-
visitText
abstract T visitText(ResponseFormatText text)
Default response format. Used to generate text responses.
-
visitJsonSchema
abstract T visitJsonSchema(ResponseFormatTextJsonSchemaConfig jsonSchema)
JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
visitJsonObject
abstract T visitJsonObject(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.
-
unknown
T unknown(JsonValue json)
Maps an unknown variant of ResponseFormatTextConfig to a value of type T.
An instance of ResponseFormatTextConfig can contain an unknown variant if it was deserialized from data that doesn't match any known variant. For example, if the SDK is on an older version than the API, then the API may respond with new variants that the SDK is unaware of.
-
-
-
-