@@ -39,8 +39,8 @@ private constructor(
3939 fun input (): String = body.input()
4040
4141 /* *
42- * One of the available [TTS models](https://platform.openai.com/docs/models#tts): `tts-1` or
43- * `tts-1-hd`
42+ * One of the available [TTS models](https://platform.openai.com/docs/models#tts): `tts-1`,
43+ * `tts-1-hd` or `gpt-4o-mini-tts`.
4444 *
4545 * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is
4646 * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
@@ -58,6 +58,15 @@ private constructor(
5858 */
5959 fun voice (): Voice = body.voice()
6060
61+ /* *
62+ * Control the voice of your generated audio with additional instructions. Does not work with
63+ * `tts-1` or `tts-1-hd`.
64+ *
65+ * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
66+ * server responded with an unexpected value).
67+ */
68+ fun instructions (): Optional <String > = body.instructions()
69+
6170 /* *
6271 * The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm`.
6372 *
@@ -95,6 +104,13 @@ private constructor(
95104 */
96105 fun _voice (): JsonField <Voice > = body._voice ()
97106
107+ /* *
108+ * Returns the raw JSON value of [instructions].
109+ *
110+ * Unlike [instructions], this method doesn't throw if the JSON field has an unexpected type.
111+ */
112+ fun _instructions (): JsonField <String > = body._instructions ()
113+
98114 /* *
99115 * Returns the raw JSON value of [responseFormat].
100116 *
@@ -134,6 +150,9 @@ private constructor(
134150 @JsonProperty(" voice" )
135151 @ExcludeMissing
136152 private val voice: JsonField <Voice > = JsonMissing .of(),
153+ @JsonProperty(" instructions" )
154+ @ExcludeMissing
155+ private val instructions: JsonField <String > = JsonMissing .of(),
137156 @JsonProperty(" response_format" )
138157 @ExcludeMissing
139158 private val responseFormat: JsonField <ResponseFormat > = JsonMissing .of(),
@@ -153,8 +172,8 @@ private constructor(
153172 fun input (): String = input.getRequired(" input" )
154173
155174 /* *
156- * One of the available [TTS models](https://platform.openai.com/docs/models#tts): `tts-1`
157- * or `tts-1-hd`
175+ * One of the available [TTS models](https://platform.openai.com/docs/models#tts): `tts-1`,
176+ * `tts-1-hd` or `gpt-4o-mini-tts`.
158177 *
159178 * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is
160179 * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
@@ -172,6 +191,16 @@ private constructor(
172191 */
173192 fun voice (): Voice = voice.getRequired(" voice" )
174193
194+ /* *
195+ * Control the voice of your generated audio with additional instructions. Does not work
196+ * with `tts-1` or `tts-1-hd`.
197+ *
198+ * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
199+ * server responded with an unexpected value).
200+ */
201+ fun instructions (): Optional <String > =
202+ Optional .ofNullable(instructions.getNullable(" instructions" ))
203+
175204 /* *
176205 * The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and
177206 * `pcm`.
@@ -212,6 +241,16 @@ private constructor(
212241 */
213242 @JsonProperty(" voice" ) @ExcludeMissing fun _voice (): JsonField <Voice > = voice
214243
244+ /* *
245+ * Returns the raw JSON value of [instructions].
246+ *
247+ * Unlike [instructions], this method doesn't throw if the JSON field has an unexpected
248+ * type.
249+ */
250+ @JsonProperty(" instructions" )
251+ @ExcludeMissing
252+ fun _instructions (): JsonField <String > = instructions
253+
215254 /* *
216255 * Returns the raw JSON value of [responseFormat].
217256 *
@@ -243,6 +282,7 @@ private constructor(
243282 input()
244283 model()
245284 voice()
285+ instructions()
246286 responseFormat()
247287 speed()
248288 validated = true
@@ -271,6 +311,7 @@ private constructor(
271311 private var input: JsonField <String >? = null
272312 private var model: JsonField <SpeechModel >? = null
273313 private var voice: JsonField <Voice >? = null
314+ private var instructions: JsonField <String > = JsonMissing .of()
274315 private var responseFormat: JsonField <ResponseFormat > = JsonMissing .of()
275316 private var speed: JsonField <Double > = JsonMissing .of()
276317 private var additionalProperties: MutableMap <String , JsonValue > = mutableMapOf ()
@@ -280,6 +321,7 @@ private constructor(
280321 input = body.input
281322 model = body.model
282323 voice = body.voice
324+ instructions = body.instructions
283325 responseFormat = body.responseFormat
284326 speed = body.speed
285327 additionalProperties = body.additionalProperties.toMutableMap()
@@ -299,7 +341,7 @@ private constructor(
299341
300342 /* *
301343 * One of the available [TTS models](https://platform.openai.com/docs/models#tts):
302- * `tts-1` or `tts-1-hd`
344+ * `tts-1`, `tts-1-hd` or `gpt-4o-mini-tts`.
303345 */
304346 fun model (model : SpeechModel ) = model(JsonField .of(model))
305347
@@ -338,6 +380,23 @@ private constructor(
338380 */
339381 fun voice (voice : JsonField <Voice >) = apply { this .voice = voice }
340382
383+ /* *
384+ * Control the voice of your generated audio with additional instructions. Does not work
385+ * with `tts-1` or `tts-1-hd`.
386+ */
387+ fun instructions (instructions : String ) = instructions(JsonField .of(instructions))
388+
389+ /* *
390+ * Sets [Builder.instructions] to an arbitrary JSON value.
391+ *
392+ * You should usually call [Builder.instructions] with a well-typed [String] value
393+ * instead. This method is primarily for setting the field to an undocumented or not yet
394+ * supported value.
395+ */
396+ fun instructions (instructions : JsonField <String >) = apply {
397+ this .instructions = instructions
398+ }
399+
341400 /* *
342401 * The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`,
343402 * and `pcm`.
@@ -409,6 +468,7 @@ private constructor(
409468 checkRequired(" input" , input),
410469 checkRequired(" model" , model),
411470 checkRequired(" voice" , voice),
471+ instructions,
412472 responseFormat,
413473 speed,
414474 additionalProperties.toImmutable(),
@@ -420,17 +480,17 @@ private constructor(
420480 return true
421481 }
422482
423- return /* spotless:off */ other is Body && input == other.input && model == other.model && voice == other.voice && responseFormat == other.responseFormat && speed == other.speed && additionalProperties == other.additionalProperties /* spotless:on */
483+ return /* spotless:off */ other is Body && input == other.input && model == other.model && voice == other.voice && instructions == other.instructions && responseFormat == other.responseFormat && speed == other.speed && additionalProperties == other.additionalProperties /* spotless:on */
424484 }
425485
426486 /* spotless:off */
427- private val hashCode: Int by lazy { Objects .hash(input, model, voice, responseFormat, speed, additionalProperties) }
487+ private val hashCode: Int by lazy { Objects .hash(input, model, voice, instructions, responseFormat, speed, additionalProperties) }
428488 /* spotless:on */
429489
430490 override fun hashCode (): Int = hashCode
431491
432492 override fun toString () =
433- " Body{input=$input , model=$model , voice=$voice , responseFormat=$responseFormat , speed=$speed , additionalProperties=$additionalProperties }"
493+ " Body{input=$input , model=$model , voice=$voice , instructions= $instructions , responseFormat=$responseFormat , speed=$speed , additionalProperties=$additionalProperties }"
434494 }
435495
436496 fun toBuilder () = Builder ().from(this )
@@ -477,8 +537,8 @@ private constructor(
477537 fun input (input : JsonField <String >) = apply { body.input(input) }
478538
479539 /* *
480- * One of the available [TTS models](https://platform.openai.com/docs/models#tts): `tts-1`
481- * or `tts-1-hd`
540+ * One of the available [TTS models](https://platform.openai.com/docs/models#tts): `tts-1`,
541+ * `tts-1-hd` or `gpt-4o-mini-tts`.
482542 */
483543 fun model (model : SpeechModel ) = apply { body.model(model) }
484544
@@ -515,6 +575,23 @@ private constructor(
515575 */
516576 fun voice (voice : JsonField <Voice >) = apply { body.voice(voice) }
517577
578+ /* *
579+ * Control the voice of your generated audio with additional instructions. Does not work
580+ * with `tts-1` or `tts-1-hd`.
581+ */
582+ fun instructions (instructions : String ) = apply { body.instructions(instructions) }
583+
584+ /* *
585+ * Sets [Builder.instructions] to an arbitrary JSON value.
586+ *
587+ * You should usually call [Builder.instructions] with a well-typed [String] value instead.
588+ * This method is primarily for setting the field to an undocumented or not yet supported
589+ * value.
590+ */
591+ fun instructions (instructions : JsonField <String >) = apply {
592+ body.instructions(instructions)
593+ }
594+
518595 /* *
519596 * The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and
520597 * `pcm`.
0 commit comments