Skip to content

Commit 9485112

Browse files
feat(api): api update
1 parent 1fc294a commit 9485112

6 files changed

Lines changed: 105 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-ea867a9368a010768601c6681f868edfc453f6fc1a44f42f0ed14220b1ff1629.yml
3-
openapi_spec_hash: dc8269c47b3c9c67d0ae66fd9d05c146
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/langsmith%2Flangsmith-api-5bf4abfc12b4b133a43183f5dc513f704d368671c06a02d0dca4dc5bedfd6e59.yml
3+
openapi_spec_hash: 47426a8e252d092efed7f0458ae3abba
44
config_hash: d847cdf0b10e3d2ae194df8fed4ae22a

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

Lines changed: 87 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class CreateRunClusteringJobRequest
2525
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
2626
private constructor(
2727
private val attributeSchemas: JsonField<AttributeSchemas>,
28+
private val clusterModel: JsonField<String>,
2829
private val configId: JsonField<String>,
2930
private val endTime: JsonField<OffsetDateTime>,
3031
private val filter: JsonField<String>,
@@ -35,6 +36,7 @@ private constructor(
3536
private val partitions: JsonField<Partitions>,
3637
private val sample: JsonField<Double>,
3738
private val startTime: JsonField<OffsetDateTime>,
39+
private val summaryModel: JsonField<String>,
3840
private val summaryPrompt: JsonField<String>,
3941
private val userContext: JsonField<UserContext>,
4042
private val validateModelSecrets: JsonField<Boolean>,
@@ -46,6 +48,9 @@ private constructor(
4648
@JsonProperty("attribute_schemas")
4749
@ExcludeMissing
4850
attributeSchemas: JsonField<AttributeSchemas> = JsonMissing.of(),
51+
@JsonProperty("cluster_model")
52+
@ExcludeMissing
53+
clusterModel: JsonField<String> = JsonMissing.of(),
4954
@JsonProperty("config_id") @ExcludeMissing configId: JsonField<String> = JsonMissing.of(),
5055
@JsonProperty("end_time")
5156
@ExcludeMissing
@@ -66,6 +71,9 @@ private constructor(
6671
@JsonProperty("start_time")
6772
@ExcludeMissing
6873
startTime: JsonField<OffsetDateTime> = JsonMissing.of(),
74+
@JsonProperty("summary_model")
75+
@ExcludeMissing
76+
summaryModel: JsonField<String> = JsonMissing.of(),
6977
@JsonProperty("summary_prompt")
7078
@ExcludeMissing
7179
summaryPrompt: JsonField<String> = JsonMissing.of(),
@@ -77,6 +85,7 @@ private constructor(
7785
validateModelSecrets: JsonField<Boolean> = JsonMissing.of(),
7886
) : this(
7987
attributeSchemas,
88+
clusterModel,
8089
configId,
8190
endTime,
8291
filter,
@@ -87,6 +96,7 @@ private constructor(
8796
partitions,
8897
sample,
8998
startTime,
99+
summaryModel,
90100
summaryPrompt,
91101
userContext,
92102
validateModelSecrets,
@@ -100,6 +110,12 @@ private constructor(
100110
fun attributeSchemas(): Optional<AttributeSchemas> =
101111
attributeSchemas.getOptional("attribute_schemas")
102112

113+
/**
114+
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if the
115+
* server responded with an unexpected value).
116+
*/
117+
fun clusterModel(): Optional<String> = clusterModel.getOptional("cluster_model")
118+
103119
/**
104120
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if the
105121
* server responded with an unexpected value).
@@ -160,6 +176,12 @@ private constructor(
160176
*/
161177
fun startTime(): Optional<OffsetDateTime> = startTime.getOptional("start_time")
162178

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 summaryModel(): Optional<String> = summaryModel.getOptional("summary_model")
184+
163185
/**
164186
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if the
165187
* server responded with an unexpected value).
@@ -189,6 +211,15 @@ private constructor(
189211
@ExcludeMissing
190212
fun _attributeSchemas(): JsonField<AttributeSchemas> = attributeSchemas
191213

214+
/**
215+
* Returns the raw JSON value of [clusterModel].
216+
*
217+
* Unlike [clusterModel], this method doesn't throw if the JSON field has an unexpected type.
218+
*/
219+
@JsonProperty("cluster_model")
220+
@ExcludeMissing
221+
fun _clusterModel(): JsonField<String> = clusterModel
222+
192223
/**
193224
* Returns the raw JSON value of [configId].
194225
*
@@ -263,6 +294,15 @@ private constructor(
263294
@ExcludeMissing
264295
fun _startTime(): JsonField<OffsetDateTime> = startTime
265296

297+
/**
298+
* Returns the raw JSON value of [summaryModel].
299+
*
300+
* Unlike [summaryModel], this method doesn't throw if the JSON field has an unexpected type.
301+
*/
302+
@JsonProperty("summary_model")
303+
@ExcludeMissing
304+
fun _summaryModel(): JsonField<String> = summaryModel
305+
266306
/**
267307
* Returns the raw JSON value of [summaryPrompt].
268308
*
@@ -316,6 +356,7 @@ private constructor(
316356
class Builder internal constructor() {
317357

318358
private var attributeSchemas: JsonField<AttributeSchemas> = JsonMissing.of()
359+
private var clusterModel: JsonField<String> = JsonMissing.of()
319360
private var configId: JsonField<String> = JsonMissing.of()
320361
private var endTime: JsonField<OffsetDateTime> = JsonMissing.of()
321362
private var filter: JsonField<String> = JsonMissing.of()
@@ -326,6 +367,7 @@ private constructor(
326367
private var partitions: JsonField<Partitions> = JsonMissing.of()
327368
private var sample: JsonField<Double> = JsonMissing.of()
328369
private var startTime: JsonField<OffsetDateTime> = JsonMissing.of()
370+
private var summaryModel: JsonField<String> = JsonMissing.of()
329371
private var summaryPrompt: JsonField<String> = JsonMissing.of()
330372
private var userContext: JsonField<UserContext> = JsonMissing.of()
331373
private var validateModelSecrets: JsonField<Boolean> = JsonMissing.of()
@@ -334,6 +376,7 @@ private constructor(
334376
@JvmSynthetic
335377
internal fun from(createRunClusteringJobRequest: CreateRunClusteringJobRequest) = apply {
336378
attributeSchemas = createRunClusteringJobRequest.attributeSchemas
379+
clusterModel = createRunClusteringJobRequest.clusterModel
337380
configId = createRunClusteringJobRequest.configId
338381
endTime = createRunClusteringJobRequest.endTime
339382
filter = createRunClusteringJobRequest.filter
@@ -344,6 +387,7 @@ private constructor(
344387
partitions = createRunClusteringJobRequest.partitions
345388
sample = createRunClusteringJobRequest.sample
346389
startTime = createRunClusteringJobRequest.startTime
390+
summaryModel = createRunClusteringJobRequest.summaryModel
347391
summaryPrompt = createRunClusteringJobRequest.summaryPrompt
348392
userContext = createRunClusteringJobRequest.userContext
349393
validateModelSecrets = createRunClusteringJobRequest.validateModelSecrets
@@ -368,6 +412,22 @@ private constructor(
368412
this.attributeSchemas = attributeSchemas
369413
}
370414

415+
fun clusterModel(clusterModel: String?) = clusterModel(JsonField.ofNullable(clusterModel))
416+
417+
/** Alias for calling [Builder.clusterModel] with `clusterModel.orElse(null)`. */
418+
fun clusterModel(clusterModel: Optional<String>) = clusterModel(clusterModel.getOrNull())
419+
420+
/**
421+
* Sets [Builder.clusterModel] to an arbitrary JSON value.
422+
*
423+
* You should usually call [Builder.clusterModel] with a well-typed [String] value instead.
424+
* This method is primarily for setting the field to an undocumented or not yet supported
425+
* value.
426+
*/
427+
fun clusterModel(clusterModel: JsonField<String>) = apply {
428+
this.clusterModel = clusterModel
429+
}
430+
371431
fun configId(configId: String?) = configId(JsonField.ofNullable(configId))
372432

373433
/** Alias for calling [Builder.configId] with `configId.orElse(null)`. */
@@ -527,6 +587,22 @@ private constructor(
527587
*/
528588
fun startTime(startTime: JsonField<OffsetDateTime>) = apply { this.startTime = startTime }
529589

590+
fun summaryModel(summaryModel: String?) = summaryModel(JsonField.ofNullable(summaryModel))
591+
592+
/** Alias for calling [Builder.summaryModel] with `summaryModel.orElse(null)`. */
593+
fun summaryModel(summaryModel: Optional<String>) = summaryModel(summaryModel.getOrNull())
594+
595+
/**
596+
* Sets [Builder.summaryModel] to an arbitrary JSON value.
597+
*
598+
* You should usually call [Builder.summaryModel] with a well-typed [String] value instead.
599+
* This method is primarily for setting the field to an undocumented or not yet supported
600+
* value.
601+
*/
602+
fun summaryModel(summaryModel: JsonField<String>) = apply {
603+
this.summaryModel = summaryModel
604+
}
605+
530606
fun summaryPrompt(summaryPrompt: String?) =
531607
summaryPrompt(JsonField.ofNullable(summaryPrompt))
532608

@@ -602,6 +678,7 @@ private constructor(
602678
fun build(): CreateRunClusteringJobRequest =
603679
CreateRunClusteringJobRequest(
604680
attributeSchemas,
681+
clusterModel,
605682
configId,
606683
endTime,
607684
filter,
@@ -612,6 +689,7 @@ private constructor(
612689
partitions,
613690
sample,
614691
startTime,
692+
summaryModel,
615693
summaryPrompt,
616694
userContext,
617695
validateModelSecrets,
@@ -627,6 +705,7 @@ private constructor(
627705
}
628706

629707
attributeSchemas().ifPresent { it.validate() }
708+
clusterModel()
630709
configId()
631710
endTime()
632711
filter()
@@ -637,6 +716,7 @@ private constructor(
637716
partitions().ifPresent { it.validate() }
638717
sample()
639718
startTime()
719+
summaryModel()
640720
summaryPrompt()
641721
userContext().ifPresent { it.validate() }
642722
validateModelSecrets()
@@ -659,6 +739,7 @@ private constructor(
659739
@JvmSynthetic
660740
internal fun validity(): Int =
661741
(attributeSchemas.asKnown().getOrNull()?.validity() ?: 0) +
742+
(if (clusterModel.asKnown().isPresent) 1 else 0) +
662743
(if (configId.asKnown().isPresent) 1 else 0) +
663744
(if (endTime.asKnown().isPresent) 1 else 0) +
664745
(if (filter.asKnown().isPresent) 1 else 0) +
@@ -669,6 +750,7 @@ private constructor(
669750
(partitions.asKnown().getOrNull()?.validity() ?: 0) +
670751
(if (sample.asKnown().isPresent) 1 else 0) +
671752
(if (startTime.asKnown().isPresent) 1 else 0) +
753+
(if (summaryModel.asKnown().isPresent) 1 else 0) +
672754
(if (summaryPrompt.asKnown().isPresent) 1 else 0) +
673755
(userContext.asKnown().getOrNull()?.validity() ?: 0) +
674756
(if (validateModelSecrets.asKnown().isPresent) 1 else 0)
@@ -1104,6 +1186,7 @@ private constructor(
11041186

11051187
return other is CreateRunClusteringJobRequest &&
11061188
attributeSchemas == other.attributeSchemas &&
1189+
clusterModel == other.clusterModel &&
11071190
configId == other.configId &&
11081191
endTime == other.endTime &&
11091192
filter == other.filter &&
@@ -1114,6 +1197,7 @@ private constructor(
11141197
partitions == other.partitions &&
11151198
sample == other.sample &&
11161199
startTime == other.startTime &&
1200+
summaryModel == other.summaryModel &&
11171201
summaryPrompt == other.summaryPrompt &&
11181202
userContext == other.userContext &&
11191203
validateModelSecrets == other.validateModelSecrets &&
@@ -1123,6 +1207,7 @@ private constructor(
11231207
private val hashCode: Int by lazy {
11241208
Objects.hash(
11251209
attributeSchemas,
1210+
clusterModel,
11261211
configId,
11271212
endTime,
11281213
filter,
@@ -1133,6 +1218,7 @@ private constructor(
11331218
partitions,
11341219
sample,
11351220
startTime,
1221+
summaryModel,
11361222
summaryPrompt,
11371223
userContext,
11381224
validateModelSecrets,
@@ -1143,5 +1229,5 @@ private constructor(
11431229
override fun hashCode(): Int = hashCode
11441230

11451231
override fun toString() =
1146-
"CreateRunClusteringJobRequest{attributeSchemas=$attributeSchemas, configId=$configId, endTime=$endTime, filter=$filter, hierarchy=$hierarchy, lastNHours=$lastNHours, model=$model, name=$name, partitions=$partitions, sample=$sample, startTime=$startTime, summaryPrompt=$summaryPrompt, userContext=$userContext, validateModelSecrets=$validateModelSecrets, additionalProperties=$additionalProperties}"
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}"
11471233
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ internal class CreateRunClusteringJobRequestTest {
2121
.putAdditionalProperty("foo", JsonValue.from("bar"))
2222
.build()
2323
)
24+
.clusterModel("cluster_model")
2425
.configId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
2526
.endTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
2627
.filter("filter")
@@ -35,6 +36,7 @@ internal class CreateRunClusteringJobRequestTest {
3536
)
3637
.sample(0.0)
3738
.startTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
39+
.summaryModel("summary_model")
3840
.summaryPrompt("summary_prompt")
3941
.userContext(
4042
CreateRunClusteringJobRequest.UserContext.builder()
@@ -50,6 +52,7 @@ internal class CreateRunClusteringJobRequestTest {
5052
.putAdditionalProperty("foo", JsonValue.from("bar"))
5153
.build()
5254
)
55+
assertThat(createRunClusteringJobRequest.clusterModel()).contains("cluster_model")
5356
assertThat(createRunClusteringJobRequest.configId())
5457
.contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
5558
assertThat(createRunClusteringJobRequest.endTime())
@@ -69,6 +72,7 @@ internal class CreateRunClusteringJobRequestTest {
6972
assertThat(createRunClusteringJobRequest.sample()).contains(0.0)
7073
assertThat(createRunClusteringJobRequest.startTime())
7174
.contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
75+
assertThat(createRunClusteringJobRequest.summaryModel()).contains("summary_model")
7276
assertThat(createRunClusteringJobRequest.summaryPrompt()).contains("summary_prompt")
7377
assertThat(createRunClusteringJobRequest.userContext())
7478
.contains(
@@ -89,6 +93,7 @@ internal class CreateRunClusteringJobRequestTest {
8993
.putAdditionalProperty("foo", JsonValue.from("bar"))
9094
.build()
9195
)
96+
.clusterModel("cluster_model")
9297
.configId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
9398
.endTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
9499
.filter("filter")
@@ -103,6 +108,7 @@ internal class CreateRunClusteringJobRequestTest {
103108
)
104109
.sample(0.0)
105110
.startTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
111+
.summaryModel("summary_model")
106112
.summaryPrompt("summary_prompt")
107113
.userContext(
108114
CreateRunClusteringJobRequest.UserContext.builder()

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ internal class InsightCreateParamsTest {
2020
.putAdditionalProperty("foo", JsonValue.from("bar"))
2121
.build()
2222
)
23+
.clusterModel("cluster_model")
2324
.configId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
2425
.endTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
2526
.filter("filter")
@@ -34,6 +35,7 @@ internal class InsightCreateParamsTest {
3435
)
3536
.sample(0.0)
3637
.startTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
38+
.summaryModel("summary_model")
3739
.summaryPrompt("summary_prompt")
3840
.userContext(
3941
CreateRunClusteringJobRequest.UserContext.builder()
@@ -71,6 +73,7 @@ internal class InsightCreateParamsTest {
7173
.putAdditionalProperty("foo", JsonValue.from("bar"))
7274
.build()
7375
)
76+
.clusterModel("cluster_model")
7477
.configId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
7578
.endTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
7679
.filter("filter")
@@ -85,6 +88,7 @@ internal class InsightCreateParamsTest {
8588
)
8689
.sample(0.0)
8790
.startTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
91+
.summaryModel("summary_model")
8892
.summaryPrompt("summary_prompt")
8993
.userContext(
9094
CreateRunClusteringJobRequest.UserContext.builder()
@@ -106,6 +110,7 @@ internal class InsightCreateParamsTest {
106110
.putAdditionalProperty("foo", JsonValue.from("bar"))
107111
.build()
108112
)
113+
.clusterModel("cluster_model")
109114
.configId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
110115
.endTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
111116
.filter("filter")
@@ -120,6 +125,7 @@ internal class InsightCreateParamsTest {
120125
)
121126
.sample(0.0)
122127
.startTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
128+
.summaryModel("summary_model")
123129
.summaryPrompt("summary_prompt")
124130
.userContext(
125131
CreateRunClusteringJobRequest.UserContext.builder()

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ internal class InsightServiceAsyncTest {
4242
.putAdditionalProperty("foo", JsonValue.from("bar"))
4343
.build()
4444
)
45+
.clusterModel("cluster_model")
4546
.configId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
4647
.endTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
4748
.filter("filter")
@@ -56,6 +57,7 @@ internal class InsightServiceAsyncTest {
5657
)
5758
.sample(0.0)
5859
.startTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
60+
.summaryModel("summary_model")
5961
.summaryPrompt("summary_prompt")
6062
.userContext(
6163
CreateRunClusteringJobRequest.UserContext.builder()

0 commit comments

Comments
 (0)