Skip to content

Commit d11c759

Browse files
feat(api): api update
1 parent c27e0d9 commit d11c759

3 files changed

Lines changed: 47 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: 106
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/langsmith%2Flangsmith-api-d849c91cfc6aa4cee1af06d76712d39346bb6a3b402378a244e29e650d2fd82a.yml
3-
openapi_spec_hash: 1225321da6879d4715f178f69f8483a3
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/langsmith%2Flangsmith-api-383cd03e52bce94f84882944ad633362ba496af3c2890d0872ee7e564a5c435d.yml
3+
openapi_spec_hash: dfe9b24090fe1528453c32abedbff77b
44
config_hash: 547a7f805036e8dd5fc37a0e908d0400

langsmith-java-core/src/main/kotlin/com/langchain/smith/models/sessions/insights/InsightRetrieveJobResponse.kt

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class InsightRetrieveJobResponse
2626
private constructor(
2727
private val id: JsonField<String>,
2828
private val clusters: JsonField<List<Cluster>>,
29+
private val createdAt: JsonField<OffsetDateTime>,
2930
private val name: JsonField<String>,
3031
private val status: JsonField<String>,
3132
private val configId: JsonField<String>,
@@ -44,6 +45,9 @@ private constructor(
4445
@JsonProperty("clusters")
4546
@ExcludeMissing
4647
clusters: JsonField<List<Cluster>> = JsonMissing.of(),
48+
@JsonProperty("created_at")
49+
@ExcludeMissing
50+
createdAt: JsonField<OffsetDateTime> = JsonMissing.of(),
4751
@JsonProperty("name") @ExcludeMissing name: JsonField<String> = JsonMissing.of(),
4852
@JsonProperty("status") @ExcludeMissing status: JsonField<String> = JsonMissing.of(),
4953
@JsonProperty("config_id") @ExcludeMissing configId: JsonField<String> = JsonMissing.of(),
@@ -60,6 +64,7 @@ private constructor(
6064
) : this(
6165
id,
6266
clusters,
67+
createdAt,
6368
name,
6469
status,
6570
configId,
@@ -84,6 +89,12 @@ private constructor(
8489
*/
8590
fun clusters(): List<Cluster> = clusters.getRequired("clusters")
8691

92+
/**
93+
* @throws LangChainInvalidDataException if the JSON field has an unexpected type or is
94+
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
95+
*/
96+
fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at")
97+
8798
/**
8899
* @throws LangChainInvalidDataException if the JSON field has an unexpected type or is
89100
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
@@ -154,6 +165,15 @@ private constructor(
154165
*/
155166
@JsonProperty("clusters") @ExcludeMissing fun _clusters(): JsonField<List<Cluster>> = clusters
156167

168+
/**
169+
* Returns the raw JSON value of [createdAt].
170+
*
171+
* Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected type.
172+
*/
173+
@JsonProperty("created_at")
174+
@ExcludeMissing
175+
fun _createdAt(): JsonField<OffsetDateTime> = createdAt
176+
157177
/**
158178
* Returns the raw JSON value of [name].
159179
*
@@ -240,6 +260,7 @@ private constructor(
240260
* ```java
241261
* .id()
242262
* .clusters()
263+
* .createdAt()
243264
* .name()
244265
* .status()
245266
* ```
@@ -252,6 +273,7 @@ private constructor(
252273

253274
private var id: JsonField<String>? = null
254275
private var clusters: JsonField<MutableList<Cluster>>? = null
276+
private var createdAt: JsonField<OffsetDateTime>? = null
255277
private var name: JsonField<String>? = null
256278
private var status: JsonField<String>? = null
257279
private var configId: JsonField<String> = JsonMissing.of()
@@ -267,6 +289,7 @@ private constructor(
267289
internal fun from(insightRetrieveJobResponse: InsightRetrieveJobResponse) = apply {
268290
id = insightRetrieveJobResponse.id
269291
clusters = insightRetrieveJobResponse.clusters.map { it.toMutableList() }
292+
createdAt = insightRetrieveJobResponse.createdAt
270293
name = insightRetrieveJobResponse.name
271294
status = insightRetrieveJobResponse.status
272295
configId = insightRetrieveJobResponse.configId
@@ -314,6 +337,17 @@ private constructor(
314337
}
315338
}
316339

340+
fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt))
341+
342+
/**
343+
* Sets [Builder.createdAt] to an arbitrary JSON value.
344+
*
345+
* You should usually call [Builder.createdAt] with a well-typed [OffsetDateTime] value
346+
* instead. This method is primarily for setting the field to an undocumented or not yet
347+
* supported value.
348+
*/
349+
fun createdAt(createdAt: JsonField<OffsetDateTime>) = apply { this.createdAt = createdAt }
350+
317351
fun name(name: String) = name(JsonField.of(name))
318352

319353
/**
@@ -457,6 +491,7 @@ private constructor(
457491
* ```java
458492
* .id()
459493
* .clusters()
494+
* .createdAt()
460495
* .name()
461496
* .status()
462497
* ```
@@ -467,6 +502,7 @@ private constructor(
467502
InsightRetrieveJobResponse(
468503
checkRequired("id", id),
469504
checkRequired("clusters", clusters).map { it.toImmutable() },
505+
checkRequired("createdAt", createdAt),
470506
checkRequired("name", name),
471507
checkRequired("status", status),
472508
configId,
@@ -489,6 +525,7 @@ private constructor(
489525

490526
id()
491527
clusters().forEach { it.validate() }
528+
createdAt()
492529
name()
493530
status()
494531
configId()
@@ -518,6 +555,7 @@ private constructor(
518555
internal fun validity(): Int =
519556
(if (id.asKnown().isPresent) 1 else 0) +
520557
(clusters.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
558+
(if (createdAt.asKnown().isPresent) 1 else 0) +
521559
(if (name.asKnown().isPresent) 1 else 0) +
522560
(if (status.asKnown().isPresent) 1 else 0) +
523561
(if (configId.asKnown().isPresent) 1 else 0) +
@@ -1928,6 +1966,7 @@ private constructor(
19281966
return other is InsightRetrieveJobResponse &&
19291967
id == other.id &&
19301968
clusters == other.clusters &&
1969+
createdAt == other.createdAt &&
19311970
name == other.name &&
19321971
status == other.status &&
19331972
configId == other.configId &&
@@ -1944,6 +1983,7 @@ private constructor(
19441983
Objects.hash(
19451984
id,
19461985
clusters,
1986+
createdAt,
19471987
name,
19481988
status,
19491989
configId,
@@ -1960,5 +2000,5 @@ private constructor(
19602000
override fun hashCode(): Int = hashCode
19612001

19622002
override fun toString() =
1963-
"InsightRetrieveJobResponse{id=$id, clusters=$clusters, name=$name, status=$status, configId=$configId, endTime=$endTime, error=$error, metadata=$metadata, report=$report, shape=$shape, startTime=$startTime, additionalProperties=$additionalProperties}"
2003+
"InsightRetrieveJobResponse{id=$id, clusters=$clusters, createdAt=$createdAt, name=$name, status=$status, configId=$configId, endTime=$endTime, error=$error, metadata=$metadata, report=$report, shape=$shape, startTime=$startTime, additionalProperties=$additionalProperties}"
19642004
}

langsmith-java-core/src/test/kotlin/com/langchain/smith/models/sessions/insights/InsightRetrieveJobResponseTest.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ internal class InsightRetrieveJobResponseTest {
3232
.parentName("parent_name")
3333
.build()
3434
)
35+
.createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
3536
.name("name")
3637
.status("status")
3738
.configId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
@@ -86,6 +87,8 @@ internal class InsightRetrieveJobResponseTest {
8687
.parentName("parent_name")
8788
.build()
8889
)
90+
assertThat(insightRetrieveJobResponse.createdAt())
91+
.isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
8992
assertThat(insightRetrieveJobResponse.name()).isEqualTo("name")
9093
assertThat(insightRetrieveJobResponse.status()).isEqualTo("status")
9194
assertThat(insightRetrieveJobResponse.configId())
@@ -149,6 +152,7 @@ internal class InsightRetrieveJobResponseTest {
149152
.parentName("parent_name")
150153
.build()
151154
)
155+
.createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
152156
.name("name")
153157
.status("status")
154158
.configId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")

0 commit comments

Comments
 (0)