@@ -43,6 +43,7 @@ private constructor(
4343 private val correction: JsonField <Correction >,
4444 private val createdAt: JsonField <OffsetDateTime >,
4545 private val error: JsonField <Boolean >,
46+ private val extra: JsonField <Extra >,
4647 private val feedbackConfig: JsonField <FeedbackConfig >,
4748 private val feedbackGroupId: JsonField <String >,
4849 private val feedbackSource: JsonField <FeedbackSource >,
@@ -71,6 +72,7 @@ private constructor(
7172 @ExcludeMissing
7273 createdAt: JsonField <OffsetDateTime > = JsonMissing .of(),
7374 @JsonProperty(" error" ) @ExcludeMissing error: JsonField <Boolean > = JsonMissing .of(),
75+ @JsonProperty(" extra" ) @ExcludeMissing extra: JsonField <Extra > = JsonMissing .of(),
7476 @JsonProperty(" feedback_config" )
7577 @ExcludeMissing
7678 feedbackConfig: JsonField <FeedbackConfig > = JsonMissing .of(),
@@ -99,6 +101,7 @@ private constructor(
99101 correction,
100102 createdAt,
101103 error,
104+ extra,
102105 feedbackConfig,
103106 feedbackGroupId,
104107 feedbackSource,
@@ -155,6 +158,12 @@ private constructor(
155158 */
156159 fun error (): Optional <Boolean > = error.getOptional(" error" )
157160
161+ /* *
162+ * @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if the
163+ * server responded with an unexpected value).
164+ */
165+ fun extra (): Optional <Extra > = extra.getOptional(" extra" )
166+
158167 /* *
159168 * @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if the
160169 * server responded with an unexpected value).
@@ -273,6 +282,13 @@ private constructor(
273282 */
274283 @JsonProperty(" error" ) @ExcludeMissing fun _error (): JsonField <Boolean > = error
275284
285+ /* *
286+ * Returns the raw JSON value of [extra].
287+ *
288+ * Unlike [extra], this method doesn't throw if the JSON field has an unexpected type.
289+ */
290+ @JsonProperty(" extra" ) @ExcludeMissing fun _extra (): JsonField <Extra > = extra
291+
276292 /* *
277293 * Returns the raw JSON value of [feedbackConfig].
278294 *
@@ -388,6 +404,7 @@ private constructor(
388404 private var correction: JsonField <Correction > = JsonMissing .of()
389405 private var createdAt: JsonField <OffsetDateTime > = JsonMissing .of()
390406 private var error: JsonField <Boolean > = JsonMissing .of()
407+ private var extra: JsonField <Extra > = JsonMissing .of()
391408 private var feedbackConfig: JsonField <FeedbackConfig > = JsonMissing .of()
392409 private var feedbackGroupId: JsonField <String > = JsonMissing .of()
393410 private var feedbackSource: JsonField <FeedbackSource > = JsonMissing .of()
@@ -409,6 +426,7 @@ private constructor(
409426 correction = feedbackCreateSchema.correction
410427 createdAt = feedbackCreateSchema.createdAt
411428 error = feedbackCreateSchema.error
429+ extra = feedbackCreateSchema.extra
412430 feedbackConfig = feedbackCreateSchema.feedbackConfig
413431 feedbackGroupId = feedbackCreateSchema.feedbackGroupId
414432 feedbackSource = feedbackCreateSchema.feedbackSource
@@ -528,6 +546,19 @@ private constructor(
528546 */
529547 fun error (error : JsonField <Boolean >) = apply { this .error = error }
530548
549+ fun extra (extra : Extra ? ) = extra(JsonField .ofNullable(extra))
550+
551+ /* * Alias for calling [Builder.extra] with `extra.orElse(null)`. */
552+ fun extra (extra : Optional <Extra >) = extra(extra.getOrNull())
553+
554+ /* *
555+ * Sets [Builder.extra] to an arbitrary JSON value.
556+ *
557+ * You should usually call [Builder.extra] with a well-typed [Extra] value instead. This
558+ * method is primarily for setting the field to an undocumented or not yet supported value.
559+ */
560+ fun extra (extra : JsonField <Extra >) = apply { this .extra = extra }
561+
531562 fun feedbackConfig (feedbackConfig : FeedbackConfig ? ) =
532563 feedbackConfig(JsonField .ofNullable(feedbackConfig))
533564
@@ -748,6 +779,7 @@ private constructor(
748779 correction,
749780 createdAt,
750781 error,
782+ extra,
751783 feedbackConfig,
752784 feedbackGroupId,
753785 feedbackSource,
@@ -776,6 +808,7 @@ private constructor(
776808 correction().ifPresent { it.validate() }
777809 createdAt()
778810 error()
811+ extra().ifPresent { it.validate() }
779812 feedbackConfig().ifPresent { it.validate() }
780813 feedbackGroupId()
781814 feedbackSource().ifPresent { it.validate() }
@@ -811,6 +844,7 @@ private constructor(
811844 (correction.asKnown().getOrNull()?.validity() ? : 0 ) +
812845 (if (createdAt.asKnown().isPresent) 1 else 0 ) +
813846 (if (error.asKnown().isPresent) 1 else 0 ) +
847+ (extra.asKnown().getOrNull()?.validity() ? : 0 ) +
814848 (feedbackConfig.asKnown().getOrNull()?.validity() ? : 0 ) +
815849 (if (feedbackGroupId.asKnown().isPresent) 1 else 0 ) +
816850 (feedbackSource.asKnown().getOrNull()?.validity() ? : 0 ) +
@@ -1099,6 +1133,105 @@ private constructor(
10991133 }
11001134 }
11011135
1136+ class Extra
1137+ @JsonCreator
1138+ private constructor (
1139+ @com.fasterxml.jackson.annotation.JsonValue
1140+ private val additionalProperties: Map <String , JsonValue >
1141+ ) {
1142+
1143+ @JsonAnyGetter
1144+ @ExcludeMissing
1145+ fun _additionalProperties (): Map <String , JsonValue > = additionalProperties
1146+
1147+ fun toBuilder () = Builder ().from(this )
1148+
1149+ companion object {
1150+
1151+ /* * Returns a mutable builder for constructing an instance of [Extra]. */
1152+ @JvmStatic fun builder () = Builder ()
1153+ }
1154+
1155+ /* * A builder for [Extra]. */
1156+ class Builder internal constructor() {
1157+
1158+ private var additionalProperties: MutableMap <String , JsonValue > = mutableMapOf ()
1159+
1160+ @JvmSynthetic
1161+ internal fun from (extra : Extra ) = apply {
1162+ additionalProperties = extra.additionalProperties.toMutableMap()
1163+ }
1164+
1165+ fun additionalProperties (additionalProperties : Map <String , JsonValue >) = apply {
1166+ this .additionalProperties.clear()
1167+ putAllAdditionalProperties(additionalProperties)
1168+ }
1169+
1170+ fun putAdditionalProperty (key : String , value : JsonValue ) = apply {
1171+ additionalProperties.put(key, value)
1172+ }
1173+
1174+ fun putAllAdditionalProperties (additionalProperties : Map <String , JsonValue >) = apply {
1175+ this .additionalProperties.putAll(additionalProperties)
1176+ }
1177+
1178+ fun removeAdditionalProperty (key : String ) = apply { additionalProperties.remove(key) }
1179+
1180+ fun removeAllAdditionalProperties (keys : Set <String >) = apply {
1181+ keys.forEach(::removeAdditionalProperty)
1182+ }
1183+
1184+ /* *
1185+ * Returns an immutable instance of [Extra].
1186+ *
1187+ * Further updates to this [Builder] will not mutate the returned instance.
1188+ */
1189+ fun build (): Extra = Extra (additionalProperties.toImmutable())
1190+ }
1191+
1192+ private var validated: Boolean = false
1193+
1194+ fun validate (): Extra = apply {
1195+ if (validated) {
1196+ return @apply
1197+ }
1198+
1199+ validated = true
1200+ }
1201+
1202+ fun isValid (): Boolean =
1203+ try {
1204+ validate()
1205+ true
1206+ } catch (e: LangChainInvalidDataException ) {
1207+ false
1208+ }
1209+
1210+ /* *
1211+ * Returns a score indicating how many valid values are contained in this object
1212+ * recursively.
1213+ *
1214+ * Used for best match union deserialization.
1215+ */
1216+ @JvmSynthetic
1217+ internal fun validity (): Int =
1218+ additionalProperties.count { (_, value) -> ! value.isNull() && ! value.isMissing() }
1219+
1220+ override fun equals (other : Any? ): Boolean {
1221+ if (this == = other) {
1222+ return true
1223+ }
1224+
1225+ return other is Extra && additionalProperties == other.additionalProperties
1226+ }
1227+
1228+ private val hashCode: Int by lazy { Objects .hash(additionalProperties) }
1229+
1230+ override fun hashCode (): Int = hashCode
1231+
1232+ override fun toString () = " Extra{additionalProperties=$additionalProperties }"
1233+ }
1234+
11021235 class FeedbackConfig
11031236 @JsonCreator(mode = JsonCreator .Mode .DISABLED )
11041237 private constructor (
@@ -2472,6 +2605,7 @@ private constructor(
24722605 correction == other.correction &&
24732606 createdAt == other.createdAt &&
24742607 error == other.error &&
2608+ extra == other.extra &&
24752609 feedbackConfig == other.feedbackConfig &&
24762610 feedbackGroupId == other.feedbackGroupId &&
24772611 feedbackSource == other.feedbackSource &&
@@ -2494,6 +2628,7 @@ private constructor(
24942628 correction,
24952629 createdAt,
24962630 error,
2631+ extra,
24972632 feedbackConfig,
24982633 feedbackGroupId,
24992634 feedbackSource,
@@ -2511,5 +2646,5 @@ private constructor(
25112646 override fun hashCode (): Int = hashCode
25122647
25132648 override fun toString () =
2514- " FeedbackCreateSchema{key=$key , id=$id , comment=$comment , comparativeExperimentId=$comparativeExperimentId , correction=$correction , createdAt=$createdAt , error=$error , feedbackConfig=$feedbackConfig , feedbackGroupId=$feedbackGroupId , feedbackSource=$feedbackSource , modifiedAt=$modifiedAt , runId=$runId , score=$score , sessionId=$sessionId , startTime=$startTime , traceId=$traceId , value=$value , additionalProperties=$additionalProperties }"
2649+ " FeedbackCreateSchema{key=$key , id=$id , comment=$comment , comparativeExperimentId=$comparativeExperimentId , correction=$correction , createdAt=$createdAt , error=$error , extra= $extra , feedbackConfig=$feedbackConfig , feedbackGroupId=$feedbackGroupId , feedbackSource=$feedbackSource , modifiedAt=$modifiedAt , runId=$runId , score=$score , sessionId=$sessionId , startTime=$startTime , traceId=$traceId , value=$value , additionalProperties=$additionalProperties }"
25152650}
0 commit comments