@@ -44,15 +44,15 @@ import java.util.Optional
44
44
@JsonSerialize(using = AssistantResponseFormatOption .Serializer ::class )
45
45
class AssistantResponseFormatOption
46
46
private constructor (
47
- private val jsonValue : JsonValue ? = null ,
47
+ private val auto : JsonValue ? = null ,
48
48
private val responseFormatText: ResponseFormatText ? = null ,
49
49
private val responseFormatJsonObject: ResponseFormatJsonObject ? = null ,
50
50
private val responseFormatJsonSchema: ResponseFormatJsonSchema ? = null ,
51
51
private val _json : JsonValue ? = null ,
52
52
) {
53
53
54
54
/* * `auto` is the default value */
55
- fun jsonValue (): Optional <JsonValue > = Optional .ofNullable(jsonValue )
55
+ fun auto (): Optional <JsonValue > = Optional .ofNullable(auto )
56
56
57
57
/* * Default response format. Used to generate text responses. */
58
58
fun responseFormatText (): Optional <ResponseFormatText > = Optional .ofNullable(responseFormatText)
@@ -72,7 +72,7 @@ private constructor(
72
72
fun responseFormatJsonSchema (): Optional <ResponseFormatJsonSchema > =
73
73
Optional .ofNullable(responseFormatJsonSchema)
74
74
75
- fun isJsonValue (): Boolean = jsonValue != null
75
+ fun isAuto (): Boolean = auto != null
76
76
77
77
fun isResponseFormatText (): Boolean = responseFormatText != null
78
78
@@ -81,7 +81,7 @@ private constructor(
81
81
fun isResponseFormatJsonSchema (): Boolean = responseFormatJsonSchema != null
82
82
83
83
/* * `auto` is the default value */
84
- fun asJsonValue (): JsonValue = jsonValue .getOrThrow(" jsonValue " )
84
+ fun asAuto (): JsonValue = auto .getOrThrow(" auto " )
85
85
86
86
/* * Default response format. Used to generate text responses. */
87
87
fun asResponseFormatText (): ResponseFormatText =
@@ -106,7 +106,7 @@ private constructor(
106
106
107
107
fun <T > accept (visitor : Visitor <T >): T {
108
108
return when {
109
- jsonValue != null -> visitor.visitJsonValue(jsonValue )
109
+ auto != null -> visitor.visitAuto(auto )
110
110
responseFormatText != null -> visitor.visitResponseFormatText(responseFormatText)
111
111
responseFormatJsonObject != null ->
112
112
visitor.visitResponseFormatJsonObject(responseFormatJsonObject)
@@ -125,10 +125,10 @@ private constructor(
125
125
126
126
accept(
127
127
object : Visitor <Unit > {
128
- override fun visitJsonValue ( jsonValue : JsonValue ) {
129
- jsonValue .let {
128
+ override fun visitAuto ( auto : JsonValue ) {
129
+ auto .let {
130
130
if (it != JsonValue .from(" auto" )) {
131
- throw OpenAIInvalidDataException (" 'jsonValue ' is invalid, received $it " )
131
+ throw OpenAIInvalidDataException (" 'auto ' is invalid, received $it " )
132
132
}
133
133
}
134
134
}
@@ -158,14 +158,14 @@ private constructor(
158
158
return true
159
159
}
160
160
161
- return /* spotless:off */ other is AssistantResponseFormatOption && jsonValue == other.jsonValue && responseFormatText == other.responseFormatText && responseFormatJsonObject == other.responseFormatJsonObject && responseFormatJsonSchema == other.responseFormatJsonSchema /* spotless:on */
161
+ return /* spotless:off */ other is AssistantResponseFormatOption && auto == other.auto && responseFormatText == other.responseFormatText && responseFormatJsonObject == other.responseFormatJsonObject && responseFormatJsonSchema == other.responseFormatJsonSchema /* spotless:on */
162
162
}
163
163
164
- override fun hashCode (): Int = /* spotless:off */ Objects .hash(jsonValue , responseFormatText, responseFormatJsonObject, responseFormatJsonSchema) /* spotless:on */
164
+ override fun hashCode (): Int = /* spotless:off */ Objects .hash(auto , responseFormatText, responseFormatJsonObject, responseFormatJsonSchema) /* spotless:on */
165
165
166
166
override fun toString (): String =
167
167
when {
168
- jsonValue != null -> " AssistantResponseFormatOption{jsonValue= $jsonValue }"
168
+ auto != null -> " AssistantResponseFormatOption{auto= $auto }"
169
169
responseFormatText != null ->
170
170
" AssistantResponseFormatOption{responseFormatText=$responseFormatText }"
171
171
responseFormatJsonObject != null ->
@@ -179,8 +179,7 @@ private constructor(
179
179
companion object {
180
180
181
181
/* * `auto` is the default value */
182
- @JvmStatic
183
- fun ofJsonValue () = AssistantResponseFormatOption (jsonValue = JsonValue .from(" auto" ))
182
+ @JvmStatic fun ofAuto () = AssistantResponseFormatOption (auto = JsonValue .from(" auto" ))
184
183
185
184
/* * Default response format. Used to generate text responses. */
186
185
@JvmStatic
@@ -212,7 +211,7 @@ private constructor(
212
211
interface Visitor <out T > {
213
212
214
213
/* * `auto` is the default value */
215
- fun visitJsonValue ( jsonValue : JsonValue ): T
214
+ fun visitAuto ( auto : JsonValue ): T
216
215
217
216
/* * Default response format. Used to generate text responses. */
218
217
fun visitResponseFormatText (responseFormatText : ResponseFormatText ): T
@@ -254,12 +253,12 @@ private constructor(
254
253
tryDeserialize(node, jacksonTypeRef<JsonValue >()) {
255
254
it.let {
256
255
if (it != JsonValue .from(" auto" )) {
257
- throw OpenAIInvalidDataException (" 'jsonValue ' is invalid, received $it " )
256
+ throw OpenAIInvalidDataException (" 'auto ' is invalid, received $it " )
258
257
}
259
258
}
260
259
}
261
260
?.let {
262
- return AssistantResponseFormatOption (jsonValue = it, _json = json)
261
+ return AssistantResponseFormatOption (auto = it, _json = json)
263
262
}
264
263
tryDeserialize(node, jacksonTypeRef<ResponseFormatText >()) { it.validate() }
265
264
?.let {
@@ -293,7 +292,7 @@ private constructor(
293
292
provider : SerializerProvider ,
294
293
) {
295
294
when {
296
- value.jsonValue != null -> generator.writeObject(value.jsonValue )
295
+ value.auto != null -> generator.writeObject(value.auto )
297
296
value.responseFormatText != null -> generator.writeObject(value.responseFormatText)
298
297
value.responseFormatJsonObject != null ->
299
298
generator.writeObject(value.responseFormatJsonObject)
0 commit comments