Package com.azure.ai.openai.models
Class ChatCompletionsJsonSchemaResponseFormat
java.lang.Object
com.azure.ai.openai.models.ChatCompletionsResponseFormat
com.azure.ai.openai.models.ChatCompletionsJsonSchemaResponseFormat
- All Implemented Interfaces:
com.azure.json.JsonSerializable<ChatCompletionsResponseFormat>
A response format for Chat Completions that restricts responses to emitting JSON that conforms to a provided JSON
Schema for Structured Outputs.
-
Constructor Summary
ConstructorsConstructorDescriptionChatCompletionsJsonSchemaResponseFormat(ChatCompletionsJsonSchemaResponseFormatJsonSchema jsonSchema) Creates an instance of ChatCompletionsJsonSchemaResponseFormat class. -
Method Summary
Modifier and TypeMethodDescriptionfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of ChatCompletionsJsonSchemaResponseFormat from the JsonReader.Get the jsonSchema property: The json_schema property.getType()Get the type property: The discriminated type for the response format.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
ChatCompletionsJsonSchemaResponseFormat
public ChatCompletionsJsonSchemaResponseFormat(ChatCompletionsJsonSchemaResponseFormatJsonSchema jsonSchema) Creates an instance of ChatCompletionsJsonSchemaResponseFormat class.- Parameters:
jsonSchema- the jsonSchema value to set.
-
-
Method Details
-
getType
Get the type property: The discriminated type for the response format.- Overrides:
getTypein classChatCompletionsResponseFormat- Returns:
- the type value.
-
getJsonSchema
Get the jsonSchema property: The json_schema property.- Returns:
- the jsonSchema value.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<ChatCompletionsResponseFormat>- Overrides:
toJsonin classChatCompletionsResponseFormat- Throws:
IOException
-
fromJson
public static ChatCompletionsJsonSchemaResponseFormat fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of ChatCompletionsJsonSchemaResponseFormat from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of ChatCompletionsJsonSchemaResponseFormat if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IllegalStateException- If the deserialized JSON object was missing any required properties.IOException- If an error occurs while reading the ChatCompletionsJsonSchemaResponseFormat.
-