Skip to content

Commit 701e36c

Browse files
feat(api): slugs for new audio models; make all model params accept strings
1 parent d5345f4 commit 701e36c

File tree

11 files changed

+138
-36
lines changed

11 files changed

+138
-36
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 136
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-235aa1c75c6cc178b97d074a4671343469f458c4a306ef7beb4e45ab252aa589.yml
3-
openapi_spec_hash: 6e615d34cf8c6bc76e0c6933fc8569af
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-75926226b642ebb2cb415694da9dff35e8ab40145ac1b791cefb82a83809db4d.yml
3+
openapi_spec_hash: 6a0e391b0ba5747b6b4a3e5fe21de4da
44
config_hash: c028ce402ef5f71da947c3f15bf6046d

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ class AudioModel @JsonCreator private constructor(private val value: JsonField<S
2626

2727
@JvmField val GPT_4O_MINI_TRANSCRIBE = of("gpt-4o-mini-transcribe")
2828

29+
@JvmField val GPT_4O_MINI_TRANSCRIBE_2025_12_15 = of("gpt-4o-mini-transcribe-2025-12-15")
30+
2931
@JvmField val GPT_4O_TRANSCRIBE_DIARIZE = of("gpt-4o-transcribe-diarize")
3032

3133
@JvmStatic fun of(value: String) = AudioModel(JsonField.of(value))
@@ -36,6 +38,7 @@ class AudioModel @JsonCreator private constructor(private val value: JsonField<S
3638
WHISPER_1,
3739
GPT_4O_TRANSCRIBE,
3840
GPT_4O_MINI_TRANSCRIBE,
41+
GPT_4O_MINI_TRANSCRIBE_2025_12_15,
3942
GPT_4O_TRANSCRIBE_DIARIZE,
4043
}
4144

@@ -52,6 +55,7 @@ class AudioModel @JsonCreator private constructor(private val value: JsonField<S
5255
WHISPER_1,
5356
GPT_4O_TRANSCRIBE,
5457
GPT_4O_MINI_TRANSCRIBE,
58+
GPT_4O_MINI_TRANSCRIBE_2025_12_15,
5559
GPT_4O_TRANSCRIBE_DIARIZE,
5660
/** An enum member indicating that [AudioModel] was instantiated with an unknown value. */
5761
_UNKNOWN,
@@ -69,6 +73,7 @@ class AudioModel @JsonCreator private constructor(private val value: JsonField<S
6973
WHISPER_1 -> Value.WHISPER_1
7074
GPT_4O_TRANSCRIBE -> Value.GPT_4O_TRANSCRIBE
7175
GPT_4O_MINI_TRANSCRIBE -> Value.GPT_4O_MINI_TRANSCRIBE
76+
GPT_4O_MINI_TRANSCRIBE_2025_12_15 -> Value.GPT_4O_MINI_TRANSCRIBE_2025_12_15
7277
GPT_4O_TRANSCRIBE_DIARIZE -> Value.GPT_4O_TRANSCRIBE_DIARIZE
7378
else -> Value._UNKNOWN
7479
}
@@ -86,6 +91,7 @@ class AudioModel @JsonCreator private constructor(private val value: JsonField<S
8691
WHISPER_1 -> Known.WHISPER_1
8792
GPT_4O_TRANSCRIBE -> Known.GPT_4O_TRANSCRIBE
8893
GPT_4O_MINI_TRANSCRIBE -> Known.GPT_4O_MINI_TRANSCRIBE
94+
GPT_4O_MINI_TRANSCRIBE_2025_12_15 -> Known.GPT_4O_MINI_TRANSCRIBE_2025_12_15
8995
GPT_4O_TRANSCRIBE_DIARIZE -> Known.GPT_4O_TRANSCRIBE_DIARIZE
9096
else -> throw OpenAIInvalidDataException("Unknown AudioModel: $value")
9197
}

openai-java-core/src/main/kotlin/com/openai/models/audio/speech/SpeechCreateParams.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ private constructor(
3939

4040
/**
4141
* One of the available [TTS models](https://platform.openai.com/docs/models#tts): `tts-1`,
42-
* `tts-1-hd` or `gpt-4o-mini-tts`.
42+
* `tts-1-hd`, `gpt-4o-mini-tts`, or `gpt-4o-mini-tts-2025-12-15`.
4343
*
4444
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is
4545
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
@@ -206,7 +206,7 @@ private constructor(
206206

207207
/**
208208
* One of the available [TTS models](https://platform.openai.com/docs/models#tts): `tts-1`,
209-
* `tts-1-hd` or `gpt-4o-mini-tts`.
209+
* `tts-1-hd`, `gpt-4o-mini-tts`, or `gpt-4o-mini-tts-2025-12-15`.
210210
*/
211211
fun model(model: SpeechModel) = apply { body.model(model) }
212212

@@ -512,7 +512,7 @@ private constructor(
512512

513513
/**
514514
* One of the available [TTS models](https://platform.openai.com/docs/models#tts): `tts-1`,
515-
* `tts-1-hd` or `gpt-4o-mini-tts`.
515+
* `tts-1-hd`, `gpt-4o-mini-tts`, or `gpt-4o-mini-tts-2025-12-15`.
516516
*
517517
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is
518518
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
@@ -690,7 +690,7 @@ private constructor(
690690

691691
/**
692692
* One of the available [TTS models](https://platform.openai.com/docs/models#tts):
693-
* `tts-1`, `tts-1-hd` or `gpt-4o-mini-tts`.
693+
* `tts-1`, `tts-1-hd`, `gpt-4o-mini-tts`, or `gpt-4o-mini-tts-2025-12-15`.
694694
*/
695695
fun model(model: SpeechModel) = model(JsonField.of(model))
696696

openai-java-core/src/main/kotlin/com/openai/models/audio/speech/SpeechModel.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ class SpeechModel @JsonCreator private constructor(private val value: JsonField<
2626

2727
@JvmField val GPT_4O_MINI_TTS = of("gpt-4o-mini-tts")
2828

29+
@JvmField val GPT_4O_MINI_TTS_2025_12_15 = of("gpt-4o-mini-tts-2025-12-15")
30+
2931
@JvmStatic fun of(value: String) = SpeechModel(JsonField.of(value))
3032
}
3133

@@ -34,6 +36,7 @@ class SpeechModel @JsonCreator private constructor(private val value: JsonField<
3436
TTS_1,
3537
TTS_1_HD,
3638
GPT_4O_MINI_TTS,
39+
GPT_4O_MINI_TTS_2025_12_15,
3740
}
3841

3942
/**
@@ -49,6 +52,7 @@ class SpeechModel @JsonCreator private constructor(private val value: JsonField<
4952
TTS_1,
5053
TTS_1_HD,
5154
GPT_4O_MINI_TTS,
55+
GPT_4O_MINI_TTS_2025_12_15,
5256
/** An enum member indicating that [SpeechModel] was instantiated with an unknown value. */
5357
_UNKNOWN,
5458
}
@@ -65,6 +69,7 @@ class SpeechModel @JsonCreator private constructor(private val value: JsonField<
6569
TTS_1 -> Value.TTS_1
6670
TTS_1_HD -> Value.TTS_1_HD
6771
GPT_4O_MINI_TTS -> Value.GPT_4O_MINI_TTS
72+
GPT_4O_MINI_TTS_2025_12_15 -> Value.GPT_4O_MINI_TTS_2025_12_15
6873
else -> Value._UNKNOWN
6974
}
7075

@@ -81,6 +86,7 @@ class SpeechModel @JsonCreator private constructor(private val value: JsonField<
8186
TTS_1 -> Known.TTS_1
8287
TTS_1_HD -> Known.TTS_1_HD
8388
GPT_4O_MINI_TTS -> Known.GPT_4O_MINI_TTS
89+
GPT_4O_MINI_TTS_2025_12_15 -> Known.GPT_4O_MINI_TTS_2025_12_15
8490
else -> throw OpenAIInvalidDataException("Unknown SpeechModel: $value")
8591
}
8692

openai-java-core/src/main/kotlin/com/openai/models/audio/transcriptions/TranscriptionCreateParams.kt

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ private constructor(
5353

5454
/**
5555
* ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`,
56-
* `whisper-1` (which is powered by our open source Whisper V2 model), and
57-
* `gpt-4o-transcribe-diarize`.
56+
* `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1` (which is powered by our open source Whisper
57+
* V2 model), and `gpt-4o-transcribe-diarize`.
5858
*
5959
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is
6060
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
@@ -77,8 +77,9 @@ private constructor(
7777
* Additional information to include in the transcription response. `logprobs` will return the
7878
* log probabilities of the tokens in the response to understand the model's confidence in the
7979
* transcription. `logprobs` only works with response_format set to `json` and only with the
80-
* models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe`. This field is not supported when
81-
* using `gpt-4o-transcribe-diarize`.
80+
* models `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and
81+
* `gpt-4o-mini-transcribe-2025-12-15`. This field is not supported when using
82+
* `gpt-4o-transcribe-diarize`.
8283
*
8384
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
8485
* server responded with an unexpected value).
@@ -328,8 +329,8 @@ private constructor(
328329

329330
/**
330331
* ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`,
331-
* `whisper-1` (which is powered by our open source Whisper V2 model), and
332-
* `gpt-4o-transcribe-diarize`.
332+
* `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1` (which is powered by our open source
333+
* Whisper V2 model), and `gpt-4o-transcribe-diarize`.
333334
*/
334335
fun model(model: AudioModel) = apply { body.model(model) }
335336

@@ -388,8 +389,9 @@ private constructor(
388389
* Additional information to include in the transcription response. `logprobs` will return
389390
* the log probabilities of the tokens in the response to understand the model's confidence
390391
* in the transcription. `logprobs` only works with response_format set to `json` and only
391-
* with the models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe`. This field is not
392-
* supported when using `gpt-4o-transcribe-diarize`.
392+
* with the models `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and
393+
* `gpt-4o-mini-transcribe-2025-12-15`. This field is not supported when using
394+
* `gpt-4o-transcribe-diarize`.
393395
*/
394396
fun include(include: List<TranscriptionInclude>) = apply { body.include(include) }
395397

@@ -759,8 +761,8 @@ private constructor(
759761

760762
/**
761763
* ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`,
762-
* `whisper-1` (which is powered by our open source Whisper V2 model), and
763-
* `gpt-4o-transcribe-diarize`.
764+
* `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1` (which is powered by our open source
765+
* Whisper V2 model), and `gpt-4o-transcribe-diarize`.
764766
*
765767
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is
766768
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
@@ -784,8 +786,9 @@ private constructor(
784786
* Additional information to include in the transcription response. `logprobs` will return
785787
* the log probabilities of the tokens in the response to understand the model's confidence
786788
* in the transcription. `logprobs` only works with response_format set to `json` and only
787-
* with the models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe`. This field is not
788-
* supported when using `gpt-4o-transcribe-diarize`.
789+
* with the models `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and
790+
* `gpt-4o-mini-transcribe-2025-12-15`. This field is not supported when using
791+
* `gpt-4o-transcribe-diarize`.
789792
*
790793
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
791794
* server responded with an unexpected value).
@@ -1069,8 +1072,8 @@ private constructor(
10691072

10701073
/**
10711074
* ID of the model to use. The options are `gpt-4o-transcribe`,
1072-
* `gpt-4o-mini-transcribe`, `whisper-1` (which is powered by our open source Whisper V2
1073-
* model), and `gpt-4o-transcribe-diarize`.
1075+
* `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1` (which is
1076+
* powered by our open source Whisper V2 model), and `gpt-4o-transcribe-diarize`.
10741077
*/
10751078
fun model(model: AudioModel) = model(MultipartField.of(model))
10761079

@@ -1132,8 +1135,9 @@ private constructor(
11321135
* Additional information to include in the transcription response. `logprobs` will
11331136
* return the log probabilities of the tokens in the response to understand the model's
11341137
* confidence in the transcription. `logprobs` only works with response_format set to
1135-
* `json` and only with the models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe`.
1136-
* This field is not supported when using `gpt-4o-transcribe-diarize`.
1138+
* `json` and only with the models `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and
1139+
* `gpt-4o-mini-transcribe-2025-12-15`. This field is not supported when using
1140+
* `gpt-4o-transcribe-diarize`.
11371141
*/
11381142
fun include(include: List<TranscriptionInclude>) = include(MultipartField.of(include))
11391143

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

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import com.openai.errors.OpenAIInvalidDataException
1515
import java.util.Collections
1616
import java.util.Objects
1717
import java.util.Optional
18-
import kotlin.jvm.optionals.getOrNull
1918

2019
class AudioTranscription
2120
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
@@ -45,8 +44,9 @@ private constructor(
4544

4645
/**
4746
* The model to use for transcription. Current options are `whisper-1`,
48-
* `gpt-4o-mini-transcribe`, `gpt-4o-transcribe`, and `gpt-4o-transcribe-diarize`. Use
49-
* `gpt-4o-transcribe-diarize` when you need diarization with speaker labels.
47+
* `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `gpt-4o-transcribe`, and
48+
* `gpt-4o-transcribe-diarize`. Use `gpt-4o-transcribe-diarize` when you need diarization with
49+
* speaker labels.
5050
*
5151
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
5252
* server responded with an unexpected value).
@@ -137,8 +137,9 @@ private constructor(
137137

138138
/**
139139
* The model to use for transcription. Current options are `whisper-1`,
140-
* `gpt-4o-mini-transcribe`, `gpt-4o-transcribe`, and `gpt-4o-transcribe-diarize`. Use
141-
* `gpt-4o-transcribe-diarize` when you need diarization with speaker labels.
140+
* `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `gpt-4o-transcribe`, and
141+
* `gpt-4o-transcribe-diarize`. Use `gpt-4o-transcribe-diarize` when you need diarization
142+
* with speaker labels.
142143
*/
143144
fun model(model: Model) = model(JsonField.of(model))
144145

@@ -150,6 +151,14 @@ private constructor(
150151
*/
151152
fun model(model: JsonField<Model>) = apply { this.model = model }
152153

154+
/**
155+
* Sets [model] to an arbitrary [String].
156+
*
157+
* You should usually call [model] with a well-typed [Model] constant instead. This method
158+
* is primarily for setting the field to an undocumented or not yet supported value.
159+
*/
160+
fun model(value: String) = model(Model.of(value))
161+
153162
/**
154163
* An optional text to guide the model's style or continue a previous audio segment. For
155164
* `whisper-1`, the
@@ -203,7 +212,7 @@ private constructor(
203212
}
204213

205214
language()
206-
model().ifPresent { it.validate() }
215+
model()
207216
prompt()
208217
validated = true
209218
}
@@ -224,13 +233,14 @@ private constructor(
224233
@JvmSynthetic
225234
internal fun validity(): Int =
226235
(if (language.asKnown().isPresent) 1 else 0) +
227-
(model.asKnown().getOrNull()?.validity() ?: 0) +
236+
(if (model.asKnown().isPresent) 1 else 0) +
228237
(if (prompt.asKnown().isPresent) 1 else 0)
229238

230239
/**
231240
* The model to use for transcription. Current options are `whisper-1`,
232-
* `gpt-4o-mini-transcribe`, `gpt-4o-transcribe`, and `gpt-4o-transcribe-diarize`. Use
233-
* `gpt-4o-transcribe-diarize` when you need diarization with speaker labels.
241+
* `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `gpt-4o-transcribe`, and
242+
* `gpt-4o-transcribe-diarize`. Use `gpt-4o-transcribe-diarize` when you need diarization with
243+
* speaker labels.
234244
*/
235245
class Model @JsonCreator private constructor(private val value: JsonField<String>) : Enum {
236246

@@ -250,6 +260,9 @@ private constructor(
250260

251261
@JvmField val GPT_4O_MINI_TRANSCRIBE = of("gpt-4o-mini-transcribe")
252262

263+
@JvmField
264+
val GPT_4O_MINI_TRANSCRIBE_2025_12_15 = of("gpt-4o-mini-transcribe-2025-12-15")
265+
253266
@JvmField val GPT_4O_TRANSCRIBE = of("gpt-4o-transcribe")
254267

255268
@JvmField val GPT_4O_TRANSCRIBE_DIARIZE = of("gpt-4o-transcribe-diarize")
@@ -261,6 +274,7 @@ private constructor(
261274
enum class Known {
262275
WHISPER_1,
263276
GPT_4O_MINI_TRANSCRIBE,
277+
GPT_4O_MINI_TRANSCRIBE_2025_12_15,
264278
GPT_4O_TRANSCRIBE,
265279
GPT_4O_TRANSCRIBE_DIARIZE,
266280
}
@@ -277,6 +291,7 @@ private constructor(
277291
enum class Value {
278292
WHISPER_1,
279293
GPT_4O_MINI_TRANSCRIBE,
294+
GPT_4O_MINI_TRANSCRIBE_2025_12_15,
280295
GPT_4O_TRANSCRIBE,
281296
GPT_4O_TRANSCRIBE_DIARIZE,
282297
/** An enum member indicating that [Model] was instantiated with an unknown value. */
@@ -294,6 +309,7 @@ private constructor(
294309
when (this) {
295310
WHISPER_1 -> Value.WHISPER_1
296311
GPT_4O_MINI_TRANSCRIBE -> Value.GPT_4O_MINI_TRANSCRIBE
312+
GPT_4O_MINI_TRANSCRIBE_2025_12_15 -> Value.GPT_4O_MINI_TRANSCRIBE_2025_12_15
297313
GPT_4O_TRANSCRIBE -> Value.GPT_4O_TRANSCRIBE
298314
GPT_4O_TRANSCRIBE_DIARIZE -> Value.GPT_4O_TRANSCRIBE_DIARIZE
299315
else -> Value._UNKNOWN
@@ -312,6 +328,7 @@ private constructor(
312328
when (this) {
313329
WHISPER_1 -> Known.WHISPER_1
314330
GPT_4O_MINI_TRANSCRIBE -> Known.GPT_4O_MINI_TRANSCRIBE
331+
GPT_4O_MINI_TRANSCRIBE_2025_12_15 -> Known.GPT_4O_MINI_TRANSCRIBE_2025_12_15
315332
GPT_4O_TRANSCRIBE -> Known.GPT_4O_TRANSCRIBE
316333
GPT_4O_TRANSCRIBE_DIARIZE -> Known.GPT_4O_TRANSCRIBE_DIARIZE
317334
else -> throw OpenAIInvalidDataException("Unknown Model: $value")

0 commit comments

Comments
 (0)