Skip to content

Commit a4e3e5c

Browse files
feat(api): api update
1 parent c98692a commit a4e3e5c

6 files changed

Lines changed: 49 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: 104
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/langsmith%2Flangsmith-api-7099ceca240148ad6b487298d29b46989457c286512cc24e4fc79b63b7207993.yml
3-
openapi_spec_hash: f02a868af862d3375d403010b51929a0
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/langsmith%2Flangsmith-api-a3468745dec44bbe88134b6a36d26f65e37643fde3ce17c3db83dbb431d57553.yml
3+
openapi_spec_hash: 82d60dd29b2bc0846b53e57fa2ed4ff9
44
config_hash: 95f6a6cccc50b0e616468fc26d25b304

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

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ private constructor(
3030
private val endTime: JsonField<OffsetDateTime>,
3131
private val filter: JsonField<String>,
3232
private val hierarchy: JsonField<List<Long>>,
33+
private val isScheduled: JsonField<Boolean>,
3334
private val lastNHours: JsonField<Long>,
3435
private val model: JsonField<Model>,
3536
private val name: JsonField<String>,
@@ -59,6 +60,9 @@ private constructor(
5960
@JsonProperty("hierarchy")
6061
@ExcludeMissing
6162
hierarchy: JsonField<List<Long>> = JsonMissing.of(),
63+
@JsonProperty("is_scheduled")
64+
@ExcludeMissing
65+
isScheduled: JsonField<Boolean> = JsonMissing.of(),
6266
@JsonProperty("last_n_hours")
6367
@ExcludeMissing
6468
lastNHours: JsonField<Long> = JsonMissing.of(),
@@ -90,6 +94,7 @@ private constructor(
9094
endTime,
9195
filter,
9296
hierarchy,
97+
isScheduled,
9398
lastNHours,
9499
model,
95100
name,
@@ -140,6 +145,12 @@ private constructor(
140145
*/
141146
fun hierarchy(): Optional<List<Long>> = hierarchy.getOptional("hierarchy")
142147

148+
/**
149+
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if the
150+
* server responded with an unexpected value).
151+
*/
152+
fun isScheduled(): Optional<Boolean> = isScheduled.getOptional("is_scheduled")
153+
143154
/**
144155
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if the
145156
* server responded with an unexpected value).
@@ -248,6 +259,15 @@ private constructor(
248259
*/
249260
@JsonProperty("hierarchy") @ExcludeMissing fun _hierarchy(): JsonField<List<Long>> = hierarchy
250261

262+
/**
263+
* Returns the raw JSON value of [isScheduled].
264+
*
265+
* Unlike [isScheduled], this method doesn't throw if the JSON field has an unexpected type.
266+
*/
267+
@JsonProperty("is_scheduled")
268+
@ExcludeMissing
269+
fun _isScheduled(): JsonField<Boolean> = isScheduled
270+
251271
/**
252272
* Returns the raw JSON value of [lastNHours].
253273
*
@@ -361,6 +381,7 @@ private constructor(
361381
private var endTime: JsonField<OffsetDateTime> = JsonMissing.of()
362382
private var filter: JsonField<String> = JsonMissing.of()
363383
private var hierarchy: JsonField<MutableList<Long>>? = null
384+
private var isScheduled: JsonField<Boolean> = JsonMissing.of()
364385
private var lastNHours: JsonField<Long> = JsonMissing.of()
365386
private var model: JsonField<Model> = JsonMissing.of()
366387
private var name: JsonField<String> = JsonMissing.of()
@@ -381,6 +402,7 @@ private constructor(
381402
endTime = createRunClusteringJobRequest.endTime
382403
filter = createRunClusteringJobRequest.filter
383404
hierarchy = createRunClusteringJobRequest.hierarchy.map { it.toMutableList() }
405+
isScheduled = createRunClusteringJobRequest.isScheduled
384406
lastNHours = createRunClusteringJobRequest.lastNHours
385407
model = createRunClusteringJobRequest.model
386408
name = createRunClusteringJobRequest.name
@@ -496,6 +518,17 @@ private constructor(
496518
}
497519
}
498520

521+
fun isScheduled(isScheduled: Boolean) = isScheduled(JsonField.of(isScheduled))
522+
523+
/**
524+
* Sets [Builder.isScheduled] to an arbitrary JSON value.
525+
*
526+
* You should usually call [Builder.isScheduled] with a well-typed [Boolean] value instead.
527+
* This method is primarily for setting the field to an undocumented or not yet supported
528+
* value.
529+
*/
530+
fun isScheduled(isScheduled: JsonField<Boolean>) = apply { this.isScheduled = isScheduled }
531+
499532
fun lastNHours(lastNHours: Long?) = lastNHours(JsonField.ofNullable(lastNHours))
500533

501534
/**
@@ -683,6 +716,7 @@ private constructor(
683716
endTime,
684717
filter,
685718
(hierarchy ?: JsonMissing.of()).map { it.toImmutable() },
719+
isScheduled,
686720
lastNHours,
687721
model,
688722
name,
@@ -710,6 +744,7 @@ private constructor(
710744
endTime()
711745
filter()
712746
hierarchy()
747+
isScheduled()
713748
lastNHours()
714749
model().ifPresent { it.validate() }
715750
name()
@@ -744,6 +779,7 @@ private constructor(
744779
(if (endTime.asKnown().isPresent) 1 else 0) +
745780
(if (filter.asKnown().isPresent) 1 else 0) +
746781
(hierarchy.asKnown().getOrNull()?.size ?: 0) +
782+
(if (isScheduled.asKnown().isPresent) 1 else 0) +
747783
(if (lastNHours.asKnown().isPresent) 1 else 0) +
748784
(model.asKnown().getOrNull()?.validity() ?: 0) +
749785
(if (name.asKnown().isPresent) 1 else 0) +
@@ -1191,6 +1227,7 @@ private constructor(
11911227
endTime == other.endTime &&
11921228
filter == other.filter &&
11931229
hierarchy == other.hierarchy &&
1230+
isScheduled == other.isScheduled &&
11941231
lastNHours == other.lastNHours &&
11951232
model == other.model &&
11961233
name == other.name &&
@@ -1212,6 +1249,7 @@ private constructor(
12121249
endTime,
12131250
filter,
12141251
hierarchy,
1252+
isScheduled,
12151253
lastNHours,
12161254
model,
12171255
name,
@@ -1229,5 +1267,5 @@ private constructor(
12291267
override fun hashCode(): Int = hashCode
12301268

12311269
override fun toString() =
1232-
"CreateRunClusteringJobRequest{attributeSchemas=$attributeSchemas, clusterModel=$clusterModel, configId=$configId, endTime=$endTime, filter=$filter, hierarchy=$hierarchy, lastNHours=$lastNHours, model=$model, name=$name, partitions=$partitions, sample=$sample, startTime=$startTime, summaryModel=$summaryModel, summaryPrompt=$summaryPrompt, userContext=$userContext, validateModelSecrets=$validateModelSecrets, additionalProperties=$additionalProperties}"
1270+
"CreateRunClusteringJobRequest{attributeSchemas=$attributeSchemas, clusterModel=$clusterModel, configId=$configId, endTime=$endTime, filter=$filter, hierarchy=$hierarchy, isScheduled=$isScheduled, lastNHours=$lastNHours, model=$model, name=$name, partitions=$partitions, sample=$sample, startTime=$startTime, summaryModel=$summaryModel, summaryPrompt=$summaryPrompt, userContext=$userContext, validateModelSecrets=$validateModelSecrets, additionalProperties=$additionalProperties}"
12331271
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ internal class CreateRunClusteringJobRequestTest {
2626
.endTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
2727
.filter("filter")
2828
.addHierarchy(0L)
29+
.isScheduled(true)
2930
.lastNHours(0L)
3031
.model(CreateRunClusteringJobRequest.Model.OPENAI)
3132
.name("name")
@@ -59,6 +60,7 @@ internal class CreateRunClusteringJobRequestTest {
5960
.contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
6061
assertThat(createRunClusteringJobRequest.filter()).contains("filter")
6162
assertThat(createRunClusteringJobRequest.hierarchy().getOrNull()).containsExactly(0L)
63+
assertThat(createRunClusteringJobRequest.isScheduled()).contains(true)
6264
assertThat(createRunClusteringJobRequest.lastNHours()).contains(0L)
6365
assertThat(createRunClusteringJobRequest.model())
6466
.contains(CreateRunClusteringJobRequest.Model.OPENAI)
@@ -98,6 +100,7 @@ internal class CreateRunClusteringJobRequestTest {
98100
.endTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
99101
.filter("filter")
100102
.addHierarchy(0L)
103+
.isScheduled(true)
101104
.lastNHours(0L)
102105
.model(CreateRunClusteringJobRequest.Model.OPENAI)
103106
.name("name")

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ internal class InsightCreateParamsTest {
2525
.endTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
2626
.filter("filter")
2727
.addHierarchy(0L)
28+
.isScheduled(true)
2829
.lastNHours(0L)
2930
.model(CreateRunClusteringJobRequest.Model.OPENAI)
3031
.name("name")
@@ -78,6 +79,7 @@ internal class InsightCreateParamsTest {
7879
.endTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
7980
.filter("filter")
8081
.addHierarchy(0L)
82+
.isScheduled(true)
8183
.lastNHours(0L)
8284
.model(CreateRunClusteringJobRequest.Model.OPENAI)
8385
.name("name")
@@ -115,6 +117,7 @@ internal class InsightCreateParamsTest {
115117
.endTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
116118
.filter("filter")
117119
.addHierarchy(0L)
120+
.isScheduled(true)
118121
.lastNHours(0L)
119122
.model(CreateRunClusteringJobRequest.Model.OPENAI)
120123
.name("name")

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ internal class InsightServiceAsyncTest {
4343
.endTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
4444
.filter("filter")
4545
.addHierarchy(0L)
46+
.isScheduled(true)
4647
.lastNHours(0L)
4748
.model(CreateRunClusteringJobRequest.Model.OPENAI)
4849
.name("name")

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ internal class InsightServiceTest {
4343
.endTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
4444
.filter("filter")
4545
.addHierarchy(0L)
46+
.isScheduled(true)
4647
.lastNHours(0L)
4748
.model(CreateRunClusteringJobRequest.Model.OPENAI)
4849
.name("name")

0 commit comments

Comments
 (0)