Skip to content

Commit 4b9c97d

Browse files
feat(api): api update
1 parent 0abc823 commit 4b9c97d

5 files changed

Lines changed: 89 additions & 6 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: 104
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/langsmith%2Flangsmith-api-86df437b1a174e52ff89f7fba9aad8e706ea3172397f8475c55a66ab4c2399b0.yml
3-
openapi_spec_hash: 024e9b421ab148b28e611ef948f99b1e
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/langsmith%2Flangsmith-api-e477c7ee7146719ee7ffa93d2357a745e83c6cb6f60363ee6961b7c80bb7b68e.yml
3+
openapi_spec_hash: 995d70b745e49bedbf77883febaf372d
44
config_hash: 95f6a6cccc50b0e616468fc26d25b304

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

Lines changed: 82 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ private constructor(
3737
*/
3838
fun endTime(): Optional<OffsetDateTime> = body.endTime()
3939

40+
/**
41+
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if the
42+
* server responded with an unexpected value).
43+
*/
44+
fun includeAnnotatorDetail(): Optional<Boolean> = body.includeAnnotatorDetail()
45+
4046
/**
4147
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if the
4248
* server responded with an unexpected value).
@@ -50,6 +56,14 @@ private constructor(
5056
*/
5157
fun _endTime(): JsonField<OffsetDateTime> = body._endTime()
5258

59+
/**
60+
* Returns the raw JSON value of [includeAnnotatorDetail].
61+
*
62+
* Unlike [includeAnnotatorDetail], this method doesn't throw if the JSON field has an
63+
* unexpected type.
64+
*/
65+
fun _includeAnnotatorDetail(): JsonField<Boolean> = body._includeAnnotatorDetail()
66+
5367
/**
5468
* Returns the raw JSON value of [startTime].
5569
*
@@ -104,6 +118,7 @@ private constructor(
104118
* This is generally only useful if you are already constructing the body separately.
105119
* Otherwise, it's more convenient to use the top-level setters instead:
106120
* - [endTime]
121+
* - [includeAnnotatorDetail]
107122
* - [startTime]
108123
*/
109124
fun body(body: Body) = apply { this.body = body.toBuilder() }
@@ -122,6 +137,21 @@ private constructor(
122137
*/
123138
fun endTime(endTime: JsonField<OffsetDateTime>) = apply { body.endTime(endTime) }
124139

140+
fun includeAnnotatorDetail(includeAnnotatorDetail: Boolean) = apply {
141+
body.includeAnnotatorDetail(includeAnnotatorDetail)
142+
}
143+
144+
/**
145+
* Sets [Builder.includeAnnotatorDetail] to an arbitrary JSON value.
146+
*
147+
* You should usually call [Builder.includeAnnotatorDetail] with a well-typed [Boolean]
148+
* value instead. This method is primarily for setting the field to an undocumented or not
149+
* yet supported value.
150+
*/
151+
fun includeAnnotatorDetail(includeAnnotatorDetail: JsonField<Boolean>) = apply {
152+
body.includeAnnotatorDetail(includeAnnotatorDetail)
153+
}
154+
125155
fun startTime(startTime: OffsetDateTime?) = apply { body.startTime(startTime) }
126156

127157
/** Alias for calling [Builder.startTime] with `startTime.orElse(null)`. */
@@ -284,6 +314,7 @@ private constructor(
284314
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
285315
private constructor(
286316
private val endTime: JsonField<OffsetDateTime>,
317+
private val includeAnnotatorDetail: JsonField<Boolean>,
287318
private val startTime: JsonField<OffsetDateTime>,
288319
private val additionalProperties: MutableMap<String, JsonValue>,
289320
) {
@@ -293,17 +324,27 @@ private constructor(
293324
@JsonProperty("end_time")
294325
@ExcludeMissing
295326
endTime: JsonField<OffsetDateTime> = JsonMissing.of(),
327+
@JsonProperty("include_annotator_detail")
328+
@ExcludeMissing
329+
includeAnnotatorDetail: JsonField<Boolean> = JsonMissing.of(),
296330
@JsonProperty("start_time")
297331
@ExcludeMissing
298332
startTime: JsonField<OffsetDateTime> = JsonMissing.of(),
299-
) : this(endTime, startTime, mutableMapOf())
333+
) : this(endTime, includeAnnotatorDetail, startTime, mutableMapOf())
300334

301335
/**
302336
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if
303337
* the server responded with an unexpected value).
304338
*/
305339
fun endTime(): Optional<OffsetDateTime> = endTime.getOptional("end_time")
306340

341+
/**
342+
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if
343+
* the server responded with an unexpected value).
344+
*/
345+
fun includeAnnotatorDetail(): Optional<Boolean> =
346+
includeAnnotatorDetail.getOptional("include_annotator_detail")
347+
307348
/**
308349
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if
309350
* the server responded with an unexpected value).
@@ -319,6 +360,16 @@ private constructor(
319360
@ExcludeMissing
320361
fun _endTime(): JsonField<OffsetDateTime> = endTime
321362

363+
/**
364+
* Returns the raw JSON value of [includeAnnotatorDetail].
365+
*
366+
* Unlike [includeAnnotatorDetail], this method doesn't throw if the JSON field has an
367+
* unexpected type.
368+
*/
369+
@JsonProperty("include_annotator_detail")
370+
@ExcludeMissing
371+
fun _includeAnnotatorDetail(): JsonField<Boolean> = includeAnnotatorDetail
372+
322373
/**
323374
* Returns the raw JSON value of [startTime].
324375
*
@@ -350,12 +401,14 @@ private constructor(
350401
class Builder internal constructor() {
351402

352403
private var endTime: JsonField<OffsetDateTime> = JsonMissing.of()
404+
private var includeAnnotatorDetail: JsonField<Boolean> = JsonMissing.of()
353405
private var startTime: JsonField<OffsetDateTime> = JsonMissing.of()
354406
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
355407

356408
@JvmSynthetic
357409
internal fun from(body: Body) = apply {
358410
endTime = body.endTime
411+
includeAnnotatorDetail = body.includeAnnotatorDetail
359412
startTime = body.startTime
360413
additionalProperties = body.additionalProperties.toMutableMap()
361414
}
@@ -374,6 +427,20 @@ private constructor(
374427
*/
375428
fun endTime(endTime: JsonField<OffsetDateTime>) = apply { this.endTime = endTime }
376429

430+
fun includeAnnotatorDetail(includeAnnotatorDetail: Boolean) =
431+
includeAnnotatorDetail(JsonField.of(includeAnnotatorDetail))
432+
433+
/**
434+
* Sets [Builder.includeAnnotatorDetail] to an arbitrary JSON value.
435+
*
436+
* You should usually call [Builder.includeAnnotatorDetail] with a well-typed [Boolean]
437+
* value instead. This method is primarily for setting the field to an undocumented or
438+
* not yet supported value.
439+
*/
440+
fun includeAnnotatorDetail(includeAnnotatorDetail: JsonField<Boolean>) = apply {
441+
this.includeAnnotatorDetail = includeAnnotatorDetail
442+
}
443+
377444
fun startTime(startTime: OffsetDateTime?) = startTime(JsonField.ofNullable(startTime))
378445

379446
/** Alias for calling [Builder.startTime] with `startTime.orElse(null)`. */
@@ -414,7 +481,13 @@ private constructor(
414481
*
415482
* Further updates to this [Builder] will not mutate the returned instance.
416483
*/
417-
fun build(): Body = Body(endTime, startTime, additionalProperties.toMutableMap())
484+
fun build(): Body =
485+
Body(
486+
endTime,
487+
includeAnnotatorDetail,
488+
startTime,
489+
additionalProperties.toMutableMap(),
490+
)
418491
}
419492

420493
private var validated: Boolean = false
@@ -425,6 +498,7 @@ private constructor(
425498
}
426499

427500
endTime()
501+
includeAnnotatorDetail()
428502
startTime()
429503
validated = true
430504
}
@@ -446,6 +520,7 @@ private constructor(
446520
@JvmSynthetic
447521
internal fun validity(): Int =
448522
(if (endTime.asKnown().isPresent) 1 else 0) +
523+
(if (includeAnnotatorDetail.asKnown().isPresent) 1 else 0) +
449524
(if (startTime.asKnown().isPresent) 1 else 0)
450525

451526
override fun equals(other: Any?): Boolean {
@@ -455,16 +530,19 @@ private constructor(
455530

456531
return other is Body &&
457532
endTime == other.endTime &&
533+
includeAnnotatorDetail == other.includeAnnotatorDetail &&
458534
startTime == other.startTime &&
459535
additionalProperties == other.additionalProperties
460536
}
461537

462-
private val hashCode: Int by lazy { Objects.hash(endTime, startTime, additionalProperties) }
538+
private val hashCode: Int by lazy {
539+
Objects.hash(endTime, includeAnnotatorDetail, startTime, additionalProperties)
540+
}
463541

464542
override fun hashCode(): Int = hashCode
465543

466544
override fun toString() =
467-
"Body{endTime=$endTime, startTime=$startTime, additionalProperties=$additionalProperties}"
545+
"Body{endTime=$endTime, includeAnnotatorDetail=$includeAnnotatorDetail, startTime=$startTime, additionalProperties=$additionalProperties}"
468546
}
469547

470548
override fun equals(other: Any?): Boolean {

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ internal class AnnotationQueueExportParamsTest {
1313
AnnotationQueueExportParams.builder()
1414
.queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
1515
.endTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
16+
.includeAnnotatorDetail(true)
1617
.startTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
1718
.build()
1819
}
@@ -35,12 +36,14 @@ internal class AnnotationQueueExportParamsTest {
3536
AnnotationQueueExportParams.builder()
3637
.queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
3738
.endTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
39+
.includeAnnotatorDetail(true)
3840
.startTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
3941
.build()
4042

4143
val body = params._body()
4244

4345
assertThat(body.endTime()).contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
46+
assertThat(body.includeAnnotatorDetail()).contains(true)
4447
assertThat(body.startTime()).contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
4548
}
4649

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ internal class AnnotationQueueServiceAsyncTest {
199199
AnnotationQueueExportParams.builder()
200200
.queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
201201
.endTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
202+
.includeAnnotatorDetail(true)
202203
.startTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
203204
.build()
204205
)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ internal class AnnotationQueueServiceTest {
193193
AnnotationQueueExportParams.builder()
194194
.queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
195195
.endTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
196+
.includeAnnotatorDetail(true)
196197
.startTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
197198
.build()
198199
)

0 commit comments

Comments
 (0)