Skip to content

Commit bdf67b3

Browse files
feat(api): add gpt-4.5-preview (#258)
1 parent 04354f3 commit bdf67b3

File tree

7 files changed

+55
-8
lines changed

7 files changed

+55
-8
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 65
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-4aa6ee65ba9efc789e05e6a5ef0883b2cadf06def8efd863dbf75e9e233067e1.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-5d30684c3118d049682ea30cdb4dbef39b97d51667da484689193dc40162af32.yml

openai-java-core/src/main/kotlin/com/openai/models/BetaAssistantUpdateParams.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1629,6 +1629,10 @@ private constructor(
16291629

16301630
@JvmField val GPT_4O_MINI_2024_07_18 = of("gpt-4o-mini-2024-07-18")
16311631

1632+
@JvmField val GPT_4_5_PREVIEW = of("gpt-4.5-preview")
1633+
1634+
@JvmField val GPT_4_5_PREVIEW_2025_02_27 = of("gpt-4.5-preview-2025-02-27")
1635+
16321636
@JvmField val GPT_4_TURBO = of("gpt-4-turbo")
16331637

16341638
@JvmField val GPT_4_TURBO_2024_04_09 = of("gpt-4-turbo-2024-04-09")
@@ -1680,6 +1684,8 @@ private constructor(
16801684
GPT_4O_2024_05_13,
16811685
GPT_4O_MINI,
16821686
GPT_4O_MINI_2024_07_18,
1687+
GPT_4_5_PREVIEW,
1688+
GPT_4_5_PREVIEW_2025_02_27,
16831689
GPT_4_TURBO,
16841690
GPT_4_TURBO_2024_04_09,
16851691
GPT_4_0125_PREVIEW,
@@ -1720,6 +1726,8 @@ private constructor(
17201726
GPT_4O_2024_05_13,
17211727
GPT_4O_MINI,
17221728
GPT_4O_MINI_2024_07_18,
1729+
GPT_4_5_PREVIEW,
1730+
GPT_4_5_PREVIEW_2025_02_27,
17231731
GPT_4_TURBO,
17241732
GPT_4_TURBO_2024_04_09,
17251733
GPT_4_0125_PREVIEW,
@@ -1761,6 +1769,8 @@ private constructor(
17611769
GPT_4O_2024_05_13 -> Value.GPT_4O_2024_05_13
17621770
GPT_4O_MINI -> Value.GPT_4O_MINI
17631771
GPT_4O_MINI_2024_07_18 -> Value.GPT_4O_MINI_2024_07_18
1772+
GPT_4_5_PREVIEW -> Value.GPT_4_5_PREVIEW
1773+
GPT_4_5_PREVIEW_2025_02_27 -> Value.GPT_4_5_PREVIEW_2025_02_27
17641774
GPT_4_TURBO -> Value.GPT_4_TURBO
17651775
GPT_4_TURBO_2024_04_09 -> Value.GPT_4_TURBO_2024_04_09
17661776
GPT_4_0125_PREVIEW -> Value.GPT_4_0125_PREVIEW
@@ -1803,6 +1813,8 @@ private constructor(
18031813
GPT_4O_2024_05_13 -> Known.GPT_4O_2024_05_13
18041814
GPT_4O_MINI -> Known.GPT_4O_MINI
18051815
GPT_4O_MINI_2024_07_18 -> Known.GPT_4O_MINI_2024_07_18
1816+
GPT_4_5_PREVIEW -> Known.GPT_4_5_PREVIEW
1817+
GPT_4_5_PREVIEW_2025_02_27 -> Known.GPT_4_5_PREVIEW_2025_02_27
18061818
GPT_4_TURBO -> Known.GPT_4_TURBO
18071819
GPT_4_TURBO_2024_04_09 -> Known.GPT_4_TURBO_2024_04_09
18081820
GPT_4_0125_PREVIEW -> Known.GPT_4_0125_PREVIEW

openai-java-core/src/main/kotlin/com/openai/models/ChatModel.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ class ChatModel @JsonCreator private constructor(private val value: JsonField<St
3636

3737
@JvmField val O1_MINI_2024_09_12 = of("o1-mini-2024-09-12")
3838

39+
@JvmField val GPT_4_5_PREVIEW = of("gpt-4.5-preview")
40+
41+
@JvmField val GPT_4_5_PREVIEW_2025_02_27 = of("gpt-4.5-preview-2025-02-27")
42+
3943
@JvmField val GPT_4O = of("gpt-4o")
4044

4145
@JvmField val GPT_4O_2024_11_20 = of("gpt-4o-2024-11-20")
@@ -112,6 +116,8 @@ class ChatModel @JsonCreator private constructor(private val value: JsonField<St
112116
O1_PREVIEW_2024_09_12,
113117
O1_MINI,
114118
O1_MINI_2024_09_12,
119+
GPT_4_5_PREVIEW,
120+
GPT_4_5_PREVIEW_2025_02_27,
115121
GPT_4O,
116122
GPT_4O_2024_11_20,
117123
GPT_4O_2024_08_06,
@@ -163,6 +169,8 @@ class ChatModel @JsonCreator private constructor(private val value: JsonField<St
163169
O1_PREVIEW_2024_09_12,
164170
O1_MINI,
165171
O1_MINI_2024_09_12,
172+
GPT_4_5_PREVIEW,
173+
GPT_4_5_PREVIEW_2025_02_27,
166174
GPT_4O,
167175
GPT_4O_2024_11_20,
168176
GPT_4O_2024_08_06,
@@ -215,6 +223,8 @@ class ChatModel @JsonCreator private constructor(private val value: JsonField<St
215223
O1_PREVIEW_2024_09_12 -> Value.O1_PREVIEW_2024_09_12
216224
O1_MINI -> Value.O1_MINI
217225
O1_MINI_2024_09_12 -> Value.O1_MINI_2024_09_12
226+
GPT_4_5_PREVIEW -> Value.GPT_4_5_PREVIEW
227+
GPT_4_5_PREVIEW_2025_02_27 -> Value.GPT_4_5_PREVIEW_2025_02_27
218228
GPT_4O -> Value.GPT_4O
219229
GPT_4O_2024_11_20 -> Value.GPT_4O_2024_11_20
220230
GPT_4O_2024_08_06 -> Value.GPT_4O_2024_08_06
@@ -267,6 +277,8 @@ class ChatModel @JsonCreator private constructor(private val value: JsonField<St
267277
O1_PREVIEW_2024_09_12 -> Known.O1_PREVIEW_2024_09_12
268278
O1_MINI -> Known.O1_MINI
269279
O1_MINI_2024_09_12 -> Known.O1_MINI_2024_09_12
280+
GPT_4_5_PREVIEW -> Known.GPT_4_5_PREVIEW
281+
GPT_4_5_PREVIEW_2025_02_27 -> Known.GPT_4_5_PREVIEW_2025_02_27
270282
GPT_4O -> Known.GPT_4O
271283
GPT_4O_2024_11_20 -> Known.GPT_4O_2024_11_20
272284
GPT_4O_2024_08_06 -> Known.GPT_4O_2024_08_06

openai-java-core/src/main/kotlin/com/openai/models/FileObject.kt

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ private constructor(
3939
@JsonProperty("status")
4040
@ExcludeMissing
4141
private val status: JsonField<Status> = JsonMissing.of(),
42+
@JsonProperty("expires_at")
43+
@ExcludeMissing
44+
private val expiresAt: JsonField<Long> = JsonMissing.of(),
4245
@JsonProperty("status_details")
4346
@ExcludeMissing
4447
private val statusDetails: JsonField<String> = JsonMissing.of(),
@@ -72,6 +75,9 @@ private constructor(
7275
*/
7376
@Deprecated("deprecated") fun status(): Status = status.getRequired("status")
7477

78+
/** The Unix timestamp (in seconds) for when the file will expire. */
79+
fun expiresAt(): Optional<Long> = Optional.ofNullable(expiresAt.getNullable("expires_at"))
80+
7581
/**
7682
* Deprecated. For details on why a fine-tuning training file failed validation, see the `error`
7783
* field on `fine_tuning.job`.
@@ -107,6 +113,9 @@ private constructor(
107113
@ExcludeMissing
108114
fun _status(): JsonField<Status> = status
109115

116+
/** The Unix timestamp (in seconds) for when the file will expire. */
117+
@JsonProperty("expires_at") @ExcludeMissing fun _expiresAt(): JsonField<Long> = expiresAt
118+
110119
/**
111120
* Deprecated. For details on why a fine-tuning training file failed validation, see the `error`
112121
* field on `fine_tuning.job`.
@@ -138,6 +147,7 @@ private constructor(
138147
}
139148
purpose()
140149
status()
150+
expiresAt()
141151
statusDetails()
142152
validated = true
143153
}
@@ -159,6 +169,7 @@ private constructor(
159169
private var object_: JsonValue = JsonValue.from("file")
160170
private var purpose: JsonField<Purpose>? = null
161171
private var status: JsonField<Status>? = null
172+
private var expiresAt: JsonField<Long> = JsonMissing.of()
162173
private var statusDetails: JsonField<String> = JsonMissing.of()
163174
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
164175

@@ -171,6 +182,7 @@ private constructor(
171182
object_ = fileObject.object_
172183
purpose = fileObject.purpose
173184
status = fileObject.status
185+
expiresAt = fileObject.expiresAt
174186
statusDetails = fileObject.statusDetails
175187
additionalProperties = fileObject.additionalProperties.toMutableMap()
176188
}
@@ -227,6 +239,12 @@ private constructor(
227239
@Deprecated("deprecated")
228240
fun status(status: JsonField<Status>) = apply { this.status = status }
229241

242+
/** The Unix timestamp (in seconds) for when the file will expire. */
243+
fun expiresAt(expiresAt: Long) = expiresAt(JsonField.of(expiresAt))
244+
245+
/** The Unix timestamp (in seconds) for when the file will expire. */
246+
fun expiresAt(expiresAt: JsonField<Long>) = apply { this.expiresAt = expiresAt }
247+
230248
/**
231249
* Deprecated. For details on why a fine-tuning training file failed validation, see the
232250
* `error` field on `fine_tuning.job`.
@@ -271,6 +289,7 @@ private constructor(
271289
object_,
272290
checkRequired("purpose", purpose),
273291
checkRequired("status", status),
292+
expiresAt,
274293
statusDetails,
275294
additionalProperties.toImmutable(),
276295
)
@@ -522,15 +541,15 @@ private constructor(
522541
return true
523542
}
524543

525-
return /* spotless:off */ other is FileObject && id == other.id && bytes == other.bytes && createdAt == other.createdAt && filename == other.filename && object_ == other.object_ && purpose == other.purpose && status == other.status && statusDetails == other.statusDetails && additionalProperties == other.additionalProperties /* spotless:on */
544+
return /* spotless:off */ other is FileObject && id == other.id && bytes == other.bytes && createdAt == other.createdAt && filename == other.filename && object_ == other.object_ && purpose == other.purpose && status == other.status && expiresAt == other.expiresAt && statusDetails == other.statusDetails && additionalProperties == other.additionalProperties /* spotless:on */
526545
}
527546

528547
/* spotless:off */
529-
private val hashCode: Int by lazy { Objects.hash(id, bytes, createdAt, filename, object_, purpose, status, statusDetails, additionalProperties) }
548+
private val hashCode: Int by lazy { Objects.hash(id, bytes, createdAt, filename, object_, purpose, status, expiresAt, statusDetails, additionalProperties) }
530549
/* spotless:on */
531550

532551
override fun hashCode(): Int = hashCode
533552

534553
override fun toString() =
535-
"FileObject{id=$id, bytes=$bytes, createdAt=$createdAt, filename=$filename, object_=$object_, purpose=$purpose, status=$status, statusDetails=$statusDetails, additionalProperties=$additionalProperties}"
554+
"FileObject{id=$id, bytes=$bytes, createdAt=$createdAt, filename=$filename, object_=$object_, purpose=$purpose, status=$status, expiresAt=$expiresAt, statusDetails=$statusDetails, additionalProperties=$additionalProperties}"
536555
}

openai-java-core/src/main/kotlin/com/openai/models/Upload.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ private constructor(
5757
/** The Unix timestamp (in seconds) for when the Upload was created. */
5858
fun createdAt(): Long = createdAt.getRequired("created_at")
5959

60-
/** The Unix timestamp (in seconds) for when the Upload was created. */
60+
/** The Unix timestamp (in seconds) for when the Upload will expire. */
6161
fun expiresAt(): Long = expiresAt.getRequired("expires_at")
6262

6363
/** The name of the file to be uploaded. */
@@ -88,7 +88,7 @@ private constructor(
8888
/** The Unix timestamp (in seconds) for when the Upload was created. */
8989
@JsonProperty("created_at") @ExcludeMissing fun _createdAt(): JsonField<Long> = createdAt
9090

91-
/** The Unix timestamp (in seconds) for when the Upload was created. */
91+
/** The Unix timestamp (in seconds) for when the Upload will expire. */
9292
@JsonProperty("expires_at") @ExcludeMissing fun _expiresAt(): JsonField<Long> = expiresAt
9393

9494
/** The name of the file to be uploaded. */
@@ -187,10 +187,10 @@ private constructor(
187187
/** The Unix timestamp (in seconds) for when the Upload was created. */
188188
fun createdAt(createdAt: JsonField<Long>) = apply { this.createdAt = createdAt }
189189

190-
/** The Unix timestamp (in seconds) for when the Upload was created. */
190+
/** The Unix timestamp (in seconds) for when the Upload will expire. */
191191
fun expiresAt(expiresAt: Long) = expiresAt(JsonField.of(expiresAt))
192192

193-
/** The Unix timestamp (in seconds) for when the Upload was created. */
193+
/** The Unix timestamp (in seconds) for when the Upload will expire. */
194194
fun expiresAt(expiresAt: JsonField<Long>) = apply { this.expiresAt = expiresAt }
195195

196196
/** The name of the file to be uploaded. */

openai-java-core/src/test/kotlin/com/openai/models/FileObjectTest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class FileObjectTest {
1717
.filename("filename")
1818
.purpose(FileObject.Purpose.ASSISTANTS)
1919
.status(FileObject.Status.UPLOADED)
20+
.expiresAt(0L)
2021
.statusDetails("status_details")
2122
.build()
2223
assertThat(fileObject).isNotNull
@@ -26,6 +27,7 @@ class FileObjectTest {
2627
assertThat(fileObject.filename()).isEqualTo("filename")
2728
assertThat(fileObject.purpose()).isEqualTo(FileObject.Purpose.ASSISTANTS)
2829
assertThat(fileObject.status()).isEqualTo(FileObject.Status.UPLOADED)
30+
assertThat(fileObject.expiresAt()).contains(0L)
2931
assertThat(fileObject.statusDetails()).contains("status_details")
3032
}
3133
}

openai-java-core/src/test/kotlin/com/openai/models/UploadTest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class UploadTest {
2626
.filename("filename")
2727
.purpose(FileObject.Purpose.ASSISTANTS)
2828
.status(FileObject.Status.UPLOADED)
29+
.expiresAt(0L)
2930
.statusDetails("status_details")
3031
.build()
3132
)
@@ -47,6 +48,7 @@ class UploadTest {
4748
.filename("filename")
4849
.purpose(FileObject.Purpose.ASSISTANTS)
4950
.status(FileObject.Status.UPLOADED)
51+
.expiresAt(0L)
5052
.statusDetails("status_details")
5153
.build()
5254
)

0 commit comments

Comments
 (0)