Interface AssistantResponseFormatOption.Visitor
-
- All Implemented Interfaces:
public interface AssistantResponseFormatOption.Visitor<T extends Object>
An interface that defines how to map each variant of AssistantResponseFormatOption to a value of type T.
-
-
Method Summary
Modifier and Type Method Description abstract T
visitAuto(JsonValue auto)
auto
is the default valueabstract T
visitResponseFormatText(ResponseFormatText responseFormatText)
Default response format. abstract T
visitResponseFormatJsonObject(ResponseFormatJsonObject responseFormatJsonObject)
JSON object response format. abstract T
visitResponseFormatJsonSchema(ResponseFormatJsonSchema responseFormatJsonSchema)
JSON Schema response format. T
unknown(JsonValue json)
Maps an unknown variant of AssistantResponseFormatOption to a value of type T. -
-
Method Detail
-
visitResponseFormatText
abstract T visitResponseFormatText(ResponseFormatText responseFormatText)
Default response format. Used to generate text responses.
-
visitResponseFormatJsonObject
abstract T visitResponseFormatJsonObject(ResponseFormatJsonObject responseFormatJsonObject)
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.
-
visitResponseFormatJsonSchema
abstract T visitResponseFormatJsonSchema(ResponseFormatJsonSchema responseFormatJsonSchema)
JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
unknown
T unknown(JsonValue json)
Maps an unknown variant of AssistantResponseFormatOption to a value of type T.
An instance of AssistantResponseFormatOption 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.
-
-
-
-