Class InputAudioContent

java.lang.Object
com.azure.ai.openai.models.InputAudioContent
All Implemented Interfaces:
com.azure.json.JsonSerializable<InputAudioContent>

public final class InputAudioContent extends Object implements com.azure.json.JsonSerializable<InputAudioContent>
A structured chat content item containing audio data.
  • Constructor Details

    • InputAudioContent

      public InputAudioContent(String data, InputAudioFormat format)
      Creates an instance of InputAudioContent class.
      Parameters:
      data - the data value to set.
      format - the format value to set.
    • InputAudioContent

      public InputAudioContent(byte[] data, InputAudioFormat format)
      Creates an instance of InputAudioContent class.
      Parameters:
      data - - the audio data to set.
      format - - the format to set.
  • Method Details

    • getData

      public String getData()
      Get the data property: Base64-encoded audio data.
      Returns:
      the data value.
    • getFormat

      public InputAudioFormat getFormat()
      Get the format property: The format of the audio data.
      Returns:
      the format value.
    • toJson

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

      public static InputAudioContent fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of InputAudioContent from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of InputAudioContent 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 InputAudioContent.