Class ChatCompletionResponseFormat

java.lang.Object
com.azure.search.documents.indexes.models.ChatCompletionResponseFormat
All Implemented Interfaces:
com.azure.json.JsonSerializable<ChatCompletionResponseFormat>

public final class ChatCompletionResponseFormat extends Object implements com.azure.json.JsonSerializable<ChatCompletionResponseFormat>
Determines how the language model's response should be serialized. Defaults to 'text'.
  • Constructor Details

    • ChatCompletionResponseFormat

      public ChatCompletionResponseFormat()
      Creates an instance of ChatCompletionResponseFormat class.
  • Method Details

    • getType

      Get the type property: Specifies how the LLM should format the response. Possible values: 'text' (plain string), 'json_object' (arbitrary JSON), or 'json_schema' (adheres to provided schema).
      Returns:
      the type value.
    • setType

      Set the type property: Specifies how the LLM should format the response. Possible values: 'text' (plain string), 'json_object' (arbitrary JSON), or 'json_schema' (adheres to provided schema).
      Parameters:
      type - the type value to set.
      Returns:
      the ChatCompletionResponseFormat object itself.
    • getChatCompletionSchemaProperties

      public ChatCompletionResponseFormatJsonSchemaProperties getChatCompletionSchemaProperties()
      Get the chatCompletionSchemaProperties property: An open dictionary for extended properties. Required if 'type' == 'json_schema'.
      Returns:
      the chatCompletionSchemaProperties value.
    • setChatCompletionSchemaProperties

      public ChatCompletionResponseFormat setChatCompletionSchemaProperties(ChatCompletionResponseFormatJsonSchemaProperties chatCompletionSchemaProperties)
      Set the chatCompletionSchemaProperties property: An open dictionary for extended properties. Required if 'type' == 'json_schema'.
      Parameters:
      chatCompletionSchemaProperties - the chatCompletionSchemaProperties value to set.
      Returns:
      the ChatCompletionResponseFormat object itself.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<ChatCompletionResponseFormat>
      Throws:
      IOException
    • fromJson

      public static ChatCompletionResponseFormat fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of ChatCompletionResponseFormat from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of ChatCompletionResponseFormat if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IOException - If an error occurs while reading the ChatCompletionResponseFormat.