@@ -26,6 +26,7 @@ import com.openai.core.checkRequired
2626import com.openai.core.getOrThrow
2727import com.openai.core.toImmutable
2828import com.openai.errors.OpenAIInvalidDataException
29+ import com.openai.models.responses.ResponseInputAudio
2930import com.openai.models.responses.ResponseInputText
3031import java.util.Collections
3132import java.util.Objects
@@ -532,13 +533,24 @@ private constructor(
532533 /* * Alias for calling [content] with `Content.ofInputImage(inputImage)`. */
533534 fun content (inputImage : Content .InputImage ) = content(Content .ofInputImage(inputImage))
534535
536+ /* *
537+ * Alias for calling [content] with `Content.ofResponseInputAudio(responseInputAudio)`.
538+ */
539+ fun content (responseInputAudio : ResponseInputAudio ) =
540+ content(Content .ofResponseInputAudio(responseInputAudio))
541+
535542 /* *
536543 * Alias for calling [content] with
537- * `Content.ofAnArrayOfInputTextAndInputImage(anArrayOfInputTextAndInputImage )`.
544+ * `Content.ofAnArrayOfInputTextInputImageAndInputAudio(anArrayOfInputTextInputImageAndInputAudio )`.
538545 */
539- fun contentOfAnArrayOfInputTextAndInputImage (
540- anArrayOfInputTextAndInputImage : List <JsonValue >
541- ) = content(Content .ofAnArrayOfInputTextAndInputImage(anArrayOfInputTextAndInputImage))
546+ fun contentOfAnArrayOfInputTextInputImageAndInputAudio (
547+ anArrayOfInputTextInputImageAndInputAudio : List <JsonValue >
548+ ) =
549+ content(
550+ Content .ofAnArrayOfInputTextInputImageAndInputAudio(
551+ anArrayOfInputTextInputImageAndInputAudio
552+ )
553+ )
542554
543555 /* *
544556 * The role of the message input. One of `user`, `assistant`, `system`, or `developer`.
@@ -649,7 +661,8 @@ private constructor(
649661 private val responseInputText: ResponseInputText ? = null ,
650662 private val outputText: OutputText ? = null ,
651663 private val inputImage: InputImage ? = null ,
652- private val anArrayOfInputTextAndInputImage: List <JsonValue >? = null ,
664+ private val responseInputAudio: ResponseInputAudio ? = null ,
665+ private val anArrayOfInputTextInputImageAndInputAudio: List <JsonValue >? = null ,
653666 private val _json : JsonValue ? = null ,
654667 ) {
655668
@@ -666,11 +679,16 @@ private constructor(
666679 /* * An image input to the model. */
667680 fun inputImage (): Optional <InputImage > = Optional .ofNullable(inputImage)
668681
682+ /* * An audio input to the model. */
683+ fun responseInputAudio (): Optional <ResponseInputAudio > =
684+ Optional .ofNullable(responseInputAudio)
685+
669686 /* *
670- * A list of inputs, each of which may be either an input text or input image object.
687+ * A list of inputs, each of which may be either an input text, input image, or input
688+ * audio object.
671689 */
672- fun anArrayOfInputTextAndInputImage (): Optional <List <JsonValue >> =
673- Optional .ofNullable(anArrayOfInputTextAndInputImage )
690+ fun anArrayOfInputTextInputImageAndInputAudio (): Optional <List <JsonValue >> =
691+ Optional .ofNullable(anArrayOfInputTextInputImageAndInputAudio )
674692
675693 fun isTextInput (): Boolean = textInput != null
676694
@@ -680,8 +698,10 @@ private constructor(
680698
681699 fun isInputImage (): Boolean = inputImage != null
682700
683- fun isAnArrayOfInputTextAndInputImage (): Boolean =
684- anArrayOfInputTextAndInputImage != null
701+ fun isResponseInputAudio (): Boolean = responseInputAudio != null
702+
703+ fun isAnArrayOfInputTextInputImageAndInputAudio (): Boolean =
704+ anArrayOfInputTextInputImageAndInputAudio != null
685705
686706 /* * A text input to the model. */
687707 fun asTextInput (): String = textInput.getOrThrow(" textInput" )
@@ -696,11 +716,18 @@ private constructor(
696716 /* * An image input to the model. */
697717 fun asInputImage (): InputImage = inputImage.getOrThrow(" inputImage" )
698718
719+ /* * An audio input to the model. */
720+ fun asResponseInputAudio (): ResponseInputAudio =
721+ responseInputAudio.getOrThrow(" responseInputAudio" )
722+
699723 /* *
700- * A list of inputs, each of which may be either an input text or input image object.
724+ * A list of inputs, each of which may be either an input text, input image, or input
725+ * audio object.
701726 */
702- fun asAnArrayOfInputTextAndInputImage (): List <JsonValue > =
703- anArrayOfInputTextAndInputImage.getOrThrow(" anArrayOfInputTextAndInputImage" )
727+ fun asAnArrayOfInputTextInputImageAndInputAudio (): List <JsonValue > =
728+ anArrayOfInputTextInputImageAndInputAudio.getOrThrow(
729+ " anArrayOfInputTextInputImageAndInputAudio"
730+ )
704731
705732 fun _json (): Optional <JsonValue > = Optional .ofNullable(_json )
706733
@@ -710,9 +737,11 @@ private constructor(
710737 responseInputText != null -> visitor.visitResponseInputText(responseInputText)
711738 outputText != null -> visitor.visitOutputText(outputText)
712739 inputImage != null -> visitor.visitInputImage(inputImage)
713- anArrayOfInputTextAndInputImage != null ->
714- visitor.visitAnArrayOfInputTextAndInputImage(
715- anArrayOfInputTextAndInputImage
740+ responseInputAudio != null ->
741+ visitor.visitResponseInputAudio(responseInputAudio)
742+ anArrayOfInputTextInputImageAndInputAudio != null ->
743+ visitor.visitAnArrayOfInputTextInputImageAndInputAudio(
744+ anArrayOfInputTextInputImageAndInputAudio
716745 )
717746 else -> visitor.unknown(_json )
718747 }
@@ -740,8 +769,14 @@ private constructor(
740769 inputImage.validate()
741770 }
742771
743- override fun visitAnArrayOfInputTextAndInputImage (
744- anArrayOfInputTextAndInputImage : List <JsonValue >
772+ override fun visitResponseInputAudio (
773+ responseInputAudio : ResponseInputAudio
774+ ) {
775+ responseInputAudio.validate()
776+ }
777+
778+ override fun visitAnArrayOfInputTextInputImageAndInputAudio (
779+ anArrayOfInputTextInputImageAndInputAudio : List <JsonValue >
745780 ) {}
746781 }
747782 )
@@ -775,9 +810,13 @@ private constructor(
775810
776811 override fun visitInputImage (inputImage : InputImage ) = inputImage.validity()
777812
778- override fun visitAnArrayOfInputTextAndInputImage (
779- anArrayOfInputTextAndInputImage : List <JsonValue >
780- ) = anArrayOfInputTextAndInputImage.size
813+ override fun visitResponseInputAudio (
814+ responseInputAudio : ResponseInputAudio
815+ ) = responseInputAudio.validity()
816+
817+ override fun visitAnArrayOfInputTextInputImageAndInputAudio (
818+ anArrayOfInputTextInputImageAndInputAudio : List <JsonValue >
819+ ) = anArrayOfInputTextInputImageAndInputAudio.size
781820
782821 override fun unknown (json : JsonValue ? ) = 0
783822 }
@@ -793,7 +832,9 @@ private constructor(
793832 responseInputText == other.responseInputText &&
794833 outputText == other.outputText &&
795834 inputImage == other.inputImage &&
796- anArrayOfInputTextAndInputImage == other.anArrayOfInputTextAndInputImage
835+ responseInputAudio == other.responseInputAudio &&
836+ anArrayOfInputTextInputImageAndInputAudio ==
837+ other.anArrayOfInputTextInputImageAndInputAudio
797838 }
798839
799840 override fun hashCode (): Int =
@@ -802,7 +843,8 @@ private constructor(
802843 responseInputText,
803844 outputText,
804845 inputImage,
805- anArrayOfInputTextAndInputImage,
846+ responseInputAudio,
847+ anArrayOfInputTextInputImageAndInputAudio,
806848 )
807849
808850 override fun toString (): String =
@@ -811,8 +853,9 @@ private constructor(
811853 responseInputText != null -> " Content{responseInputText=$responseInputText }"
812854 outputText != null -> " Content{outputText=$outputText }"
813855 inputImage != null -> " Content{inputImage=$inputImage }"
814- anArrayOfInputTextAndInputImage != null ->
815- " Content{anArrayOfInputTextAndInputImage=$anArrayOfInputTextAndInputImage }"
856+ responseInputAudio != null -> " Content{responseInputAudio=$responseInputAudio }"
857+ anArrayOfInputTextInputImageAndInputAudio != null ->
858+ " Content{anArrayOfInputTextInputImageAndInputAudio=$anArrayOfInputTextInputImageAndInputAudio }"
816859 _json != null -> " Content{_unknown=$_json }"
817860 else -> throw IllegalStateException (" Invalid Content" )
818861 }
@@ -835,17 +878,22 @@ private constructor(
835878 @JvmStatic
836879 fun ofInputImage (inputImage : InputImage ) = Content (inputImage = inputImage)
837880
881+ /* * An audio input to the model. */
882+ @JvmStatic
883+ fun ofResponseInputAudio (responseInputAudio : ResponseInputAudio ) =
884+ Content (responseInputAudio = responseInputAudio)
885+
838886 /* *
839- * A list of inputs, each of which may be either an input text or input image
840- * object.
887+ * A list of inputs, each of which may be either an input text, input image, or
888+ * input audio object.
841889 */
842890 @JvmStatic
843- fun ofAnArrayOfInputTextAndInputImage (
844- anArrayOfInputTextAndInputImage : List <JsonValue >
891+ fun ofAnArrayOfInputTextInputImageAndInputAudio (
892+ anArrayOfInputTextInputImageAndInputAudio : List <JsonValue >
845893 ) =
846894 Content (
847- anArrayOfInputTextAndInputImage =
848- anArrayOfInputTextAndInputImage .toImmutable()
895+ anArrayOfInputTextInputImageAndInputAudio =
896+ anArrayOfInputTextInputImageAndInputAudio .toImmutable()
849897 )
850898 }
851899
@@ -867,12 +915,15 @@ private constructor(
867915 /* * An image input to the model. */
868916 fun visitInputImage (inputImage : InputImage ): T
869917
918+ /* * An audio input to the model. */
919+ fun visitResponseInputAudio (responseInputAudio : ResponseInputAudio ): T
920+
870921 /* *
871- * A list of inputs, each of which may be either an input text or input image
872- * object.
922+ * A list of inputs, each of which may be either an input text, input image, or
923+ * input audio object.
873924 */
874- fun visitAnArrayOfInputTextAndInputImage (
875- anArrayOfInputTextAndInputImage : List <JsonValue >
925+ fun visitAnArrayOfInputTextInputImageAndInputAudio (
926+ anArrayOfInputTextInputImageAndInputAudio : List <JsonValue >
876927 ): T
877928
878929 /* *
@@ -906,11 +957,17 @@ private constructor(
906957 tryDeserialize(node, jacksonTypeRef<InputImage >())?.let {
907958 Content (inputImage = it, _json = json)
908959 },
960+ tryDeserialize(node, jacksonTypeRef<ResponseInputAudio >())?.let {
961+ Content (responseInputAudio = it, _json = json)
962+ },
909963 tryDeserialize(node, jacksonTypeRef<String >())?.let {
910964 Content (textInput = it, _json = json)
911965 },
912966 tryDeserialize(node, jacksonTypeRef<List <JsonValue >>())?.let {
913- Content (anArrayOfInputTextAndInputImage = it, _json = json)
967+ Content (
968+ anArrayOfInputTextInputImageAndInputAudio = it,
969+ _json = json,
970+ )
914971 },
915972 )
916973 .filterNotNull()
@@ -942,8 +999,10 @@ private constructor(
942999 generator.writeObject(value.responseInputText)
9431000 value.outputText != null -> generator.writeObject(value.outputText)
9441001 value.inputImage != null -> generator.writeObject(value.inputImage)
945- value.anArrayOfInputTextAndInputImage != null ->
946- generator.writeObject(value.anArrayOfInputTextAndInputImage)
1002+ value.responseInputAudio != null ->
1003+ generator.writeObject(value.responseInputAudio)
1004+ value.anArrayOfInputTextInputImageAndInputAudio != null ->
1005+ generator.writeObject(value.anArrayOfInputTextInputImageAndInputAudio)
9471006 value._json != null -> generator.writeObject(value._json )
9481007 else -> throw IllegalStateException (" Invalid Content" )
9491008 }
0 commit comments