Skip to content

Commit 286a62f

Browse files
feat(api): api update
1 parent 362fb32 commit 286a62f

5 files changed

Lines changed: 45 additions & 3 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: 103
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/langsmith%2Flangsmith-api-9b9d7777d6a9aab968ca5e1c90d7dda257754fd6542e44483976ad91d2841499.yml
3-
openapi_spec_hash: 160db38681b0b3ce536e2a1a7ab1ad4d
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/langsmith%2Flangsmith-api-dad7ecbfe311b828014fc6ad1ad4583c72ca6349041e080c3658889eb6c35bf2.yml
3+
openapi_spec_hash: 9e0bfc3dce4e093ee0c20950af3cb525
44
config_hash: c217b34d458f1b65f260715693d447f9

langsmith-java-core/src/main/kotlin/com/langchain/smith/models/feedback/FeedbackSchema.kt

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ private constructor(
4444
private val feedbackGroupId: JsonField<String>,
4545
private val feedbackSource: JsonField<FeedbackSource>,
4646
private val feedbackThreadId: JsonField<String>,
47+
private val isRoot: JsonField<Boolean>,
4748
private val modifiedAt: JsonField<OffsetDateTime>,
4849
private val runId: JsonField<String>,
4950
private val score: JsonField<Score>,
@@ -78,6 +79,7 @@ private constructor(
7879
@JsonProperty("feedback_thread_id")
7980
@ExcludeMissing
8081
feedbackThreadId: JsonField<String> = JsonMissing.of(),
82+
@JsonProperty("is_root") @ExcludeMissing isRoot: JsonField<Boolean> = JsonMissing.of(),
8183
@JsonProperty("modified_at")
8284
@ExcludeMissing
8385
modifiedAt: JsonField<OffsetDateTime> = JsonMissing.of(),
@@ -100,6 +102,7 @@ private constructor(
100102
feedbackGroupId,
101103
feedbackSource,
102104
feedbackThreadId,
105+
isRoot,
103106
modifiedAt,
104107
runId,
105108
score,
@@ -173,6 +176,12 @@ private constructor(
173176
*/
174177
fun feedbackThreadId(): Optional<String> = feedbackThreadId.getOptional("feedback_thread_id")
175178

179+
/**
180+
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if the
181+
* server responded with an unexpected value).
182+
*/
183+
fun isRoot(): Optional<Boolean> = isRoot.getOptional("is_root")
184+
176185
/**
177186
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if the
178187
* server responded with an unexpected value).
@@ -299,6 +308,13 @@ private constructor(
299308
@ExcludeMissing
300309
fun _feedbackThreadId(): JsonField<String> = feedbackThreadId
301310

311+
/**
312+
* Returns the raw JSON value of [isRoot].
313+
*
314+
* Unlike [isRoot], this method doesn't throw if the JSON field has an unexpected type.
315+
*/
316+
@JsonProperty("is_root") @ExcludeMissing fun _isRoot(): JsonField<Boolean> = isRoot
317+
302318
/**
303319
* Returns the raw JSON value of [modifiedAt].
304320
*
@@ -391,6 +407,7 @@ private constructor(
391407
private var feedbackGroupId: JsonField<String> = JsonMissing.of()
392408
private var feedbackSource: JsonField<FeedbackSource> = JsonMissing.of()
393409
private var feedbackThreadId: JsonField<String> = JsonMissing.of()
410+
private var isRoot: JsonField<Boolean> = JsonMissing.of()
394411
private var modifiedAt: JsonField<OffsetDateTime> = JsonMissing.of()
395412
private var runId: JsonField<String> = JsonMissing.of()
396413
private var score: JsonField<Score> = JsonMissing.of()
@@ -412,6 +429,7 @@ private constructor(
412429
feedbackGroupId = feedbackSchema.feedbackGroupId
413430
feedbackSource = feedbackSchema.feedbackSource
414431
feedbackThreadId = feedbackSchema.feedbackThreadId
432+
isRoot = feedbackSchema.isRoot
415433
modifiedAt = feedbackSchema.modifiedAt
416434
runId = feedbackSchema.runId
417435
score = feedbackSchema.score
@@ -576,6 +594,16 @@ private constructor(
576594
this.feedbackThreadId = feedbackThreadId
577595
}
578596

597+
fun isRoot(isRoot: Boolean) = isRoot(JsonField.of(isRoot))
598+
599+
/**
600+
* Sets [Builder.isRoot] to an arbitrary JSON value.
601+
*
602+
* You should usually call [Builder.isRoot] with a well-typed [Boolean] value instead. This
603+
* method is primarily for setting the field to an undocumented or not yet supported value.
604+
*/
605+
fun isRoot(isRoot: JsonField<Boolean>) = apply { this.isRoot = isRoot }
606+
579607
fun modifiedAt(modifiedAt: OffsetDateTime) = modifiedAt(JsonField.of(modifiedAt))
580608

581609
/**
@@ -731,6 +759,7 @@ private constructor(
731759
feedbackGroupId,
732760
feedbackSource,
733761
feedbackThreadId,
762+
isRoot,
734763
modifiedAt,
735764
runId,
736765
score,
@@ -759,6 +788,7 @@ private constructor(
759788
feedbackGroupId()
760789
feedbackSource().ifPresent { it.validate() }
761790
feedbackThreadId()
791+
isRoot()
762792
modifiedAt()
763793
runId()
764794
score().ifPresent { it.validate() }
@@ -794,6 +824,7 @@ private constructor(
794824
(if (feedbackGroupId.asKnown().isPresent) 1 else 0) +
795825
(feedbackSource.asKnown().getOrNull()?.validity() ?: 0) +
796826
(if (feedbackThreadId.asKnown().isPresent) 1 else 0) +
827+
(if (isRoot.asKnown().isPresent) 1 else 0) +
797828
(if (modifiedAt.asKnown().isPresent) 1 else 0) +
798829
(if (runId.asKnown().isPresent) 1 else 0) +
799830
(score.asKnown().getOrNull()?.validity() ?: 0) +
@@ -2078,6 +2109,7 @@ private constructor(
20782109
feedbackGroupId == other.feedbackGroupId &&
20792110
feedbackSource == other.feedbackSource &&
20802111
feedbackThreadId == other.feedbackThreadId &&
2112+
isRoot == other.isRoot &&
20812113
modifiedAt == other.modifiedAt &&
20822114
runId == other.runId &&
20832115
score == other.score &&
@@ -2100,6 +2132,7 @@ private constructor(
21002132
feedbackGroupId,
21012133
feedbackSource,
21022134
feedbackThreadId,
2135+
isRoot,
21032136
modifiedAt,
21042137
runId,
21052138
score,
@@ -2114,5 +2147,5 @@ private constructor(
21142147
override fun hashCode(): Int = hashCode
21152148

21162149
override fun toString() =
2117-
"FeedbackSchema{id=$id, key=$key, comment=$comment, comparativeExperimentId=$comparativeExperimentId, correction=$correction, createdAt=$createdAt, extra=$extra, feedbackGroupId=$feedbackGroupId, feedbackSource=$feedbackSource, feedbackThreadId=$feedbackThreadId, modifiedAt=$modifiedAt, runId=$runId, score=$score, sessionId=$sessionId, startTime=$startTime, traceId=$traceId, value=$value, additionalProperties=$additionalProperties}"
2150+
"FeedbackSchema{id=$id, key=$key, comment=$comment, comparativeExperimentId=$comparativeExperimentId, correction=$correction, createdAt=$createdAt, extra=$extra, feedbackGroupId=$feedbackGroupId, feedbackSource=$feedbackSource, feedbackThreadId=$feedbackThreadId, isRoot=$isRoot, modifiedAt=$modifiedAt, runId=$runId, score=$score, sessionId=$sessionId, startTime=$startTime, traceId=$traceId, value=$value, additionalProperties=$additionalProperties}"
21182151
}

langsmith-java-core/src/test/kotlin/com/langchain/smith/models/datasets/group/GroupRunsResponseTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ internal class GroupRunsResponseTest {
116116
.build()
117117
)
118118
.feedbackThreadId("feedback_thread_id")
119+
.isRoot(true)
119120
.modifiedAt(
120121
OffsetDateTime.parse("2019-12-27T18:11:19.117Z")
121122
)
@@ -372,6 +373,7 @@ internal class GroupRunsResponseTest {
372373
.build()
373374
)
374375
.feedbackThreadId("feedback_thread_id")
376+
.isRoot(true)
375377
.modifiedAt(
376378
OffsetDateTime.parse("2019-12-27T18:11:19.117Z")
377379
)
@@ -634,6 +636,7 @@ internal class GroupRunsResponseTest {
634636
.build()
635637
)
636638
.feedbackThreadId("feedback_thread_id")
639+
.isRoot(true)
637640
.modifiedAt(
638641
OffsetDateTime.parse("2019-12-27T18:11:19.117Z")
639642
)

langsmith-java-core/src/test/kotlin/com/langchain/smith/models/datasets/runs/ExampleWithRunsChTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ internal class ExampleWithRunsChTest {
8787
.build()
8888
)
8989
.feedbackThreadId("feedback_thread_id")
90+
.isRoot(true)
9091
.modifiedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
9192
.runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
9293
.score(0.0)
@@ -234,6 +235,7 @@ internal class ExampleWithRunsChTest {
234235
.build()
235236
)
236237
.feedbackThreadId("feedback_thread_id")
238+
.isRoot(true)
237239
.modifiedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
238240
.runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
239241
.score(0.0)
@@ -389,6 +391,7 @@ internal class ExampleWithRunsChTest {
389391
.build()
390392
)
391393
.feedbackThreadId("feedback_thread_id")
394+
.isRoot(true)
392395
.modifiedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
393396
.runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
394397
.score(0.0)

langsmith-java-core/src/test/kotlin/com/langchain/smith/models/feedback/FeedbackSchemaTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ internal class FeedbackSchemaTest {
4545
.build()
4646
)
4747
.feedbackThreadId("feedback_thread_id")
48+
.isRoot(true)
4849
.modifiedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
4950
.runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
5051
.score(0.0)
@@ -92,6 +93,7 @@ internal class FeedbackSchemaTest {
9293
.build()
9394
)
9495
assertThat(feedbackSchema.feedbackThreadId()).contains("feedback_thread_id")
96+
assertThat(feedbackSchema.isRoot()).contains(true)
9597
assertThat(feedbackSchema.modifiedAt())
9698
.contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
9799
assertThat(feedbackSchema.runId()).contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
@@ -138,6 +140,7 @@ internal class FeedbackSchemaTest {
138140
.build()
139141
)
140142
.feedbackThreadId("feedback_thread_id")
143+
.isRoot(true)
141144
.modifiedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
142145
.runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
143146
.score(0.0)

0 commit comments

Comments
 (0)