Skip to content

Commit fa3cb6f

Browse files
apcha-oaistainless-app[bot]
authored andcommitted
fix(api): update structured response tool overloads
1 parent cb3f506 commit fa3cb6f

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ class StructuredResponseCreateParams<T : Any>(
473473
}
474474

475475
/** @see ResponseCreateParams.Builder.addTool */
476-
fun addTool(computer: ComputerUseTool) = apply { paramsBuilder.addTool(computer) }
476+
fun addTool(computer: ComputerTool) = apply { paramsBuilder.addTool(computer) }
477477

478478
/** @see ResponseCreateParams.Builder.addTool */
479479
fun addTool(webSearch: WebSearchTool) = apply { paramsBuilder.addTool(webSearch) }
@@ -487,7 +487,7 @@ class StructuredResponseCreateParams<T : Any>(
487487
fun addTool(applyPatch: ApplyPatchTool) = apply { paramsBuilder.addTool(applyPatch) }
488488

489489
/** @see ResponseCreateParams.Builder.addTool */
490-
fun addTool(computerUsePreview: ComputerTool) = apply {
490+
fun addTool(computerUsePreview: ComputerUsePreviewTool) = apply {
491491
paramsBuilder.addTool(computerUsePreview)
492492
}
493493

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ internal class StructuredResponseCreateParamsTest {
9393
WebSearchPreviewTool.builder()
9494
.type(WebSearchPreviewTool.Type.WEB_SEARCH_PREVIEW)
9595
.build()
96-
private val COMPUTER_USE_TOOL = ComputerUseTool.builder().build()
97-
private val COMPUTER_TOOL =
98-
ComputerTool.builder()
96+
private val COMPUTER_TOOL = ComputerTool.builder().build()
97+
private val COMPUTER_USE_PREVIEW_TOOL =
98+
ComputerUsePreviewTool.builder()
9999
.displayWidth(LONG)
100100
.displayHeight(LONG)
101-
.environment(ComputerTool.Environment.LINUX)
101+
.environment(ComputerUsePreviewTool.Environment.LINUX)
102102
.build()
103103
private val TOOL = Tool.ofFunction(FUNCTION_TOOL)
104104
private val MCP_TOOL = Tool.Mcp.builder().serverLabel(STRING).serverUrl(STRING).build()
@@ -223,11 +223,11 @@ internal class StructuredResponseCreateParamsTest {
223223
DelegationWriteTestCase("addTool", CLASS, VALIDATION),
224224
DelegationWriteTestCase("addTool", FILE_SEARCH_TOOL),
225225
DelegationWriteTestCase("addFileSearchTool", LIST),
226-
DelegationWriteTestCase("addTool", COMPUTER_USE_TOOL),
226+
DelegationWriteTestCase("addTool", COMPUTER_TOOL),
227227
DelegationWriteTestCase("addTool", WEB_SEARCH_TOOL),
228228
DelegationWriteTestCase("addTool", WEB_SEARCH_PREVIEW_TOOL),
229229
DelegationWriteTestCase("addTool", APPLY_PATCH_TOOL),
230-
DelegationWriteTestCase("addTool", COMPUTER_TOOL),
230+
DelegationWriteTestCase("addTool", COMPUTER_USE_PREVIEW_TOOL),
231231
DelegationWriteTestCase("addTool", MCP_TOOL),
232232
DelegationWriteTestCase("addMcpTool", STRING),
233233
DelegationWriteTestCase("addTool", CODE_INTERPRETER_TOOL),

0 commit comments

Comments
 (0)