@@ -27,8 +27,8 @@ import kotlin.jvm.optionals.getOrNull
2727@JsonSerialize(using = AnnotationDelta .Serializer ::class )
2828class AnnotationDelta
2929private constructor (
30- private val fileCitationDeltaAnnotation : FileCitationDeltaAnnotation ? = null ,
31- private val filePathDeltaAnnotation : FilePathDeltaAnnotation ? = null ,
30+ private val fileCitation : FileCitationDeltaAnnotation ? = null ,
31+ private val filePath : FilePathDeltaAnnotation ? = null ,
3232 private val _json : JsonValue ? = null ,
3333) {
3434
@@ -37,43 +37,37 @@ private constructor(
3737 * with the assistant or the message. Generated when the assistant uses the "file_search" tool
3838 * to search files.
3939 */
40- fun fileCitationDeltaAnnotation (): Optional <FileCitationDeltaAnnotation > =
41- Optional .ofNullable(fileCitationDeltaAnnotation)
40+ fun fileCitation (): Optional <FileCitationDeltaAnnotation > = Optional .ofNullable(fileCitation)
4241
4342 /* *
4443 * A URL for the file that's generated when the assistant used the `code_interpreter` tool to
4544 * generate a file.
4645 */
47- fun filePathDeltaAnnotation (): Optional <FilePathDeltaAnnotation > =
48- Optional .ofNullable(filePathDeltaAnnotation)
46+ fun filePath (): Optional <FilePathDeltaAnnotation > = Optional .ofNullable(filePath)
4947
50- fun isFileCitationDeltaAnnotation (): Boolean = fileCitationDeltaAnnotation != null
48+ fun isFileCitation (): Boolean = fileCitation != null
5149
52- fun isFilePathDeltaAnnotation (): Boolean = filePathDeltaAnnotation != null
50+ fun isFilePath (): Boolean = filePath != null
5351
5452 /* *
5553 * A citation within the message that points to a specific quote from a specific File associated
5654 * with the assistant or the message. Generated when the assistant uses the "file_search" tool
5755 * to search files.
5856 */
59- fun asFileCitationDeltaAnnotation (): FileCitationDeltaAnnotation =
60- fileCitationDeltaAnnotation.getOrThrow(" fileCitationDeltaAnnotation" )
57+ fun asFileCitation (): FileCitationDeltaAnnotation = fileCitation.getOrThrow(" fileCitation" )
6158
6259 /* *
6360 * A URL for the file that's generated when the assistant used the `code_interpreter` tool to
6461 * generate a file.
6562 */
66- fun asFilePathDeltaAnnotation (): FilePathDeltaAnnotation =
67- filePathDeltaAnnotation.getOrThrow(" filePathDeltaAnnotation" )
63+ fun asFilePath (): FilePathDeltaAnnotation = filePath.getOrThrow(" filePath" )
6864
6965 fun _json (): Optional <JsonValue > = Optional .ofNullable(_json )
7066
7167 fun <T > accept (visitor : Visitor <T >): T {
7268 return when {
73- fileCitationDeltaAnnotation != null ->
74- visitor.visitFileCitationDeltaAnnotation(fileCitationDeltaAnnotation)
75- filePathDeltaAnnotation != null ->
76- visitor.visitFilePathDeltaAnnotation(filePathDeltaAnnotation)
69+ fileCitation != null -> visitor.visitFileCitation(fileCitation)
70+ filePath != null -> visitor.visitFilePath(filePath)
7771 else -> visitor.unknown(_json )
7872 }
7973 }
@@ -87,16 +81,12 @@ private constructor(
8781
8882 accept(
8983 object : Visitor <Unit > {
90- override fun visitFileCitationDeltaAnnotation (
91- fileCitationDeltaAnnotation : FileCitationDeltaAnnotation
92- ) {
93- fileCitationDeltaAnnotation.validate()
84+ override fun visitFileCitation (fileCitation : FileCitationDeltaAnnotation ) {
85+ fileCitation.validate()
9486 }
9587
96- override fun visitFilePathDeltaAnnotation (
97- filePathDeltaAnnotation : FilePathDeltaAnnotation
98- ) {
99- filePathDeltaAnnotation.validate()
88+ override fun visitFilePath (filePath : FilePathDeltaAnnotation ) {
89+ filePath.validate()
10090 }
10191 }
10292 )
@@ -108,17 +98,15 @@ private constructor(
10898 return true
10999 }
110100
111- return /* spotless:off */ other is AnnotationDelta && fileCitationDeltaAnnotation == other.fileCitationDeltaAnnotation && filePathDeltaAnnotation == other.filePathDeltaAnnotation /* spotless:on */
101+ return /* spotless:off */ other is AnnotationDelta && fileCitation == other.fileCitation && filePath == other.filePath /* spotless:on */
112102 }
113103
114- override fun hashCode (): Int = /* spotless:off */ Objects .hash(fileCitationDeltaAnnotation, filePathDeltaAnnotation ) /* spotless:on */
104+ override fun hashCode (): Int = /* spotless:off */ Objects .hash(fileCitation, filePath ) /* spotless:on */
115105
116106 override fun toString (): String =
117107 when {
118- fileCitationDeltaAnnotation != null ->
119- " AnnotationDelta{fileCitationDeltaAnnotation=$fileCitationDeltaAnnotation }"
120- filePathDeltaAnnotation != null ->
121- " AnnotationDelta{filePathDeltaAnnotation=$filePathDeltaAnnotation }"
108+ fileCitation != null -> " AnnotationDelta{fileCitation=$fileCitation }"
109+ filePath != null -> " AnnotationDelta{filePath=$filePath }"
122110 _json != null -> " AnnotationDelta{_unknown=$_json }"
123111 else -> throw IllegalStateException (" Invalid AnnotationDelta" )
124112 }
@@ -131,17 +119,15 @@ private constructor(
131119 * "file_search" tool to search files.
132120 */
133121 @JvmStatic
134- fun ofFileCitationDeltaAnnotation (
135- fileCitationDeltaAnnotation : FileCitationDeltaAnnotation
136- ) = AnnotationDelta (fileCitationDeltaAnnotation = fileCitationDeltaAnnotation)
122+ fun ofFileCitation (fileCitation : FileCitationDeltaAnnotation ) =
123+ AnnotationDelta (fileCitation = fileCitation)
137124
138125 /* *
139126 * A URL for the file that's generated when the assistant used the `code_interpreter` tool
140127 * to generate a file.
141128 */
142129 @JvmStatic
143- fun ofFilePathDeltaAnnotation (filePathDeltaAnnotation : FilePathDeltaAnnotation ) =
144- AnnotationDelta (filePathDeltaAnnotation = filePathDeltaAnnotation)
130+ fun ofFilePath (filePath : FilePathDeltaAnnotation ) = AnnotationDelta (filePath = filePath)
145131 }
146132
147133 interface Visitor <out T > {
@@ -151,15 +137,13 @@ private constructor(
151137 * associated with the assistant or the message. Generated when the assistant uses the
152138 * "file_search" tool to search files.
153139 */
154- fun visitFileCitationDeltaAnnotation (
155- fileCitationDeltaAnnotation : FileCitationDeltaAnnotation
156- ): T
140+ fun visitFileCitation (fileCitation : FileCitationDeltaAnnotation ): T
157141
158142 /* *
159143 * A URL for the file that's generated when the assistant used the `code_interpreter` tool
160144 * to generate a file.
161145 */
162- fun visitFilePathDeltaAnnotation ( filePathDeltaAnnotation : FilePathDeltaAnnotation ): T
146+ fun visitFilePath ( filePath : FilePathDeltaAnnotation ): T
163147
164148 fun unknown (json : JsonValue ? ): T {
165149 throw OpenAIInvalidDataException (" Unknown AnnotationDelta: $json " )
@@ -178,15 +162,15 @@ private constructor(
178162 it.validate()
179163 }
180164 ?.let {
181- return AnnotationDelta (fileCitationDeltaAnnotation = it, _json = json)
165+ return AnnotationDelta (fileCitation = it, _json = json)
182166 }
183167 }
184168 " file_path" -> {
185169 tryDeserialize(node, jacksonTypeRef<FilePathDeltaAnnotation >()) {
186170 it.validate()
187171 }
188172 ?.let {
189- return AnnotationDelta (filePathDeltaAnnotation = it, _json = json)
173+ return AnnotationDelta (filePath = it, _json = json)
190174 }
191175 }
192176 }
@@ -203,10 +187,8 @@ private constructor(
203187 provider : SerializerProvider
204188 ) {
205189 when {
206- value.fileCitationDeltaAnnotation != null ->
207- generator.writeObject(value.fileCitationDeltaAnnotation)
208- value.filePathDeltaAnnotation != null ->
209- generator.writeObject(value.filePathDeltaAnnotation)
190+ value.fileCitation != null -> generator.writeObject(value.fileCitation)
191+ value.filePath != null -> generator.writeObject(value.filePath)
210192 value._json != null -> generator.writeObject(value._json )
211193 else -> throw IllegalStateException (" Invalid AnnotationDelta" )
212194 }
0 commit comments