@@ -28,7 +28,7 @@ class Tool
2828private constructor (
2929 private val fileSearch: FileSearchTool ? = null ,
3030 private val function: FunctionTool ? = null ,
31- private val computerPreview : ComputerTool ? = null ,
31+ private val computerUsePreview : ComputerTool ? = null ,
3232 private val webSearch: WebSearchTool ? = null ,
3333 private val _json : JsonValue ? = null ,
3434) {
@@ -49,7 +49,7 @@ private constructor(
4949 * A tool that controls a virtual computer. Learn more about the
5050 * [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
5151 */
52- fun computerPreview (): Optional <ComputerTool > = Optional .ofNullable(computerPreview )
52+ fun computerUsePreview (): Optional <ComputerTool > = Optional .ofNullable(computerUsePreview )
5353
5454 /* *
5555 * This tool searches the web for relevant results to use in a response. Learn more about the
@@ -61,7 +61,7 @@ private constructor(
6161
6262 fun isFunction (): Boolean = function != null
6363
64- fun isComputerPreview (): Boolean = computerPreview != null
64+ fun isComputerUsePreview (): Boolean = computerUsePreview != null
6565
6666 fun isWebSearch (): Boolean = webSearch != null
6767
@@ -81,7 +81,7 @@ private constructor(
8181 * A tool that controls a virtual computer. Learn more about the
8282 * [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
8383 */
84- fun asComputerPreview (): ComputerTool = computerPreview .getOrThrow(" computerPreview " )
84+ fun asComputerUsePreview (): ComputerTool = computerUsePreview .getOrThrow(" computerUsePreview " )
8585
8686 /* *
8787 * This tool searches the web for relevant results to use in a response. Learn more about the
@@ -95,7 +95,7 @@ private constructor(
9595 return when {
9696 fileSearch != null -> visitor.visitFileSearch(fileSearch)
9797 function != null -> visitor.visitFunction(function)
98- computerPreview != null -> visitor.visitComputerPreview(computerPreview )
98+ computerUsePreview != null -> visitor.visitComputerUsePreview(computerUsePreview )
9999 webSearch != null -> visitor.visitWebSearch(webSearch)
100100 else -> visitor.unknown(_json )
101101 }
@@ -118,8 +118,8 @@ private constructor(
118118 function.validate()
119119 }
120120
121- override fun visitComputerPreview ( computerPreview : ComputerTool ) {
122- computerPreview .validate()
121+ override fun visitComputerUsePreview ( computerUsePreview : ComputerTool ) {
122+ computerUsePreview .validate()
123123 }
124124
125125 override fun visitWebSearch (webSearch : WebSearchTool ) {
@@ -135,16 +135,16 @@ private constructor(
135135 return true
136136 }
137137
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 */
139139 }
140140
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 */
142142
143143 override fun toString (): String =
144144 when {
145145 fileSearch != null -> " Tool{fileSearch=$fileSearch }"
146146 function != null -> " Tool{function=$function }"
147- computerPreview != null -> " Tool{computerPreview= $computerPreview }"
147+ computerUsePreview != null -> " Tool{computerUsePreview= $computerUsePreview }"
148148 webSearch != null -> " Tool{webSearch=$webSearch }"
149149 _json != null -> " Tool{_unknown=$_json }"
150150 else -> throw IllegalStateException (" Invalid Tool" )
@@ -169,8 +169,8 @@ private constructor(
169169 * [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
170170 */
171171 @JvmStatic
172- fun ofComputerPreview ( computerPreview : ComputerTool ) =
173- Tool (computerPreview = computerPreview )
172+ fun ofComputerUsePreview ( computerUsePreview : ComputerTool ) =
173+ Tool (computerUsePreview = computerUsePreview )
174174
175175 /* *
176176 * This tool searches the web for relevant results to use in a response. Learn more about
@@ -198,7 +198,7 @@ private constructor(
198198 * A tool that controls a virtual computer. Learn more about the
199199 * [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
200200 */
201- fun visitComputerPreview ( computerPreview : ComputerTool ): T
201+ fun visitComputerUsePreview ( computerUsePreview : ComputerTool ): T
202202
203203 /* *
204204 * This tool searches the web for relevant results to use in a response. Learn more about
@@ -239,10 +239,10 @@ private constructor(
239239 return Tool (function = it, _json = json)
240240 }
241241 }
242- " computer-preview " -> {
242+ " computer_use_preview " -> {
243243 tryDeserialize(node, jacksonTypeRef<ComputerTool >()) { it.validate() }
244244 ?.let {
245- return Tool (computerPreview = it, _json = json)
245+ return Tool (computerUsePreview = it, _json = json)
246246 }
247247 }
248248 }
@@ -266,7 +266,7 @@ private constructor(
266266 when {
267267 value.fileSearch != null -> generator.writeObject(value.fileSearch)
268268 value.function != null -> generator.writeObject(value.function)
269- value.computerPreview != null -> generator.writeObject(value.computerPreview )
269+ value.computerUsePreview != null -> generator.writeObject(value.computerUsePreview )
270270 value.webSearch != null -> generator.writeObject(value.webSearch)
271271 value._json != null -> generator.writeObject(value._json )
272272 else -> throw IllegalStateException (" Invalid Tool" )
0 commit comments