@@ -954,8 +954,9 @@ private constructor(
954954 fun addTool (codeInterpreter : CodeInterpreterTool ) =
955955 addTool(Tool .ofCodeInterpreter(codeInterpreter))
956956
957- /* * Alias for calling [addTool] with `Tool.ofObject()`. */
958- fun addToolObject () = addTool(Tool .ofObject())
957+ /* * Alias for calling [addTool] with `Tool.ofAssistantToolsFileSearchTypeOnly()`. */
958+ fun addToolAssistantToolsFileSearchTypeOnly () =
959+ addTool(Tool .ofAssistantToolsFileSearchTypeOnly())
959960
960961 fun additionalProperties (additionalProperties : Map <String , JsonValue >) = apply {
961962 this .additionalProperties.clear()
@@ -1025,30 +1026,36 @@ private constructor(
10251026 class Tool
10261027 private constructor (
10271028 private val codeInterpreter: CodeInterpreterTool ? = null ,
1028- private val object_ : JsonValue ? = null ,
1029+ private val assistantToolsFileSearchTypeOnly : JsonValue ? = null ,
10291030 private val _json : JsonValue ? = null ,
10301031 ) {
10311032
10321033 fun codeInterpreter (): Optional <CodeInterpreterTool > =
10331034 Optional .ofNullable(codeInterpreter)
10341035
1035- fun object_ (): Optional <JsonValue > = Optional .ofNullable(object_)
1036+ fun assistantToolsFileSearchTypeOnly (): Optional <JsonValue > =
1037+ Optional .ofNullable(assistantToolsFileSearchTypeOnly)
10361038
10371039 fun isCodeInterpreter (): Boolean = codeInterpreter != null
10381040
1039- fun isObject (): Boolean = object_ != null
1041+ fun isAssistantToolsFileSearchTypeOnly (): Boolean =
1042+ assistantToolsFileSearchTypeOnly != null
10401043
10411044 fun asCodeInterpreter (): CodeInterpreterTool =
10421045 codeInterpreter.getOrThrow(" codeInterpreter" )
10431046
1044- fun asObject (): JsonValue = object_.getOrThrow(" object_" )
1047+ fun asAssistantToolsFileSearchTypeOnly (): JsonValue =
1048+ assistantToolsFileSearchTypeOnly.getOrThrow(" assistantToolsFileSearchTypeOnly" )
10451049
10461050 fun _json (): Optional <JsonValue > = Optional .ofNullable(_json )
10471051
10481052 fun <T > accept (visitor : Visitor <T >): T =
10491053 when {
10501054 codeInterpreter != null -> visitor.visitCodeInterpreter(codeInterpreter)
1051- object_ != null -> visitor.visitObject(object_)
1055+ assistantToolsFileSearchTypeOnly != null ->
1056+ visitor.visitAssistantToolsFileSearchTypeOnly(
1057+ assistantToolsFileSearchTypeOnly
1058+ )
10521059 else -> visitor.unknown(_json )
10531060 }
10541061
@@ -1065,11 +1072,13 @@ private constructor(
10651072 codeInterpreter.validate()
10661073 }
10671074
1068- override fun visitObject (object_ : JsonValue ) {
1069- object_.let {
1075+ override fun visitAssistantToolsFileSearchTypeOnly (
1076+ assistantToolsFileSearchTypeOnly : JsonValue
1077+ ) {
1078+ assistantToolsFileSearchTypeOnly.let {
10701079 if (it != JsonValue .from(mapOf (" type" to " file_search" ))) {
10711080 throw OpenAIInvalidDataException (
1072- " 'object_ ' is invalid, received $it "
1081+ " 'assistantToolsFileSearchTypeOnly ' is invalid, received $it "
10731082 )
10741083 }
10751084 }
@@ -1100,8 +1109,10 @@ private constructor(
11001109 override fun visitCodeInterpreter (codeInterpreter : CodeInterpreterTool ) =
11011110 codeInterpreter.validity()
11021111
1103- override fun visitObject (object_ : JsonValue ) =
1104- object_.let {
1112+ override fun visitAssistantToolsFileSearchTypeOnly (
1113+ assistantToolsFileSearchTypeOnly : JsonValue
1114+ ) =
1115+ assistantToolsFileSearchTypeOnly.let {
11051116 if (it == JsonValue .from(mapOf (" type" to " file_search" ))) 1 else 0
11061117 }
11071118
@@ -1114,15 +1125,16 @@ private constructor(
11141125 return true
11151126 }
11161127
1117- return /* spotless:off */ other is Tool && codeInterpreter == other.codeInterpreter && object_ == other.object_ /* spotless:on */
1128+ return /* spotless:off */ other is Tool && codeInterpreter == other.codeInterpreter && assistantToolsFileSearchTypeOnly == other.assistantToolsFileSearchTypeOnly /* spotless:on */
11181129 }
11191130
1120- override fun hashCode (): Int = /* spotless:off */ Objects .hash(codeInterpreter, object_ ) /* spotless:on */
1131+ override fun hashCode (): Int = /* spotless:off */ Objects .hash(codeInterpreter, assistantToolsFileSearchTypeOnly ) /* spotless:on */
11211132
11221133 override fun toString (): String =
11231134 when {
11241135 codeInterpreter != null -> " Tool{codeInterpreter=$codeInterpreter }"
1125- object_ != null -> " Tool{object_=$object_ }"
1136+ assistantToolsFileSearchTypeOnly != null ->
1137+ " Tool{assistantToolsFileSearchTypeOnly=$assistantToolsFileSearchTypeOnly }"
11261138 _json != null -> " Tool{_unknown=$_json }"
11271139 else -> throw IllegalStateException (" Invalid Tool" )
11281140 }
@@ -1134,7 +1146,11 @@ private constructor(
11341146 Tool (codeInterpreter = codeInterpreter)
11351147
11361148 @JvmStatic
1137- fun ofObject () = Tool (object_ = JsonValue .from(mapOf (" type" to " file_search" )))
1149+ fun ofAssistantToolsFileSearchTypeOnly () =
1150+ Tool (
1151+ assistantToolsFileSearchTypeOnly =
1152+ JsonValue .from(mapOf (" type" to " file_search" ))
1153+ )
11381154 }
11391155
11401156 /* *
@@ -1144,7 +1160,9 @@ private constructor(
11441160
11451161 fun visitCodeInterpreter (codeInterpreter : CodeInterpreterTool ): T
11461162
1147- fun visitObject (object_ : JsonValue ): T
1163+ fun visitAssistantToolsFileSearchTypeOnly (
1164+ assistantToolsFileSearchTypeOnly : JsonValue
1165+ ): T
11481166
11491167 /* *
11501168 * Maps an unknown variant of [Tool] to a value of type [T].
@@ -1169,7 +1187,9 @@ private constructor(
11691187 val bestMatches =
11701188 sequenceOf(
11711189 tryDeserialize(node, jacksonTypeRef<JsonValue >())
1172- ?.let { Tool (object_ = it, _json = json) }
1190+ ?.let {
1191+ Tool (assistantToolsFileSearchTypeOnly = it, _json = json)
1192+ }
11731193 ?.takeIf { it.isValid() },
11741194 tryDeserialize(node, jacksonTypeRef<CodeInterpreterTool >())?.let {
11751195 Tool (codeInterpreter = it, _json = json)
@@ -1201,7 +1221,8 @@ private constructor(
12011221 when {
12021222 value.codeInterpreter != null ->
12031223 generator.writeObject(value.codeInterpreter)
1204- value.object_ != null -> generator.writeObject(value.object_)
1224+ value.assistantToolsFileSearchTypeOnly != null ->
1225+ generator.writeObject(value.assistantToolsFileSearchTypeOnly)
12051226 value._json != null -> generator.writeObject(value._json )
12061227 else -> throw IllegalStateException (" Invalid Tool" )
12071228 }
0 commit comments