@@ -28,7 +28,7 @@ class Tool
28
28
private constructor (
29
29
private val fileSearch: FileSearchTool ? = null ,
30
30
private val function: FunctionTool ? = null ,
31
- private val computerPreview : ComputerTool ? = null ,
31
+ private val computerUsePreview : ComputerTool ? = null ,
32
32
private val webSearch: WebSearchTool ? = null ,
33
33
private val _json : JsonValue ? = null ,
34
34
) {
@@ -49,7 +49,7 @@ private constructor(
49
49
* A tool that controls a virtual computer. Learn more about the
50
50
* [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
51
51
*/
52
- fun computerPreview (): Optional <ComputerTool > = Optional .ofNullable(computerPreview )
52
+ fun computerUsePreview (): Optional <ComputerTool > = Optional .ofNullable(computerUsePreview )
53
53
54
54
/* *
55
55
* This tool searches the web for relevant results to use in a response. Learn more about the
@@ -61,7 +61,7 @@ private constructor(
61
61
62
62
fun isFunction (): Boolean = function != null
63
63
64
- fun isComputerPreview (): Boolean = computerPreview != null
64
+ fun isComputerUsePreview (): Boolean = computerUsePreview != null
65
65
66
66
fun isWebSearch (): Boolean = webSearch != null
67
67
@@ -81,7 +81,7 @@ private constructor(
81
81
* A tool that controls a virtual computer. Learn more about the
82
82
* [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
83
83
*/
84
- fun asComputerPreview (): ComputerTool = computerPreview .getOrThrow(" computerPreview " )
84
+ fun asComputerUsePreview (): ComputerTool = computerUsePreview .getOrThrow(" computerUsePreview " )
85
85
86
86
/* *
87
87
* This tool searches the web for relevant results to use in a response. Learn more about the
@@ -95,7 +95,7 @@ private constructor(
95
95
return when {
96
96
fileSearch != null -> visitor.visitFileSearch(fileSearch)
97
97
function != null -> visitor.visitFunction(function)
98
- computerPreview != null -> visitor.visitComputerPreview(computerPreview )
98
+ computerUsePreview != null -> visitor.visitComputerUsePreview(computerUsePreview )
99
99
webSearch != null -> visitor.visitWebSearch(webSearch)
100
100
else -> visitor.unknown(_json )
101
101
}
@@ -118,8 +118,8 @@ private constructor(
118
118
function.validate()
119
119
}
120
120
121
- override fun visitComputerPreview ( computerPreview : ComputerTool ) {
122
- computerPreview .validate()
121
+ override fun visitComputerUsePreview ( computerUsePreview : ComputerTool ) {
122
+ computerUsePreview .validate()
123
123
}
124
124
125
125
override fun visitWebSearch (webSearch : WebSearchTool ) {
@@ -135,16 +135,16 @@ private constructor(
135
135
return true
136
136
}
137
137
138
- return /* spotless:off */ other is Tool && fileSearch == other.fileSearch && function == other.function && computerPreview == other.computerPreview && webSearch == other.webSearch /* spotless:on */
138
+ return /* spotless:off */ other is Tool && fileSearch == other.fileSearch && function == other.function && computerUsePreview == other.computerUsePreview && webSearch == other.webSearch /* spotless:on */
139
139
}
140
140
141
- override fun hashCode (): Int = /* spotless:off */ Objects .hash(fileSearch, function, computerPreview , webSearch) /* spotless:on */
141
+ override fun hashCode (): Int = /* spotless:off */ Objects .hash(fileSearch, function, computerUsePreview , webSearch) /* spotless:on */
142
142
143
143
override fun toString (): String =
144
144
when {
145
145
fileSearch != null -> " Tool{fileSearch=$fileSearch }"
146
146
function != null -> " Tool{function=$function }"
147
- computerPreview != null -> " Tool{computerPreview= $computerPreview }"
147
+ computerUsePreview != null -> " Tool{computerUsePreview= $computerUsePreview }"
148
148
webSearch != null -> " Tool{webSearch=$webSearch }"
149
149
_json != null -> " Tool{_unknown=$_json }"
150
150
else -> throw IllegalStateException (" Invalid Tool" )
@@ -169,8 +169,8 @@ private constructor(
169
169
* [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
170
170
*/
171
171
@JvmStatic
172
- fun ofComputerPreview ( computerPreview : ComputerTool ) =
173
- Tool (computerPreview = computerPreview )
172
+ fun ofComputerUsePreview ( computerUsePreview : ComputerTool ) =
173
+ Tool (computerUsePreview = computerUsePreview )
174
174
175
175
/* *
176
176
* This tool searches the web for relevant results to use in a response. Learn more about
@@ -198,7 +198,7 @@ private constructor(
198
198
* A tool that controls a virtual computer. Learn more about the
199
199
* [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
200
200
*/
201
- fun visitComputerPreview ( computerPreview : ComputerTool ): T
201
+ fun visitComputerUsePreview ( computerUsePreview : ComputerTool ): T
202
202
203
203
/* *
204
204
* This tool searches the web for relevant results to use in a response. Learn more about
@@ -239,10 +239,10 @@ private constructor(
239
239
return Tool (function = it, _json = json)
240
240
}
241
241
}
242
- " computer-preview " -> {
242
+ " computer_use_preview " -> {
243
243
tryDeserialize(node, jacksonTypeRef<ComputerTool >()) { it.validate() }
244
244
?.let {
245
- return Tool (computerPreview = it, _json = json)
245
+ return Tool (computerUsePreview = it, _json = json)
246
246
}
247
247
}
248
248
}
@@ -266,7 +266,7 @@ private constructor(
266
266
when {
267
267
value.fileSearch != null -> generator.writeObject(value.fileSearch)
268
268
value.function != null -> generator.writeObject(value.function)
269
- value.computerPreview != null -> generator.writeObject(value.computerPreview )
269
+ value.computerUsePreview != null -> generator.writeObject(value.computerUsePreview )
270
270
value.webSearch != null -> generator.writeObject(value.webSearch)
271
271
value._json != null -> generator.writeObject(value._json )
272
272
else -> throw IllegalStateException (" Invalid Tool" )
0 commit comments