@@ -32,7 +32,7 @@ import java.util.Optional
32
32
class ChatCompletionCreateParams
33
33
constructor (
34
34
private val messages: List <ChatCompletionMessageParam >,
35
- private val model: Model ,
35
+ private val model: ChatModel ,
36
36
private val audio: ChatCompletionAudioParam ? ,
37
37
private val frequencyPenalty: Double? ,
38
38
private val functionCall: FunctionCall ? ,
@@ -66,7 +66,7 @@ constructor(
66
66
67
67
fun messages (): List <ChatCompletionMessageParam > = messages
68
68
69
- fun model (): Model = model
69
+ fun model (): ChatModel = model
70
70
71
71
fun audio (): Optional <ChatCompletionAudioParam > = Optional .ofNullable(audio)
72
72
@@ -170,7 +170,7 @@ constructor(
170
170
class ChatCompletionCreateBody
171
171
internal constructor (
172
172
private val messages: List <ChatCompletionMessageParam >? ,
173
- private val model: Model ? ,
173
+ private val model: ChatModel ? ,
174
174
private val audio: ChatCompletionAudioParam ? ,
175
175
private val frequencyPenalty: Double? ,
176
176
private val functionCall: FunctionCall ? ,
@@ -215,7 +215,7 @@ constructor(
215
215
* [model endpoint compatibility](https://platform.openai.com/docs/models#model-endpoint-compatibility)
216
216
* table for details on which models work with the Chat API.
217
217
*/
218
- @JsonProperty(" model" ) fun model (): Model ? = model
218
+ @JsonProperty(" model" ) fun model (): ChatModel ? = model
219
219
220
220
/* *
221
221
* Parameters for audio output. Required when audio output is requested with `modalities:
@@ -463,7 +463,7 @@ constructor(
463
463
class Builder {
464
464
465
465
private var messages: List <ChatCompletionMessageParam >? = null
466
- private var model: Model ? = null
466
+ private var model: ChatModel ? = null
467
467
private var audio: ChatCompletionAudioParam ? = null
468
468
private var frequencyPenalty: Double? = null
469
469
private var functionCall: FunctionCall ? = null
@@ -543,7 +543,7 @@ constructor(
543
543
* [model endpoint compatibility](https://platform.openai.com/docs/models#model-endpoint-compatibility)
544
544
* table for details on which models work with the Chat API.
545
545
*/
546
- @JsonProperty(" model" ) fun model (model : Model ) = apply { this .model = model }
546
+ @JsonProperty(" model" ) fun model (model : ChatModel ) = apply { this .model = model }
547
547
548
548
/* *
549
549
* Parameters for audio output. Required when audio output is requested with
@@ -898,7 +898,7 @@ constructor(
898
898
class Builder {
899
899
900
900
private var messages: MutableList <ChatCompletionMessageParam > = mutableListOf ()
901
- private var model: Model ? = null
901
+ private var model: ChatModel ? = null
902
902
private var audio: ChatCompletionAudioParam ? = null
903
903
private var frequencyPenalty: Double? = null
904
904
private var functionCall: FunctionCall ? = null
@@ -993,14 +993,14 @@ constructor(
993
993
* [model endpoint compatibility](https://platform.openai.com/docs/models#model-endpoint-compatibility)
994
994
* table for details on which models work with the Chat API.
995
995
*/
996
- fun model (model : Model ) = apply { this .model = model }
996
+ fun model (model : ChatModel ) = apply { this .model = model }
997
997
998
998
/* *
999
999
* ID of the model to use. See the
1000
1000
* [model endpoint compatibility](https://platform.openai.com/docs/models#model-endpoint-compatibility)
1001
1001
* table for details on which models work with the Chat API.
1002
1002
*/
1003
- fun model (value : String ) = apply { this .model = Model .of(value) }
1003
+ fun model (value : String ) = apply { this .model = ChatModel .of(value) }
1004
1004
1005
1005
/* *
1006
1006
* Parameters for audio output. Required when audio output is requested with `modalities:
@@ -1585,259 +1585,6 @@ constructor(
1585
1585
)
1586
1586
}
1587
1587
1588
- class Model
1589
- @JsonCreator
1590
- private constructor (
1591
- private val value: JsonField <String >,
1592
- ) : Enum {
1593
-
1594
- @com.fasterxml.jackson.annotation.JsonValue fun _value (): JsonField <String > = value
1595
-
1596
- override fun equals (other : Any? ): Boolean {
1597
- if (this == = other) {
1598
- return true
1599
- }
1600
-
1601
- return /* spotless:off */ other is Model && value == other.value /* spotless:on */
1602
- }
1603
-
1604
- override fun hashCode () = value.hashCode()
1605
-
1606
- override fun toString () = value.toString()
1607
-
1608
- companion object {
1609
-
1610
- @JvmField val O1_PREVIEW = Model (JsonField .of(" o1-preview" ))
1611
-
1612
- @JvmField val O1_PREVIEW_2024_09_12 = Model (JsonField .of(" o1-preview-2024-09-12" ))
1613
-
1614
- @JvmField val O1_MINI = Model (JsonField .of(" o1-mini" ))
1615
-
1616
- @JvmField val O1_MINI_2024_09_12 = Model (JsonField .of(" o1-mini-2024-09-12" ))
1617
-
1618
- @JvmField val GPT_4O = Model (JsonField .of(" gpt-4o" ))
1619
-
1620
- @JvmField val GPT_4O_2024_11_20 = Model (JsonField .of(" gpt-4o-2024-11-20" ))
1621
-
1622
- @JvmField val GPT_4O_2024_08_06 = Model (JsonField .of(" gpt-4o-2024-08-06" ))
1623
-
1624
- @JvmField val GPT_4O_2024_05_13 = Model (JsonField .of(" gpt-4o-2024-05-13" ))
1625
-
1626
- @JvmField val GPT_4O_REALTIME_PREVIEW = Model (JsonField .of(" gpt-4o-realtime-preview" ))
1627
-
1628
- @JvmField
1629
- val GPT_4O_REALTIME_PREVIEW_2024_10_01 =
1630
- Model (JsonField .of(" gpt-4o-realtime-preview-2024-10-01" ))
1631
-
1632
- @JvmField val GPT_4O_AUDIO_PREVIEW = Model (JsonField .of(" gpt-4o-audio-preview" ))
1633
-
1634
- @JvmField
1635
- val GPT_4O_AUDIO_PREVIEW_2024_10_01 =
1636
- Model (JsonField .of(" gpt-4o-audio-preview-2024-10-01" ))
1637
-
1638
- @JvmField val CHATGPT_4O_LATEST = Model (JsonField .of(" chatgpt-4o-latest" ))
1639
-
1640
- @JvmField val GPT_4O_MINI = Model (JsonField .of(" gpt-4o-mini" ))
1641
-
1642
- @JvmField val GPT_4O_MINI_2024_07_18 = Model (JsonField .of(" gpt-4o-mini-2024-07-18" ))
1643
-
1644
- @JvmField val GPT_4_TURBO = Model (JsonField .of(" gpt-4-turbo" ))
1645
-
1646
- @JvmField val GPT_4_TURBO_2024_04_09 = Model (JsonField .of(" gpt-4-turbo-2024-04-09" ))
1647
-
1648
- @JvmField val GPT_4_0125_PREVIEW = Model (JsonField .of(" gpt-4-0125-preview" ))
1649
-
1650
- @JvmField val GPT_4_TURBO_PREVIEW = Model (JsonField .of(" gpt-4-turbo-preview" ))
1651
-
1652
- @JvmField val GPT_4_1106_PREVIEW = Model (JsonField .of(" gpt-4-1106-preview" ))
1653
-
1654
- @JvmField val GPT_4_VISION_PREVIEW = Model (JsonField .of(" gpt-4-vision-preview" ))
1655
-
1656
- @JvmField val GPT_4 = Model (JsonField .of(" gpt-4" ))
1657
-
1658
- @JvmField val GPT_4_0314 = Model (JsonField .of(" gpt-4-0314" ))
1659
-
1660
- @JvmField val GPT_4_0613 = Model (JsonField .of(" gpt-4-0613" ))
1661
-
1662
- @JvmField val GPT_4_32K = Model (JsonField .of(" gpt-4-32k" ))
1663
-
1664
- @JvmField val GPT_4_32K_0314 = Model (JsonField .of(" gpt-4-32k-0314" ))
1665
-
1666
- @JvmField val GPT_4_32K_0613 = Model (JsonField .of(" gpt-4-32k-0613" ))
1667
-
1668
- @JvmField val GPT_3_5_TURBO = Model (JsonField .of(" gpt-3.5-turbo" ))
1669
-
1670
- @JvmField val GPT_3_5_TURBO_16K = Model (JsonField .of(" gpt-3.5-turbo-16k" ))
1671
-
1672
- @JvmField val GPT_3_5_TURBO_0301 = Model (JsonField .of(" gpt-3.5-turbo-0301" ))
1673
-
1674
- @JvmField val GPT_3_5_TURBO_0613 = Model (JsonField .of(" gpt-3.5-turbo-0613" ))
1675
-
1676
- @JvmField val GPT_3_5_TURBO_1106 = Model (JsonField .of(" gpt-3.5-turbo-1106" ))
1677
-
1678
- @JvmField val GPT_3_5_TURBO_0125 = Model (JsonField .of(" gpt-3.5-turbo-0125" ))
1679
-
1680
- @JvmField val GPT_3_5_TURBO_16K_0613 = Model (JsonField .of(" gpt-3.5-turbo-16k-0613" ))
1681
-
1682
- @JvmStatic fun of (value : String ) = Model (JsonField .of(value))
1683
- }
1684
-
1685
- enum class Known {
1686
- O1_PREVIEW ,
1687
- O1_PREVIEW_2024_09_12 ,
1688
- O1_MINI ,
1689
- O1_MINI_2024_09_12 ,
1690
- GPT_4O ,
1691
- GPT_4O_2024_11_20 ,
1692
- GPT_4O_2024_08_06 ,
1693
- GPT_4O_2024_05_13 ,
1694
- GPT_4O_REALTIME_PREVIEW ,
1695
- GPT_4O_REALTIME_PREVIEW_2024_10_01 ,
1696
- GPT_4O_AUDIO_PREVIEW ,
1697
- GPT_4O_AUDIO_PREVIEW_2024_10_01 ,
1698
- CHATGPT_4O_LATEST ,
1699
- GPT_4O_MINI ,
1700
- GPT_4O_MINI_2024_07_18 ,
1701
- GPT_4_TURBO ,
1702
- GPT_4_TURBO_2024_04_09 ,
1703
- GPT_4_0125_PREVIEW ,
1704
- GPT_4_TURBO_PREVIEW ,
1705
- GPT_4_1106_PREVIEW ,
1706
- GPT_4_VISION_PREVIEW ,
1707
- GPT_4 ,
1708
- GPT_4_0314 ,
1709
- GPT_4_0613 ,
1710
- GPT_4_32K ,
1711
- GPT_4_32K_0314 ,
1712
- GPT_4_32K_0613 ,
1713
- GPT_3_5_TURBO ,
1714
- GPT_3_5_TURBO_16K ,
1715
- GPT_3_5_TURBO_0301 ,
1716
- GPT_3_5_TURBO_0613 ,
1717
- GPT_3_5_TURBO_1106 ,
1718
- GPT_3_5_TURBO_0125 ,
1719
- GPT_3_5_TURBO_16K_0613 ,
1720
- }
1721
-
1722
- enum class Value {
1723
- O1_PREVIEW ,
1724
- O1_PREVIEW_2024_09_12 ,
1725
- O1_MINI ,
1726
- O1_MINI_2024_09_12 ,
1727
- GPT_4O ,
1728
- GPT_4O_2024_11_20 ,
1729
- GPT_4O_2024_08_06 ,
1730
- GPT_4O_2024_05_13 ,
1731
- GPT_4O_REALTIME_PREVIEW ,
1732
- GPT_4O_REALTIME_PREVIEW_2024_10_01 ,
1733
- GPT_4O_AUDIO_PREVIEW ,
1734
- GPT_4O_AUDIO_PREVIEW_2024_10_01 ,
1735
- CHATGPT_4O_LATEST ,
1736
- GPT_4O_MINI ,
1737
- GPT_4O_MINI_2024_07_18 ,
1738
- GPT_4_TURBO ,
1739
- GPT_4_TURBO_2024_04_09 ,
1740
- GPT_4_0125_PREVIEW ,
1741
- GPT_4_TURBO_PREVIEW ,
1742
- GPT_4_1106_PREVIEW ,
1743
- GPT_4_VISION_PREVIEW ,
1744
- GPT_4 ,
1745
- GPT_4_0314 ,
1746
- GPT_4_0613 ,
1747
- GPT_4_32K ,
1748
- GPT_4_32K_0314 ,
1749
- GPT_4_32K_0613 ,
1750
- GPT_3_5_TURBO ,
1751
- GPT_3_5_TURBO_16K ,
1752
- GPT_3_5_TURBO_0301 ,
1753
- GPT_3_5_TURBO_0613 ,
1754
- GPT_3_5_TURBO_1106 ,
1755
- GPT_3_5_TURBO_0125 ,
1756
- GPT_3_5_TURBO_16K_0613 ,
1757
- _UNKNOWN ,
1758
- }
1759
-
1760
- fun value (): Value =
1761
- when (this ) {
1762
- O1_PREVIEW -> Value .O1_PREVIEW
1763
- O1_PREVIEW_2024_09_12 -> Value .O1_PREVIEW_2024_09_12
1764
- O1_MINI -> Value .O1_MINI
1765
- O1_MINI_2024_09_12 -> Value .O1_MINI_2024_09_12
1766
- GPT_4O -> Value .GPT_4O
1767
- GPT_4O_2024_11_20 -> Value .GPT_4O_2024_11_20
1768
- GPT_4O_2024_08_06 -> Value .GPT_4O_2024_08_06
1769
- GPT_4O_2024_05_13 -> Value .GPT_4O_2024_05_13
1770
- GPT_4O_REALTIME_PREVIEW -> Value .GPT_4O_REALTIME_PREVIEW
1771
- GPT_4O_REALTIME_PREVIEW_2024_10_01 -> Value .GPT_4O_REALTIME_PREVIEW_2024_10_01
1772
- GPT_4O_AUDIO_PREVIEW -> Value .GPT_4O_AUDIO_PREVIEW
1773
- GPT_4O_AUDIO_PREVIEW_2024_10_01 -> Value .GPT_4O_AUDIO_PREVIEW_2024_10_01
1774
- CHATGPT_4O_LATEST -> Value .CHATGPT_4O_LATEST
1775
- GPT_4O_MINI -> Value .GPT_4O_MINI
1776
- GPT_4O_MINI_2024_07_18 -> Value .GPT_4O_MINI_2024_07_18
1777
- GPT_4_TURBO -> Value .GPT_4_TURBO
1778
- GPT_4_TURBO_2024_04_09 -> Value .GPT_4_TURBO_2024_04_09
1779
- GPT_4_0125_PREVIEW -> Value .GPT_4_0125_PREVIEW
1780
- GPT_4_TURBO_PREVIEW -> Value .GPT_4_TURBO_PREVIEW
1781
- GPT_4_1106_PREVIEW -> Value .GPT_4_1106_PREVIEW
1782
- GPT_4_VISION_PREVIEW -> Value .GPT_4_VISION_PREVIEW
1783
- GPT_4 -> Value .GPT_4
1784
- GPT_4_0314 -> Value .GPT_4_0314
1785
- GPT_4_0613 -> Value .GPT_4_0613
1786
- GPT_4_32K -> Value .GPT_4_32K
1787
- GPT_4_32K_0314 -> Value .GPT_4_32K_0314
1788
- GPT_4_32K_0613 -> Value .GPT_4_32K_0613
1789
- GPT_3_5_TURBO -> Value .GPT_3_5_TURBO
1790
- GPT_3_5_TURBO_16K -> Value .GPT_3_5_TURBO_16K
1791
- GPT_3_5_TURBO_0301 -> Value .GPT_3_5_TURBO_0301
1792
- GPT_3_5_TURBO_0613 -> Value .GPT_3_5_TURBO_0613
1793
- GPT_3_5_TURBO_1106 -> Value .GPT_3_5_TURBO_1106
1794
- GPT_3_5_TURBO_0125 -> Value .GPT_3_5_TURBO_0125
1795
- GPT_3_5_TURBO_16K_0613 -> Value .GPT_3_5_TURBO_16K_0613
1796
- else -> Value ._UNKNOWN
1797
- }
1798
-
1799
- fun known (): Known =
1800
- when (this ) {
1801
- O1_PREVIEW -> Known .O1_PREVIEW
1802
- O1_PREVIEW_2024_09_12 -> Known .O1_PREVIEW_2024_09_12
1803
- O1_MINI -> Known .O1_MINI
1804
- O1_MINI_2024_09_12 -> Known .O1_MINI_2024_09_12
1805
- GPT_4O -> Known .GPT_4O
1806
- GPT_4O_2024_11_20 -> Known .GPT_4O_2024_11_20
1807
- GPT_4O_2024_08_06 -> Known .GPT_4O_2024_08_06
1808
- GPT_4O_2024_05_13 -> Known .GPT_4O_2024_05_13
1809
- GPT_4O_REALTIME_PREVIEW -> Known .GPT_4O_REALTIME_PREVIEW
1810
- GPT_4O_REALTIME_PREVIEW_2024_10_01 -> Known .GPT_4O_REALTIME_PREVIEW_2024_10_01
1811
- GPT_4O_AUDIO_PREVIEW -> Known .GPT_4O_AUDIO_PREVIEW
1812
- GPT_4O_AUDIO_PREVIEW_2024_10_01 -> Known .GPT_4O_AUDIO_PREVIEW_2024_10_01
1813
- CHATGPT_4O_LATEST -> Known .CHATGPT_4O_LATEST
1814
- GPT_4O_MINI -> Known .GPT_4O_MINI
1815
- GPT_4O_MINI_2024_07_18 -> Known .GPT_4O_MINI_2024_07_18
1816
- GPT_4_TURBO -> Known .GPT_4_TURBO
1817
- GPT_4_TURBO_2024_04_09 -> Known .GPT_4_TURBO_2024_04_09
1818
- GPT_4_0125_PREVIEW -> Known .GPT_4_0125_PREVIEW
1819
- GPT_4_TURBO_PREVIEW -> Known .GPT_4_TURBO_PREVIEW
1820
- GPT_4_1106_PREVIEW -> Known .GPT_4_1106_PREVIEW
1821
- GPT_4_VISION_PREVIEW -> Known .GPT_4_VISION_PREVIEW
1822
- GPT_4 -> Known .GPT_4
1823
- GPT_4_0314 -> Known .GPT_4_0314
1824
- GPT_4_0613 -> Known .GPT_4_0613
1825
- GPT_4_32K -> Known .GPT_4_32K
1826
- GPT_4_32K_0314 -> Known .GPT_4_32K_0314
1827
- GPT_4_32K_0613 -> Known .GPT_4_32K_0613
1828
- GPT_3_5_TURBO -> Known .GPT_3_5_TURBO
1829
- GPT_3_5_TURBO_16K -> Known .GPT_3_5_TURBO_16K
1830
- GPT_3_5_TURBO_0301 -> Known .GPT_3_5_TURBO_0301
1831
- GPT_3_5_TURBO_0613 -> Known .GPT_3_5_TURBO_0613
1832
- GPT_3_5_TURBO_1106 -> Known .GPT_3_5_TURBO_1106
1833
- GPT_3_5_TURBO_0125 -> Known .GPT_3_5_TURBO_0125
1834
- GPT_3_5_TURBO_16K_0613 -> Known .GPT_3_5_TURBO_16K_0613
1835
- else -> throw OpenAIInvalidDataException (" Unknown Model: $value " )
1836
- }
1837
-
1838
- fun asString (): String = _value ().asStringOrThrow()
1839
- }
1840
-
1841
1588
@JsonDeserialize(using = FunctionCall .Deserializer ::class )
1842
1589
@JsonSerialize(using = FunctionCall .Serializer ::class )
1843
1590
class FunctionCall
0 commit comments