Skip to content

Commit 3a6c191

Browse files
feat(api): api update
1 parent 467ef66 commit 3a6c191

3 files changed

Lines changed: 43 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: 100
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/langsmith%2Flangsmith-api-866ae5ce4904e2aa8355d0852d13df86834cbbce4234ad68dbb392137cd28509.yml
3-
openapi_spec_hash: a7ba79631fc1dfb533995c6fb5e0607c
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/langsmith%2Flangsmith-api-5e5e30c7710326d426e2a5a6c9e19052c0315dc0df70fec3c18c7f95b6d70227.yml
3+
openapi_spec_hash: 344a506527b2c4ce283ff4c92eda40c7
44
config_hash: d847cdf0b10e3d2ae194df8fed4ae22a

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

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ private constructor(
2828
private val clusters: JsonField<List<Cluster>>,
2929
private val name: JsonField<String>,
3030
private val status: JsonField<String>,
31+
private val configId: JsonField<String>,
3132
private val endTime: JsonField<OffsetDateTime>,
3233
private val error: JsonField<String>,
3334
private val metadata: JsonField<Metadata>,
@@ -45,6 +46,7 @@ private constructor(
4546
clusters: JsonField<List<Cluster>> = JsonMissing.of(),
4647
@JsonProperty("name") @ExcludeMissing name: JsonField<String> = JsonMissing.of(),
4748
@JsonProperty("status") @ExcludeMissing status: JsonField<String> = JsonMissing.of(),
49+
@JsonProperty("config_id") @ExcludeMissing configId: JsonField<String> = JsonMissing.of(),
4850
@JsonProperty("end_time")
4951
@ExcludeMissing
5052
endTime: JsonField<OffsetDateTime> = JsonMissing.of(),
@@ -60,6 +62,7 @@ private constructor(
6062
clusters,
6163
name,
6264
status,
65+
configId,
6366
endTime,
6467
error,
6568
metadata,
@@ -93,6 +96,12 @@ private constructor(
9396
*/
9497
fun status(): String = status.getRequired("status")
9598

99+
/**
100+
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if the
101+
* server responded with an unexpected value).
102+
*/
103+
fun configId(): Optional<String> = configId.getOptional("config_id")
104+
96105
/**
97106
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if the
98107
* server responded with an unexpected value).
@@ -159,6 +168,13 @@ private constructor(
159168
*/
160169
@JsonProperty("status") @ExcludeMissing fun _status(): JsonField<String> = status
161170

171+
/**
172+
* Returns the raw JSON value of [configId].
173+
*
174+
* Unlike [configId], this method doesn't throw if the JSON field has an unexpected type.
175+
*/
176+
@JsonProperty("config_id") @ExcludeMissing fun _configId(): JsonField<String> = configId
177+
162178
/**
163179
* Returns the raw JSON value of [endTime].
164180
*
@@ -238,6 +254,7 @@ private constructor(
238254
private var clusters: JsonField<MutableList<Cluster>>? = null
239255
private var name: JsonField<String>? = null
240256
private var status: JsonField<String>? = null
257+
private var configId: JsonField<String> = JsonMissing.of()
241258
private var endTime: JsonField<OffsetDateTime> = JsonMissing.of()
242259
private var error: JsonField<String> = JsonMissing.of()
243260
private var metadata: JsonField<Metadata> = JsonMissing.of()
@@ -252,6 +269,7 @@ private constructor(
252269
clusters = insightRetrieveJobResponse.clusters.map { it.toMutableList() }
253270
name = insightRetrieveJobResponse.name
254271
status = insightRetrieveJobResponse.status
272+
configId = insightRetrieveJobResponse.configId
255273
endTime = insightRetrieveJobResponse.endTime
256274
error = insightRetrieveJobResponse.error
257275
metadata = insightRetrieveJobResponse.metadata
@@ -316,6 +334,19 @@ private constructor(
316334
*/
317335
fun status(status: JsonField<String>) = apply { this.status = status }
318336

337+
fun configId(configId: String?) = configId(JsonField.ofNullable(configId))
338+
339+
/** Alias for calling [Builder.configId] with `configId.orElse(null)`. */
340+
fun configId(configId: Optional<String>) = configId(configId.getOrNull())
341+
342+
/**
343+
* Sets [Builder.configId] to an arbitrary JSON value.
344+
*
345+
* You should usually call [Builder.configId] with a well-typed [String] value instead. This
346+
* method is primarily for setting the field to an undocumented or not yet supported value.
347+
*/
348+
fun configId(configId: JsonField<String>) = apply { this.configId = configId }
349+
319350
fun endTime(endTime: OffsetDateTime?) = endTime(JsonField.ofNullable(endTime))
320351

321352
/** Alias for calling [Builder.endTime] with `endTime.orElse(null)`. */
@@ -438,6 +469,7 @@ private constructor(
438469
checkRequired("clusters", clusters).map { it.toImmutable() },
439470
checkRequired("name", name),
440471
checkRequired("status", status),
472+
configId,
441473
endTime,
442474
error,
443475
metadata,
@@ -459,6 +491,7 @@ private constructor(
459491
clusters().forEach { it.validate() }
460492
name()
461493
status()
494+
configId()
462495
endTime()
463496
error()
464497
metadata().ifPresent { it.validate() }
@@ -487,6 +520,7 @@ private constructor(
487520
(clusters.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
488521
(if (name.asKnown().isPresent) 1 else 0) +
489522
(if (status.asKnown().isPresent) 1 else 0) +
523+
(if (configId.asKnown().isPresent) 1 else 0) +
490524
(if (endTime.asKnown().isPresent) 1 else 0) +
491525
(if (error.asKnown().isPresent) 1 else 0) +
492526
(metadata.asKnown().getOrNull()?.validity() ?: 0) +
@@ -1896,6 +1930,7 @@ private constructor(
18961930
clusters == other.clusters &&
18971931
name == other.name &&
18981932
status == other.status &&
1933+
configId == other.configId &&
18991934
endTime == other.endTime &&
19001935
error == other.error &&
19011936
metadata == other.metadata &&
@@ -1911,6 +1946,7 @@ private constructor(
19111946
clusters,
19121947
name,
19131948
status,
1949+
configId,
19141950
endTime,
19151951
error,
19161952
metadata,
@@ -1924,5 +1960,5 @@ private constructor(
19241960
override fun hashCode(): Int = hashCode
19251961

19261962
override fun toString() =
1927-
"InsightRetrieveJobResponse{id=$id, clusters=$clusters, name=$name, status=$status, endTime=$endTime, error=$error, metadata=$metadata, report=$report, shape=$shape, startTime=$startTime, additionalProperties=$additionalProperties}"
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}"
19281964
}

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
@@ -34,6 +34,7 @@ internal class InsightRetrieveJobResponseTest {
3434
)
3535
.name("name")
3636
.status("status")
37+
.configId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
3738
.endTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
3839
.error("error")
3940
.metadata(
@@ -87,6 +88,8 @@ internal class InsightRetrieveJobResponseTest {
8788
)
8889
assertThat(insightRetrieveJobResponse.name()).isEqualTo("name")
8990
assertThat(insightRetrieveJobResponse.status()).isEqualTo("status")
91+
assertThat(insightRetrieveJobResponse.configId())
92+
.contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
9093
assertThat(insightRetrieveJobResponse.endTime())
9194
.contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
9295
assertThat(insightRetrieveJobResponse.error()).contains("error")
@@ -148,6 +151,7 @@ internal class InsightRetrieveJobResponseTest {
148151
)
149152
.name("name")
150153
.status("status")
154+
.configId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
151155
.endTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
152156
.error("error")
153157
.metadata(

0 commit comments

Comments
 (0)