Skip to content

Commit 630fecf

Browse files
feat(api): remove InputAudio from ResponseInputContent
Removes the type `InputAudio` from `ResponseInputContent`. This parameter was non-functional and has now been removed. Please note that this is not a feature removal; it was never supported by the Responses API. While this is technically a backward-incompatible change due to the type removal, it reflects the intended behavior and has no functional impact.
1 parent 3e970ec commit 630fecf

File tree

9 files changed

+29
-206
lines changed

9 files changed

+29
-206
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: 135
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-a3c45d9bd3bb25bf4eaa49b7fb473a00038293dec659ffaa44f624ded884abf4.yml
3-
openapi_spec_hash: 9c20aaf786a0700dabd13d9865481c9e
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-f68f718cd45ac3f9336603601bccc38a718af44d0b26601031de3d0a71b7ce2f.yml
3+
openapi_spec_hash: 1560717860bba4105936647dde8f618d
44
config_hash: 50ee3382a63c021a9f821a935950e926

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ import java.util.Objects
1818
import java.util.Optional
1919
import kotlin.jvm.optionals.getOrNull
2020

21+
/**
22+
* A custom tool that processes input using a specified format. Learn more about
23+
* [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)
24+
*/
2125
class CustomTool
2226
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
2327
private constructor(

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

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ private constructor(
3535
private val inputText: ResponseInputText? = null,
3636
private val inputImage: ResponseInputImage? = null,
3737
private val inputFile: ResponseInputFile? = null,
38-
private val inputAudio: ResponseInputAudio? = null,
3938
private val outputText: ResponseOutputText? = null,
4039
private val outputRefusal: ResponseOutputRefusal? = null,
4140
private val reasoningText: ReasoningTextContent? = null,
@@ -54,9 +53,6 @@ private constructor(
5453
/** A file input to the model. */
5554
fun inputFile(): Optional<ResponseInputFile> = Optional.ofNullable(inputFile)
5655

57-
/** An audio input to the model. */
58-
fun inputAudio(): Optional<ResponseInputAudio> = Optional.ofNullable(inputAudio)
59-
6056
/** A text output from the model. */
6157
fun outputText(): Optional<ResponseOutputText> = Optional.ofNullable(outputText)
6258

@@ -72,8 +68,6 @@ private constructor(
7268

7369
fun isInputFile(): Boolean = inputFile != null
7470

75-
fun isInputAudio(): Boolean = inputAudio != null
76-
7771
fun isOutputText(): Boolean = outputText != null
7872

7973
fun isOutputRefusal(): Boolean = outputRefusal != null
@@ -92,9 +86,6 @@ private constructor(
9286
/** A file input to the model. */
9387
fun asInputFile(): ResponseInputFile = inputFile.getOrThrow("inputFile")
9488

95-
/** An audio input to the model. */
96-
fun asInputAudio(): ResponseInputAudio = inputAudio.getOrThrow("inputAudio")
97-
9889
/** A text output from the model. */
9990
fun asOutputText(): ResponseOutputText = outputText.getOrThrow("outputText")
10091

@@ -111,7 +102,6 @@ private constructor(
111102
inputText != null -> visitor.visitInputText(inputText)
112103
inputImage != null -> visitor.visitInputImage(inputImage)
113104
inputFile != null -> visitor.visitInputFile(inputFile)
114-
inputAudio != null -> visitor.visitInputAudio(inputAudio)
115105
outputText != null -> visitor.visitOutputText(outputText)
116106
outputRefusal != null -> visitor.visitOutputRefusal(outputRefusal)
117107
reasoningText != null -> visitor.visitReasoningText(reasoningText)
@@ -139,10 +129,6 @@ private constructor(
139129
inputFile.validate()
140130
}
141131

142-
override fun visitInputAudio(inputAudio: ResponseInputAudio) {
143-
inputAudio.validate()
144-
}
145-
146132
override fun visitOutputText(outputText: ResponseOutputText) {
147133
outputText.validate()
148134
}
@@ -182,8 +168,6 @@ private constructor(
182168

183169
override fun visitInputFile(inputFile: ResponseInputFile) = inputFile.validity()
184170

185-
override fun visitInputAudio(inputAudio: ResponseInputAudio) = inputAudio.validity()
186-
187171
override fun visitOutputText(outputText: ResponseOutputText) = outputText.validity()
188172

189173
override fun visitOutputRefusal(outputRefusal: ResponseOutputRefusal) =
@@ -205,29 +189,19 @@ private constructor(
205189
inputText == other.inputText &&
206190
inputImage == other.inputImage &&
207191
inputFile == other.inputFile &&
208-
inputAudio == other.inputAudio &&
209192
outputText == other.outputText &&
210193
outputRefusal == other.outputRefusal &&
211194
reasoningText == other.reasoningText
212195
}
213196

214197
override fun hashCode(): Int =
215-
Objects.hash(
216-
inputText,
217-
inputImage,
218-
inputFile,
219-
inputAudio,
220-
outputText,
221-
outputRefusal,
222-
reasoningText,
223-
)
198+
Objects.hash(inputText, inputImage, inputFile, outputText, outputRefusal, reasoningText)
224199

225200
override fun toString(): String =
226201
when {
227202
inputText != null -> "ResponseContent{inputText=$inputText}"
228203
inputImage != null -> "ResponseContent{inputImage=$inputImage}"
229204
inputFile != null -> "ResponseContent{inputFile=$inputFile}"
230-
inputAudio != null -> "ResponseContent{inputAudio=$inputAudio}"
231205
outputText != null -> "ResponseContent{outputText=$outputText}"
232206
outputRefusal != null -> "ResponseContent{outputRefusal=$outputRefusal}"
233207
reasoningText != null -> "ResponseContent{reasoningText=$reasoningText}"
@@ -252,10 +226,6 @@ private constructor(
252226
@JvmStatic
253227
fun ofInputFile(inputFile: ResponseInputFile) = ResponseContent(inputFile = inputFile)
254228

255-
/** An audio input to the model. */
256-
@JvmStatic
257-
fun ofInputAudio(inputAudio: ResponseInputAudio) = ResponseContent(inputAudio = inputAudio)
258-
259229
/** A text output from the model. */
260230
@JvmStatic
261231
fun ofOutputText(outputText: ResponseOutputText) = ResponseContent(outputText = outputText)
@@ -289,9 +259,6 @@ private constructor(
289259
/** A file input to the model. */
290260
fun visitInputFile(inputFile: ResponseInputFile): T
291261

292-
/** An audio input to the model. */
293-
fun visitInputAudio(inputAudio: ResponseInputAudio): T
294-
295262
/** A text output from the model. */
296263
fun visitOutputText(outputText: ResponseOutputText): T
297264

@@ -332,9 +299,6 @@ private constructor(
332299
tryDeserialize(node, jacksonTypeRef<ResponseInputFile>())?.let {
333300
ResponseContent(inputFile = it, _json = json)
334301
},
335-
tryDeserialize(node, jacksonTypeRef<ResponseInputAudio>())?.let {
336-
ResponseContent(inputAudio = it, _json = json)
337-
},
338302
tryDeserialize(node, jacksonTypeRef<ResponseOutputText>())?.let {
339303
ResponseContent(outputText = it, _json = json)
340304
},
@@ -371,7 +335,6 @@ private constructor(
371335
value.inputText != null -> generator.writeObject(value.inputText)
372336
value.inputImage != null -> generator.writeObject(value.inputImage)
373337
value.inputFile != null -> generator.writeObject(value.inputFile)
374-
value.inputAudio != null -> generator.writeObject(value.inputAudio)
375338
value.outputText != null -> generator.writeObject(value.outputText)
376339
value.outputRefusal != null -> generator.writeObject(value.outputRefusal)
377340
value.reasoningText != null -> generator.writeObject(value.reasoningText)

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

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ private constructor(
2626
private val inputText: ResponseInputText? = null,
2727
private val inputImage: ResponseInputImage? = null,
2828
private val inputFile: ResponseInputFile? = null,
29-
private val inputAudio: ResponseInputAudio? = null,
3029
private val _json: JsonValue? = null,
3130
) {
3231

@@ -42,17 +41,12 @@ private constructor(
4241
/** A file input to the model. */
4342
fun inputFile(): Optional<ResponseInputFile> = Optional.ofNullable(inputFile)
4443

45-
/** An audio input to the model. */
46-
fun inputAudio(): Optional<ResponseInputAudio> = Optional.ofNullable(inputAudio)
47-
4844
fun isInputText(): Boolean = inputText != null
4945

5046
fun isInputImage(): Boolean = inputImage != null
5147

5248
fun isInputFile(): Boolean = inputFile != null
5349

54-
fun isInputAudio(): Boolean = inputAudio != null
55-
5650
/** A text input to the model. */
5751
fun asInputText(): ResponseInputText = inputText.getOrThrow("inputText")
5852

@@ -65,17 +59,13 @@ private constructor(
6559
/** A file input to the model. */
6660
fun asInputFile(): ResponseInputFile = inputFile.getOrThrow("inputFile")
6761

68-
/** An audio input to the model. */
69-
fun asInputAudio(): ResponseInputAudio = inputAudio.getOrThrow("inputAudio")
70-
7162
fun _json(): Optional<JsonValue> = Optional.ofNullable(_json)
7263

7364
fun <T> accept(visitor: Visitor<T>): T =
7465
when {
7566
inputText != null -> visitor.visitInputText(inputText)
7667
inputImage != null -> visitor.visitInputImage(inputImage)
7768
inputFile != null -> visitor.visitInputFile(inputFile)
78-
inputAudio != null -> visitor.visitInputAudio(inputAudio)
7969
else -> visitor.unknown(_json)
8070
}
8171

@@ -99,10 +89,6 @@ private constructor(
9989
override fun visitInputFile(inputFile: ResponseInputFile) {
10090
inputFile.validate()
10191
}
102-
103-
override fun visitInputAudio(inputAudio: ResponseInputAudio) {
104-
inputAudio.validate()
105-
}
10692
}
10793
)
10894
validated = true
@@ -131,8 +117,6 @@ private constructor(
131117

132118
override fun visitInputFile(inputFile: ResponseInputFile) = inputFile.validity()
133119

134-
override fun visitInputAudio(inputAudio: ResponseInputAudio) = inputAudio.validity()
135-
136120
override fun unknown(json: JsonValue?) = 0
137121
}
138122
)
@@ -145,18 +129,16 @@ private constructor(
145129
return other is ResponseInputContent &&
146130
inputText == other.inputText &&
147131
inputImage == other.inputImage &&
148-
inputFile == other.inputFile &&
149-
inputAudio == other.inputAudio
132+
inputFile == other.inputFile
150133
}
151134

152-
override fun hashCode(): Int = Objects.hash(inputText, inputImage, inputFile, inputAudio)
135+
override fun hashCode(): Int = Objects.hash(inputText, inputImage, inputFile)
153136

154137
override fun toString(): String =
155138
when {
156139
inputText != null -> "ResponseInputContent{inputText=$inputText}"
157140
inputImage != null -> "ResponseInputContent{inputImage=$inputImage}"
158141
inputFile != null -> "ResponseInputContent{inputFile=$inputFile}"
159-
inputAudio != null -> "ResponseInputContent{inputAudio=$inputAudio}"
160142
_json != null -> "ResponseInputContent{_unknown=$_json}"
161143
else -> throw IllegalStateException("Invalid ResponseInputContent")
162144
}
@@ -178,11 +160,6 @@ private constructor(
178160
/** A file input to the model. */
179161
@JvmStatic
180162
fun ofInputFile(inputFile: ResponseInputFile) = ResponseInputContent(inputFile = inputFile)
181-
182-
/** An audio input to the model. */
183-
@JvmStatic
184-
fun ofInputAudio(inputAudio: ResponseInputAudio) =
185-
ResponseInputContent(inputAudio = inputAudio)
186163
}
187164

188165
/**
@@ -203,9 +180,6 @@ private constructor(
203180
/** A file input to the model. */
204181
fun visitInputFile(inputFile: ResponseInputFile): T
205182

206-
/** An audio input to the model. */
207-
fun visitInputAudio(inputAudio: ResponseInputAudio): T
208-
209183
/**
210184
* Maps an unknown variant of [ResponseInputContent] to a value of type [T].
211185
*
@@ -244,11 +218,6 @@ private constructor(
244218
ResponseInputContent(inputFile = it, _json = json)
245219
} ?: ResponseInputContent(_json = json)
246220
}
247-
"input_audio" -> {
248-
return tryDeserialize(node, jacksonTypeRef<ResponseInputAudio>())?.let {
249-
ResponseInputContent(inputAudio = it, _json = json)
250-
} ?: ResponseInputContent(_json = json)
251-
}
252221
}
253222

254223
return ResponseInputContent(_json = json)
@@ -266,7 +235,6 @@ private constructor(
266235
value.inputText != null -> generator.writeObject(value.inputText)
267236
value.inputImage != null -> generator.writeObject(value.inputImage)
268237
value.inputFile != null -> generator.writeObject(value.inputFile)
269-
value.inputAudio != null -> generator.writeObject(value.inputAudio)
270238
value._json != null -> generator.writeObject(value._json)
271239
else -> throw IllegalStateException("Invalid ResponseInputContent")
272240
}

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

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,23 +1232,6 @@ private constructor(
12321232
fun addContent(inputFile: ResponseInputFile) =
12331233
addContent(ResponseInputContent.ofInputFile(inputFile))
12341234

1235-
/**
1236-
* Alias for calling [addContent] with `ResponseInputContent.ofInputAudio(inputAudio)`.
1237-
*/
1238-
fun addContent(inputAudio: ResponseInputAudio) =
1239-
addContent(ResponseInputContent.ofInputAudio(inputAudio))
1240-
1241-
/**
1242-
* Alias for calling [addContent] with the following:
1243-
* ```java
1244-
* ResponseInputAudio.builder()
1245-
* .inputAudio(inputAudio)
1246-
* .build()
1247-
* ```
1248-
*/
1249-
fun addInputAudioContent(inputAudio: ResponseInputAudio.InputAudio) =
1250-
addContent(ResponseInputAudio.builder().inputAudio(inputAudio).build())
1251-
12521235
/** The role of the message input. One of `user`, `system`, or `developer`. */
12531236
fun role(role: Role) = role(JsonField.of(role))
12541237

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

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -238,21 +238,6 @@ private constructor(
238238
fun addContent(inputFile: ResponseInputFile) =
239239
addContent(ResponseInputContent.ofInputFile(inputFile))
240240

241-
/** Alias for calling [addContent] with `ResponseInputContent.ofInputAudio(inputAudio)`. */
242-
fun addContent(inputAudio: ResponseInputAudio) =
243-
addContent(ResponseInputContent.ofInputAudio(inputAudio))
244-
245-
/**
246-
* Alias for calling [addContent] with the following:
247-
* ```java
248-
* ResponseInputAudio.builder()
249-
* .inputAudio(inputAudio)
250-
* .build()
251-
* ```
252-
*/
253-
fun addInputAudioContent(inputAudio: ResponseInputAudio.InputAudio) =
254-
addContent(ResponseInputAudio.builder().inputAudio(inputAudio).build())
255-
256241
/** The role of the message input. One of `user`, `system`, or `developer`. */
257242
fun role(role: Role) = role(JsonField.of(role))
258243

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,13 @@ private constructor(
8585
/** A tool that generates images using a model like `gpt-image-1`. */
8686
fun imageGeneration(): Optional<ImageGeneration> = Optional.ofNullable(imageGeneration)
8787

88+
/** A tool that allows the model to execute shell commands in a local environment. */
8889
fun localShell(): Optional<JsonValue> = Optional.ofNullable(localShell)
8990

91+
/**
92+
* A custom tool that processes input using a specified format. Learn more about
93+
* [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)
94+
*/
9095
fun custom(): Optional<CustomTool> = Optional.ofNullable(custom)
9196

9297
/**
@@ -151,8 +156,13 @@ private constructor(
151156
/** A tool that generates images using a model like `gpt-image-1`. */
152157
fun asImageGeneration(): ImageGeneration = imageGeneration.getOrThrow("imageGeneration")
153158

159+
/** A tool that allows the model to execute shell commands in a local environment. */
154160
fun asLocalShell(): JsonValue = localShell.getOrThrow("localShell")
155161

162+
/**
163+
* A custom tool that processes input using a specified format. Learn more about
164+
* [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)
165+
*/
156166
fun asCustom(): CustomTool = custom.getOrThrow("custom")
157167

158168
/**
@@ -378,9 +388,14 @@ private constructor(
378388
fun ofImageGeneration(imageGeneration: ImageGeneration) =
379389
Tool(imageGeneration = imageGeneration)
380390

391+
/** A tool that allows the model to execute shell commands in a local environment. */
381392
@JvmStatic
382393
fun ofLocalShell() = Tool(localShell = JsonValue.from(mapOf("type" to "local_shell")))
383394

395+
/**
396+
* A custom tool that processes input using a specified format. Learn more about
397+
* [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)
398+
*/
384399
@JvmStatic fun ofCustom(custom: CustomTool) = Tool(custom = custom)
385400

386401
/**
@@ -432,8 +447,13 @@ private constructor(
432447
/** A tool that generates images using a model like `gpt-image-1`. */
433448
fun visitImageGeneration(imageGeneration: ImageGeneration): T
434449

450+
/** A tool that allows the model to execute shell commands in a local environment. */
435451
fun visitLocalShell(localShell: JsonValue): T
436452

453+
/**
454+
* A custom tool that processes input using a specified format. Learn more about
455+
* [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)
456+
*/
437457
fun visitCustom(custom: CustomTool): T
438458

439459
/**

0 commit comments

Comments
 (0)