@@ -26,6 +26,7 @@ import com.openai.core.checkRequired
26
26
import com.openai.core.getOrThrow
27
27
import com.openai.core.toImmutable
28
28
import com.openai.errors.OpenAIInvalidDataException
29
+ import com.openai.models.responses.ResponseInputAudio
29
30
import com.openai.models.responses.ResponseInputText
30
31
import java.util.Collections
31
32
import java.util.Objects
@@ -532,13 +533,24 @@ private constructor(
532
533
/* * Alias for calling [content] with `Content.ofInputImage(inputImage)`. */
533
534
fun content (inputImage : Content .InputImage ) = content(Content .ofInputImage(inputImage))
534
535
536
+ /* *
537
+ * Alias for calling [content] with `Content.ofResponseInputAudio(responseInputAudio)`.
538
+ */
539
+ fun content (responseInputAudio : ResponseInputAudio ) =
540
+ content(Content .ofResponseInputAudio(responseInputAudio))
541
+
535
542
/* *
536
543
* Alias for calling [content] with
537
- * `Content.ofAnArrayOfInputTextAndInputImage(anArrayOfInputTextAndInputImage )`.
544
+ * `Content.ofAnArrayOfInputTextInputImageAndInputAudio(anArrayOfInputTextInputImageAndInputAudio )`.
538
545
*/
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
+ )
542
554
543
555
/* *
544
556
* The role of the message input. One of `user`, `assistant`, `system`, or `developer`.
@@ -649,7 +661,8 @@ private constructor(
649
661
private val responseInputText: ResponseInputText ? = null ,
650
662
private val outputText: OutputText ? = null ,
651
663
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 ,
653
666
private val _json : JsonValue ? = null ,
654
667
) {
655
668
@@ -666,11 +679,16 @@ private constructor(
666
679
/* * An image input to the model. */
667
680
fun inputImage (): Optional <InputImage > = Optional .ofNullable(inputImage)
668
681
682
+ /* * An audio input to the model. */
683
+ fun responseInputAudio (): Optional <ResponseInputAudio > =
684
+ Optional .ofNullable(responseInputAudio)
685
+
669
686
/* *
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.
671
689
*/
672
- fun anArrayOfInputTextAndInputImage (): Optional <List <JsonValue >> =
673
- Optional .ofNullable(anArrayOfInputTextAndInputImage )
690
+ fun anArrayOfInputTextInputImageAndInputAudio (): Optional <List <JsonValue >> =
691
+ Optional .ofNullable(anArrayOfInputTextInputImageAndInputAudio )
674
692
675
693
fun isTextInput (): Boolean = textInput != null
676
694
@@ -680,8 +698,10 @@ private constructor(
680
698
681
699
fun isInputImage (): Boolean = inputImage != null
682
700
683
- fun isAnArrayOfInputTextAndInputImage (): Boolean =
684
- anArrayOfInputTextAndInputImage != null
701
+ fun isResponseInputAudio (): Boolean = responseInputAudio != null
702
+
703
+ fun isAnArrayOfInputTextInputImageAndInputAudio (): Boolean =
704
+ anArrayOfInputTextInputImageAndInputAudio != null
685
705
686
706
/* * A text input to the model. */
687
707
fun asTextInput (): String = textInput.getOrThrow(" textInput" )
@@ -696,11 +716,18 @@ private constructor(
696
716
/* * An image input to the model. */
697
717
fun asInputImage (): InputImage = inputImage.getOrThrow(" inputImage" )
698
718
719
+ /* * An audio input to the model. */
720
+ fun asResponseInputAudio (): ResponseInputAudio =
721
+ responseInputAudio.getOrThrow(" responseInputAudio" )
722
+
699
723
/* *
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.
701
726
*/
702
- fun asAnArrayOfInputTextAndInputImage (): List <JsonValue > =
703
- anArrayOfInputTextAndInputImage.getOrThrow(" anArrayOfInputTextAndInputImage" )
727
+ fun asAnArrayOfInputTextInputImageAndInputAudio (): List <JsonValue > =
728
+ anArrayOfInputTextInputImageAndInputAudio.getOrThrow(
729
+ " anArrayOfInputTextInputImageAndInputAudio"
730
+ )
704
731
705
732
fun _json (): Optional <JsonValue > = Optional .ofNullable(_json )
706
733
@@ -710,9 +737,11 @@ private constructor(
710
737
responseInputText != null -> visitor.visitResponseInputText(responseInputText)
711
738
outputText != null -> visitor.visitOutputText(outputText)
712
739
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
716
745
)
717
746
else -> visitor.unknown(_json )
718
747
}
@@ -740,8 +769,14 @@ private constructor(
740
769
inputImage.validate()
741
770
}
742
771
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 >
745
780
) {}
746
781
}
747
782
)
@@ -775,9 +810,13 @@ private constructor(
775
810
776
811
override fun visitInputImage (inputImage : InputImage ) = inputImage.validity()
777
812
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
781
820
782
821
override fun unknown (json : JsonValue ? ) = 0
783
822
}
@@ -793,7 +832,9 @@ private constructor(
793
832
responseInputText == other.responseInputText &&
794
833
outputText == other.outputText &&
795
834
inputImage == other.inputImage &&
796
- anArrayOfInputTextAndInputImage == other.anArrayOfInputTextAndInputImage
835
+ responseInputAudio == other.responseInputAudio &&
836
+ anArrayOfInputTextInputImageAndInputAudio ==
837
+ other.anArrayOfInputTextInputImageAndInputAudio
797
838
}
798
839
799
840
override fun hashCode (): Int =
@@ -802,7 +843,8 @@ private constructor(
802
843
responseInputText,
803
844
outputText,
804
845
inputImage,
805
- anArrayOfInputTextAndInputImage,
846
+ responseInputAudio,
847
+ anArrayOfInputTextInputImageAndInputAudio,
806
848
)
807
849
808
850
override fun toString (): String =
@@ -811,8 +853,9 @@ private constructor(
811
853
responseInputText != null -> " Content{responseInputText=$responseInputText }"
812
854
outputText != null -> " Content{outputText=$outputText }"
813
855
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 }"
816
859
_json != null -> " Content{_unknown=$_json }"
817
860
else -> throw IllegalStateException (" Invalid Content" )
818
861
}
@@ -835,17 +878,22 @@ private constructor(
835
878
@JvmStatic
836
879
fun ofInputImage (inputImage : InputImage ) = Content (inputImage = inputImage)
837
880
881
+ /* * An audio input to the model. */
882
+ @JvmStatic
883
+ fun ofResponseInputAudio (responseInputAudio : ResponseInputAudio ) =
884
+ Content (responseInputAudio = responseInputAudio)
885
+
838
886
/* *
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.
841
889
*/
842
890
@JvmStatic
843
- fun ofAnArrayOfInputTextAndInputImage (
844
- anArrayOfInputTextAndInputImage : List <JsonValue >
891
+ fun ofAnArrayOfInputTextInputImageAndInputAudio (
892
+ anArrayOfInputTextInputImageAndInputAudio : List <JsonValue >
845
893
) =
846
894
Content (
847
- anArrayOfInputTextAndInputImage =
848
- anArrayOfInputTextAndInputImage .toImmutable()
895
+ anArrayOfInputTextInputImageAndInputAudio =
896
+ anArrayOfInputTextInputImageAndInputAudio .toImmutable()
849
897
)
850
898
}
851
899
@@ -867,12 +915,15 @@ private constructor(
867
915
/* * An image input to the model. */
868
916
fun visitInputImage (inputImage : InputImage ): T
869
917
918
+ /* * An audio input to the model. */
919
+ fun visitResponseInputAudio (responseInputAudio : ResponseInputAudio ): T
920
+
870
921
/* *
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.
873
924
*/
874
- fun visitAnArrayOfInputTextAndInputImage (
875
- anArrayOfInputTextAndInputImage : List <JsonValue >
925
+ fun visitAnArrayOfInputTextInputImageAndInputAudio (
926
+ anArrayOfInputTextInputImageAndInputAudio : List <JsonValue >
876
927
): T
877
928
878
929
/* *
@@ -906,11 +957,17 @@ private constructor(
906
957
tryDeserialize(node, jacksonTypeRef<InputImage >())?.let {
907
958
Content (inputImage = it, _json = json)
908
959
},
960
+ tryDeserialize(node, jacksonTypeRef<ResponseInputAudio >())?.let {
961
+ Content (responseInputAudio = it, _json = json)
962
+ },
909
963
tryDeserialize(node, jacksonTypeRef<String >())?.let {
910
964
Content (textInput = it, _json = json)
911
965
},
912
966
tryDeserialize(node, jacksonTypeRef<List <JsonValue >>())?.let {
913
- Content (anArrayOfInputTextAndInputImage = it, _json = json)
967
+ Content (
968
+ anArrayOfInputTextInputImageAndInputAudio = it,
969
+ _json = json,
970
+ )
914
971
},
915
972
)
916
973
.filterNotNull()
@@ -942,8 +999,10 @@ private constructor(
942
999
generator.writeObject(value.responseInputText)
943
1000
value.outputText != null -> generator.writeObject(value.outputText)
944
1001
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)
947
1006
value._json != null -> generator.writeObject(value._json )
948
1007
else -> throw IllegalStateException (" Invalid Content" )
949
1008
}
0 commit comments