Skip to content

Commit 7d0f1d4

Browse files
feat(api): api update
1 parent 4abb4d3 commit 7d0f1d4

8 files changed

Lines changed: 72 additions & 4 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 100
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/langsmith%2Flangsmith-api-0af883451d5bb3836c9d72c046ee3a95fcd8e5dcd0e9f29203ac31d5af782cd9.yml
3-
openapi_spec_hash: cafccc6c93d23ea22435abe14a7cfb57
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/langsmith%2Flangsmith-api-2985c4b2fb2775c54111e322dbeffbe9efd950053c298ba04bd69932af35ac88.yml
3+
openapi_spec_hash: c0a61a9dd24496915cb693120b218101
44
config_hash: d847cdf0b10e3d2ae194df8fed4ae22a

langsmith-java-core/src/main/kotlin/com/langchain/smith/models/annotationqueues/AnnotationQueueRubricItemSchema.kt

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class AnnotationQueueRubricItemSchema
2323
private constructor(
2424
private val feedbackKey: JsonField<String>,
2525
private val description: JsonField<String>,
26+
private val isRequired: JsonField<Boolean>,
2627
private val scoreDescriptions: JsonField<ScoreDescriptions>,
2728
private val valueDescriptions: JsonField<ValueDescriptions>,
2829
private val additionalProperties: MutableMap<String, JsonValue>,
@@ -36,13 +37,23 @@ private constructor(
3637
@JsonProperty("description")
3738
@ExcludeMissing
3839
description: JsonField<String> = JsonMissing.of(),
40+
@JsonProperty("is_required")
41+
@ExcludeMissing
42+
isRequired: JsonField<Boolean> = JsonMissing.of(),
3943
@JsonProperty("score_descriptions")
4044
@ExcludeMissing
4145
scoreDescriptions: JsonField<ScoreDescriptions> = JsonMissing.of(),
4246
@JsonProperty("value_descriptions")
4347
@ExcludeMissing
4448
valueDescriptions: JsonField<ValueDescriptions> = JsonMissing.of(),
45-
) : this(feedbackKey, description, scoreDescriptions, valueDescriptions, mutableMapOf())
49+
) : this(
50+
feedbackKey,
51+
description,
52+
isRequired,
53+
scoreDescriptions,
54+
valueDescriptions,
55+
mutableMapOf(),
56+
)
4657

4758
/**
4859
* @throws LangChainInvalidDataException if the JSON field has an unexpected type or is
@@ -56,6 +67,12 @@ private constructor(
5667
*/
5768
fun description(): Optional<String> = description.getOptional("description")
5869

70+
/**
71+
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if the
72+
* server responded with an unexpected value).
73+
*/
74+
fun isRequired(): Optional<Boolean> = isRequired.getOptional("is_required")
75+
5976
/**
6077
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if the
6178
* server responded with an unexpected value).
@@ -86,6 +103,13 @@ private constructor(
86103
*/
87104
@JsonProperty("description") @ExcludeMissing fun _description(): JsonField<String> = description
88105

106+
/**
107+
* Returns the raw JSON value of [isRequired].
108+
*
109+
* Unlike [isRequired], this method doesn't throw if the JSON field has an unexpected type.
110+
*/
111+
@JsonProperty("is_required") @ExcludeMissing fun _isRequired(): JsonField<Boolean> = isRequired
112+
89113
/**
90114
* Returns the raw JSON value of [scoreDescriptions].
91115
*
@@ -137,6 +161,7 @@ private constructor(
137161

138162
private var feedbackKey: JsonField<String>? = null
139163
private var description: JsonField<String> = JsonMissing.of()
164+
private var isRequired: JsonField<Boolean> = JsonMissing.of()
140165
private var scoreDescriptions: JsonField<ScoreDescriptions> = JsonMissing.of()
141166
private var valueDescriptions: JsonField<ValueDescriptions> = JsonMissing.of()
142167
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
@@ -146,6 +171,7 @@ private constructor(
146171
apply {
147172
feedbackKey = annotationQueueRubricItemSchema.feedbackKey
148173
description = annotationQueueRubricItemSchema.description
174+
isRequired = annotationQueueRubricItemSchema.isRequired
149175
scoreDescriptions = annotationQueueRubricItemSchema.scoreDescriptions
150176
valueDescriptions = annotationQueueRubricItemSchema.valueDescriptions
151177
additionalProperties =
@@ -177,6 +203,27 @@ private constructor(
177203
*/
178204
fun description(description: JsonField<String>) = apply { this.description = description }
179205

206+
fun isRequired(isRequired: Boolean?) = isRequired(JsonField.ofNullable(isRequired))
207+
208+
/**
209+
* Alias for [Builder.isRequired].
210+
*
211+
* This unboxed primitive overload exists for backwards compatibility.
212+
*/
213+
fun isRequired(isRequired: Boolean) = isRequired(isRequired as Boolean?)
214+
215+
/** Alias for calling [Builder.isRequired] with `isRequired.orElse(null)`. */
216+
fun isRequired(isRequired: Optional<Boolean>) = isRequired(isRequired.getOrNull())
217+
218+
/**
219+
* Sets [Builder.isRequired] to an arbitrary JSON value.
220+
*
221+
* You should usually call [Builder.isRequired] with a well-typed [Boolean] value instead.
222+
* This method is primarily for setting the field to an undocumented or not yet supported
223+
* value.
224+
*/
225+
fun isRequired(isRequired: JsonField<Boolean>) = apply { this.isRequired = isRequired }
226+
180227
fun scoreDescriptions(scoreDescriptions: ScoreDescriptions?) =
181228
scoreDescriptions(JsonField.ofNullable(scoreDescriptions))
182229

@@ -248,6 +295,7 @@ private constructor(
248295
AnnotationQueueRubricItemSchema(
249296
checkRequired("feedbackKey", feedbackKey),
250297
description,
298+
isRequired,
251299
scoreDescriptions,
252300
valueDescriptions,
253301
additionalProperties.toMutableMap(),
@@ -263,6 +311,7 @@ private constructor(
263311

264312
feedbackKey()
265313
description()
314+
isRequired()
266315
scoreDescriptions().ifPresent { it.validate() }
267316
valueDescriptions().ifPresent { it.validate() }
268317
validated = true
@@ -285,6 +334,7 @@ private constructor(
285334
internal fun validity(): Int =
286335
(if (feedbackKey.asKnown().isPresent) 1 else 0) +
287336
(if (description.asKnown().isPresent) 1 else 0) +
337+
(if (isRequired.asKnown().isPresent) 1 else 0) +
288338
(scoreDescriptions.asKnown().getOrNull()?.validity() ?: 0) +
289339
(valueDescriptions.asKnown().getOrNull()?.validity() ?: 0)
290340

@@ -494,6 +544,7 @@ private constructor(
494544
return other is AnnotationQueueRubricItemSchema &&
495545
feedbackKey == other.feedbackKey &&
496546
description == other.description &&
547+
isRequired == other.isRequired &&
497548
scoreDescriptions == other.scoreDescriptions &&
498549
valueDescriptions == other.valueDescriptions &&
499550
additionalProperties == other.additionalProperties
@@ -503,6 +554,7 @@ private constructor(
503554
Objects.hash(
504555
feedbackKey,
505556
description,
557+
isRequired,
506558
scoreDescriptions,
507559
valueDescriptions,
508560
additionalProperties,
@@ -512,5 +564,5 @@ private constructor(
512564
override fun hashCode(): Int = hashCode
513565

514566
override fun toString() =
515-
"AnnotationQueueRubricItemSchema{feedbackKey=$feedbackKey, description=$description, scoreDescriptions=$scoreDescriptions, valueDescriptions=$valueDescriptions, additionalProperties=$additionalProperties}"
567+
"AnnotationQueueRubricItemSchema{feedbackKey=$feedbackKey, description=$description, isRequired=$isRequired, scoreDescriptions=$scoreDescriptions, valueDescriptions=$valueDescriptions, additionalProperties=$additionalProperties}"
516568
}

langsmith-java-core/src/test/kotlin/com/langchain/smith/models/annotationqueues/AnnotationQueueAnnotationQueuesParamsTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ internal class AnnotationQueueAnnotationQueuesParamsTest {
3131
AnnotationQueueRubricItemSchema.builder()
3232
.feedbackKey("feedback_key")
3333
.description("description")
34+
.isRequired(true)
3435
.scoreDescriptions(
3536
AnnotationQueueRubricItemSchema.ScoreDescriptions.builder()
3637
.putAdditionalProperty("foo", JsonValue.from("string"))
@@ -70,6 +71,7 @@ internal class AnnotationQueueAnnotationQueuesParamsTest {
7071
AnnotationQueueRubricItemSchema.builder()
7172
.feedbackKey("feedback_key")
7273
.description("description")
74+
.isRequired(true)
7375
.scoreDescriptions(
7476
AnnotationQueueRubricItemSchema.ScoreDescriptions.builder()
7577
.putAdditionalProperty("foo", JsonValue.from("string"))
@@ -108,6 +110,7 @@ internal class AnnotationQueueAnnotationQueuesParamsTest {
108110
AnnotationQueueRubricItemSchema.builder()
109111
.feedbackKey("feedback_key")
110112
.description("description")
113+
.isRequired(true)
111114
.scoreDescriptions(
112115
AnnotationQueueRubricItemSchema.ScoreDescriptions.builder()
113116
.putAdditionalProperty("foo", JsonValue.from("string"))

langsmith-java-core/src/test/kotlin/com/langchain/smith/models/annotationqueues/AnnotationQueueRetrieveResponseTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ internal class AnnotationQueueRetrieveResponseTest {
3636
AnnotationQueueRubricItemSchema.builder()
3737
.feedbackKey("feedback_key")
3838
.description("description")
39+
.isRequired(true)
3940
.scoreDescriptions(
4041
AnnotationQueueRubricItemSchema.ScoreDescriptions.builder()
4142
.putAdditionalProperty("foo", JsonValue.from("string"))
@@ -81,6 +82,7 @@ internal class AnnotationQueueRetrieveResponseTest {
8182
AnnotationQueueRubricItemSchema.builder()
8283
.feedbackKey("feedback_key")
8384
.description("description")
85+
.isRequired(true)
8486
.scoreDescriptions(
8587
AnnotationQueueRubricItemSchema.ScoreDescriptions.builder()
8688
.putAdditionalProperty("foo", JsonValue.from("string"))
@@ -126,6 +128,7 @@ internal class AnnotationQueueRetrieveResponseTest {
126128
AnnotationQueueRubricItemSchema.builder()
127129
.feedbackKey("feedback_key")
128130
.description("description")
131+
.isRequired(true)
129132
.scoreDescriptions(
130133
AnnotationQueueRubricItemSchema.ScoreDescriptions.builder()
131134
.putAdditionalProperty("foo", JsonValue.from("string"))

langsmith-java-core/src/test/kotlin/com/langchain/smith/models/annotationqueues/AnnotationQueueRubricItemSchemaTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ internal class AnnotationQueueRubricItemSchemaTest {
1616
AnnotationQueueRubricItemSchema.builder()
1717
.feedbackKey("feedback_key")
1818
.description("description")
19+
.isRequired(true)
1920
.scoreDescriptions(
2021
AnnotationQueueRubricItemSchema.ScoreDescriptions.builder()
2122
.putAdditionalProperty("foo", JsonValue.from("string"))
@@ -30,6 +31,7 @@ internal class AnnotationQueueRubricItemSchemaTest {
3031

3132
assertThat(annotationQueueRubricItemSchema.feedbackKey()).isEqualTo("feedback_key")
3233
assertThat(annotationQueueRubricItemSchema.description()).contains("description")
34+
assertThat(annotationQueueRubricItemSchema.isRequired()).contains(true)
3335
assertThat(annotationQueueRubricItemSchema.scoreDescriptions())
3436
.contains(
3537
AnnotationQueueRubricItemSchema.ScoreDescriptions.builder()
@@ -51,6 +53,7 @@ internal class AnnotationQueueRubricItemSchemaTest {
5153
AnnotationQueueRubricItemSchema.builder()
5254
.feedbackKey("feedback_key")
5355
.description("description")
56+
.isRequired(true)
5457
.scoreDescriptions(
5558
AnnotationQueueRubricItemSchema.ScoreDescriptions.builder()
5659
.putAdditionalProperty("foo", JsonValue.from("string"))

langsmith-java-core/src/test/kotlin/com/langchain/smith/models/annotationqueues/AnnotationQueueUpdateParamsTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ internal class AnnotationQueueUpdateParamsTest {
2929
AnnotationQueueRubricItemSchema.builder()
3030
.feedbackKey("feedback_key")
3131
.description("description")
32+
.isRequired(true)
3233
.scoreDescriptions(
3334
AnnotationQueueRubricItemSchema.ScoreDescriptions.builder()
3435
.putAdditionalProperty("foo", JsonValue.from("string"))
@@ -77,6 +78,7 @@ internal class AnnotationQueueUpdateParamsTest {
7778
AnnotationQueueRubricItemSchema.builder()
7879
.feedbackKey("feedback_key")
7980
.description("description")
81+
.isRequired(true)
8082
.scoreDescriptions(
8183
AnnotationQueueRubricItemSchema.ScoreDescriptions.builder()
8284
.putAdditionalProperty("foo", JsonValue.from("string"))
@@ -114,6 +116,7 @@ internal class AnnotationQueueUpdateParamsTest {
114116
AnnotationQueueRubricItemSchema.builder()
115117
.feedbackKey("feedback_key")
116118
.description("description")
119+
.isRequired(true)
117120
.scoreDescriptions(
118121
AnnotationQueueRubricItemSchema.ScoreDescriptions.builder()
119122
.putAdditionalProperty("foo", JsonValue.from("string"))

langsmith-java-core/src/test/kotlin/com/langchain/smith/services/async/AnnotationQueueServiceAsyncTest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ internal class AnnotationQueueServiceAsyncTest {
7272
AnnotationQueueRubricItemSchema.builder()
7373
.feedbackKey("feedback_key")
7474
.description("description")
75+
.isRequired(true)
7576
.scoreDescriptions(
7677
AnnotationQueueRubricItemSchema.ScoreDescriptions.builder()
7778
.putAdditionalProperty("foo", JsonValue.from("string"))
@@ -143,6 +144,7 @@ internal class AnnotationQueueServiceAsyncTest {
143144
AnnotationQueueRubricItemSchema.builder()
144145
.feedbackKey("feedback_key")
145146
.description("description")
147+
.isRequired(true)
146148
.scoreDescriptions(
147149
AnnotationQueueRubricItemSchema.ScoreDescriptions.builder()
148150
.putAdditionalProperty("foo", JsonValue.from("string"))

langsmith-java-core/src/test/kotlin/com/langchain/smith/services/blocking/AnnotationQueueServiceTest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ internal class AnnotationQueueServiceTest {
7171
AnnotationQueueRubricItemSchema.builder()
7272
.feedbackKey("feedback_key")
7373
.description("description")
74+
.isRequired(true)
7475
.scoreDescriptions(
7576
AnnotationQueueRubricItemSchema.ScoreDescriptions.builder()
7677
.putAdditionalProperty("foo", JsonValue.from("string"))
@@ -139,6 +140,7 @@ internal class AnnotationQueueServiceTest {
139140
AnnotationQueueRubricItemSchema.builder()
140141
.feedbackKey("feedback_key")
141142
.description("description")
143+
.isRequired(true)
142144
.scoreDescriptions(
143145
AnnotationQueueRubricItemSchema.ScoreDescriptions.builder()
144146
.putAdditionalProperty("foo", JsonValue.from("string"))

0 commit comments

Comments
 (0)