@@ -6,7 +6,6 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter
66import com.fasterxml.jackson.annotation.JsonAnySetter
77import com.fasterxml.jackson.annotation.JsonCreator
88import com.fasterxml.jackson.annotation.JsonProperty
9- import com.openai.core.Enum
109import com.openai.core.ExcludeMissing
1110import com.openai.core.JsonField
1211import com.openai.core.JsonMissing
@@ -37,9 +36,7 @@ private constructor(
3736 @JsonProperty(" metadata" ) @ExcludeMissing private val metadata: JsonValue = JsonMissing .of(),
3837 @JsonProperty(" model" ) @ExcludeMissing private val model: JsonField <String > = JsonMissing .of(),
3938 @JsonProperty(" name" ) @ExcludeMissing private val name: JsonField <String > = JsonMissing .of(),
40- @JsonProperty(" object" )
41- @ExcludeMissing
42- private val object_: JsonField <Object > = JsonMissing .of(),
39+ @JsonProperty(" object" ) @ExcludeMissing private val object_: JsonValue = JsonMissing .of(),
4340 @JsonProperty(" tools" )
4441 @ExcludeMissing
4542 private val tools: JsonField <List <AssistantTool >> = JsonMissing .of(),
@@ -91,7 +88,7 @@ private constructor(
9188 fun name (): Optional <String > = Optional .ofNullable(name.getNullable(" name" ))
9289
9390 /* * The object type, which is always `assistant`. */
94- fun object_ (): Object = object_.getRequired( " object " )
91+ @JsonProperty( " object " ) @ExcludeMissing fun _object_ (): JsonValue = object_
9592
9693 /* *
9794 * A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant.
@@ -173,9 +170,6 @@ private constructor(
173170 /* * The name of the assistant. The maximum length is 256 characters. */
174171 @JsonProperty(" name" ) @ExcludeMissing fun _name (): JsonField <String > = name
175172
176- /* * The object type, which is always `assistant`. */
177- @JsonProperty(" object" ) @ExcludeMissing fun _object_ (): JsonField <Object > = object_
178-
179173 /* *
180174 * A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant.
181175 * Tools can be of types `code_interpreter`, `file_search`, or `function`.
@@ -247,7 +241,11 @@ private constructor(
247241 instructions()
248242 model()
249243 name()
250- object_()
244+ _object_ ().let {
245+ if (it != JsonValue .from(" assistant" )) {
246+ throw OpenAIInvalidDataException (" 'object_' is invalid, received $it " )
247+ }
248+ }
251249 tools().forEach { it.validate() }
252250 responseFormat().ifPresent { it.validate() }
253251 temperature()
@@ -272,7 +270,7 @@ private constructor(
272270 private var metadata: JsonValue ? = null
273271 private var model: JsonField <String >? = null
274272 private var name: JsonField <String >? = null
275- private var object_: JsonField < Object > ? = null
273+ private var object_: JsonValue = JsonValue .from( " assistant " )
276274 private var tools: JsonField <MutableList <AssistantTool >>? = null
277275 private var responseFormat: JsonField <AssistantResponseFormatOption > = JsonMissing .of()
278276 private var temperature: JsonField <Double > = JsonMissing .of()
@@ -372,10 +370,7 @@ private constructor(
372370 fun name (name : JsonField <String >) = apply { this .name = name }
373371
374372 /* * The object type, which is always `assistant`. */
375- fun object_ (object_ : Object ) = object_(JsonField .of(object_))
376-
377- /* * The object type, which is always `assistant`. */
378- fun object_ (object_ : JsonField <Object >) = apply { this .object_ = object_ }
373+ fun object_ (object_ : JsonValue ) = apply { this .object_ = object_ }
379374
380375 /* *
381376 * A list of tool enabled on the assistant. There can be a maximum of 128 tools per
@@ -500,8 +495,7 @@ private constructor(
500495 }
501496
502497 /* * `auto` is the default value */
503- fun responseFormat (behavior : AssistantResponseFormatOption .Behavior ) =
504- responseFormat(AssistantResponseFormatOption .ofBehavior(behavior))
498+ fun responseFormatAuto () = responseFormat(AssistantResponseFormatOption .ofAuto())
505499
506500 /* *
507501 * Specifies the format that the model must output. Compatible with
@@ -696,7 +690,7 @@ private constructor(
696690 checkRequired(" metadata" , metadata),
697691 checkRequired(" model" , model),
698692 checkRequired(" name" , name),
699- checkRequired( " object_" , object_) ,
693+ object_,
700694 checkRequired(" tools" , tools).map { it.toImmutable() },
701695 responseFormat,
702696 temperature,
@@ -706,58 +700,6 @@ private constructor(
706700 )
707701 }
708702
709- /* * The object type, which is always `assistant`. */
710- class Object
711- @JsonCreator
712- private constructor (
713- private val value: JsonField <String >,
714- ) : Enum {
715-
716- @com.fasterxml.jackson.annotation.JsonValue fun _value (): JsonField <String > = value
717-
718- companion object {
719-
720- @JvmField val ASSISTANT = of(" assistant" )
721-
722- @JvmStatic fun of (value : String ) = Object (JsonField .of(value))
723- }
724-
725- enum class Known {
726- ASSISTANT ,
727- }
728-
729- enum class Value {
730- ASSISTANT ,
731- _UNKNOWN ,
732- }
733-
734- fun value (): Value =
735- when (this ) {
736- ASSISTANT -> Value .ASSISTANT
737- else -> Value ._UNKNOWN
738- }
739-
740- fun known (): Known =
741- when (this ) {
742- ASSISTANT -> Known .ASSISTANT
743- else -> throw OpenAIInvalidDataException (" Unknown Object: $value " )
744- }
745-
746- fun asString (): String = _value ().asStringOrThrow()
747-
748- override fun equals (other : Any? ): Boolean {
749- if (this == = other) {
750- return true
751- }
752-
753- return /* spotless:off */ other is Object && value == other.value /* spotless:on */
754- }
755-
756- override fun hashCode () = value.hashCode()
757-
758- override fun toString () = value.toString()
759- }
760-
761703 /* *
762704 * A set of resources that are used by the assistant's tools. The resources are specific to the
763705 * type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the
0 commit comments