Skip to content

Commit 0c91488

Browse files
feat(api): api update
1 parent 63e0bdc commit 0c91488

11 files changed

Lines changed: 179 additions & 10 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-c8cfbe86e6def6ed237572671330ab268d0f4482ca206d46523a504d5202c78a.yml
3-
openapi_spec_hash: e3c416da737cb6f4fb8945ca8010443d
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/langsmith%2Flangsmith-api-4d7b0427f9ed66e112fcc2f2a3a91e7f2c8113eb6386910c48b52ef7a605b282.yml
3+
openapi_spec_hash: 601517cba6d1a4f06c494f42f11e3f96
44
config_hash: c217b34d458f1b65f260715693d447f9

langsmith-java-core/src/main/kotlin/com/langchain/smith/models/commits/CommitCreateParams.kt

Lines changed: 74 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ private constructor(
3636

3737
fun repo(): Optional<String> = Optional.ofNullable(repo)
3838

39+
/**
40+
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if the
41+
* server responded with an unexpected value).
42+
*/
43+
fun description(): Optional<String> = body.description()
44+
3945
/**
4046
* This arbitrary value can be deserialized into a custom type using the `convert` method:
4147
* ```java
@@ -61,6 +67,13 @@ private constructor(
6167
*/
6268
fun _skipWebhooks(): JsonValue = body._skipWebhooks()
6369

70+
/**
71+
* Returns the raw JSON value of [description].
72+
*
73+
* Unlike [description], this method doesn't throw if the JSON field has an unexpected type.
74+
*/
75+
fun _description(): JsonField<String> = body._description()
76+
6477
/**
6578
* Returns the raw JSON value of [parentCommit].
6679
*
@@ -121,12 +134,24 @@ private constructor(
121134
*
122135
* This is generally only useful if you are already constructing the body separately.
123136
* Otherwise, it's more convenient to use the top-level setters instead:
137+
* - [description]
124138
* - [manifest]
125139
* - [parentCommit]
126140
* - [skipWebhooks]
127141
*/
128142
fun body(body: Body) = apply { this.body = body.toBuilder() }
129143

144+
fun description(description: String) = apply { body.description(description) }
145+
146+
/**
147+
* Sets [Builder.description] to an arbitrary JSON value.
148+
*
149+
* You should usually call [Builder.description] with a well-typed [String] value instead.
150+
* This method is primarily for setting the field to an undocumented or not yet supported
151+
* value.
152+
*/
153+
fun description(description: JsonField<String>) = apply { body.description(description) }
154+
130155
fun manifest(manifest: JsonValue) = apply { body.manifest(manifest) }
131156

132157
fun parentCommit(parentCommit: String) = apply { body.parentCommit(parentCommit) }
@@ -303,6 +328,7 @@ private constructor(
303328
class Body
304329
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
305330
private constructor(
331+
private val description: JsonField<String>,
306332
private val manifest: JsonValue,
307333
private val parentCommit: JsonField<String>,
308334
private val skipWebhooks: JsonValue,
@@ -311,14 +337,23 @@ private constructor(
311337

312338
@JsonCreator
313339
private constructor(
340+
@JsonProperty("description")
341+
@ExcludeMissing
342+
description: JsonField<String> = JsonMissing.of(),
314343
@JsonProperty("manifest") @ExcludeMissing manifest: JsonValue = JsonMissing.of(),
315344
@JsonProperty("parent_commit")
316345
@ExcludeMissing
317346
parentCommit: JsonField<String> = JsonMissing.of(),
318347
@JsonProperty("skip_webhooks")
319348
@ExcludeMissing
320349
skipWebhooks: JsonValue = JsonMissing.of(),
321-
) : this(manifest, parentCommit, skipWebhooks, mutableMapOf())
350+
) : this(description, manifest, parentCommit, skipWebhooks, mutableMapOf())
351+
352+
/**
353+
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if
354+
* the server responded with an unexpected value).
355+
*/
356+
fun description(): Optional<String> = description.getOptional("description")
322357

323358
/**
324359
* This arbitrary value can be deserialized into a custom type using the `convert` method:
@@ -345,6 +380,15 @@ private constructor(
345380
*/
346381
@JsonProperty("skip_webhooks") @ExcludeMissing fun _skipWebhooks(): JsonValue = skipWebhooks
347382

383+
/**
384+
* Returns the raw JSON value of [description].
385+
*
386+
* Unlike [description], this method doesn't throw if the JSON field has an unexpected type.
387+
*/
388+
@JsonProperty("description")
389+
@ExcludeMissing
390+
fun _description(): JsonField<String> = description
391+
348392
/**
349393
* Returns the raw JSON value of [parentCommit].
350394
*
@@ -376,19 +420,34 @@ private constructor(
376420
/** A builder for [Body]. */
377421
class Builder internal constructor() {
378422

423+
private var description: JsonField<String> = JsonMissing.of()
379424
private var manifest: JsonValue = JsonMissing.of()
380425
private var parentCommit: JsonField<String> = JsonMissing.of()
381426
private var skipWebhooks: JsonValue = JsonMissing.of()
382427
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
383428

384429
@JvmSynthetic
385430
internal fun from(body: Body) = apply {
431+
description = body.description
386432
manifest = body.manifest
387433
parentCommit = body.parentCommit
388434
skipWebhooks = body.skipWebhooks
389435
additionalProperties = body.additionalProperties.toMutableMap()
390436
}
391437

438+
fun description(description: String) = description(JsonField.of(description))
439+
440+
/**
441+
* Sets [Builder.description] to an arbitrary JSON value.
442+
*
443+
* You should usually call [Builder.description] with a well-typed [String] value
444+
* instead. This method is primarily for setting the field to an undocumented or not yet
445+
* supported value.
446+
*/
447+
fun description(description: JsonField<String>) = apply {
448+
this.description = description
449+
}
450+
392451
fun manifest(manifest: JsonValue) = apply { this.manifest = manifest }
393452

394453
fun parentCommit(parentCommit: String) = parentCommit(JsonField.of(parentCommit))
@@ -435,7 +494,13 @@ private constructor(
435494
* Further updates to this [Builder] will not mutate the returned instance.
436495
*/
437496
fun build(): Body =
438-
Body(manifest, parentCommit, skipWebhooks, additionalProperties.toMutableMap())
497+
Body(
498+
description,
499+
manifest,
500+
parentCommit,
501+
skipWebhooks,
502+
additionalProperties.toMutableMap(),
503+
)
439504
}
440505

441506
private var validated: Boolean = false
@@ -445,6 +510,7 @@ private constructor(
445510
return@apply
446511
}
447512

513+
description()
448514
parentCommit()
449515
validated = true
450516
}
@@ -464,28 +530,31 @@ private constructor(
464530
* Used for best match union deserialization.
465531
*/
466532
@JvmSynthetic
467-
internal fun validity(): Int = (if (parentCommit.asKnown().isPresent) 1 else 0)
533+
internal fun validity(): Int =
534+
(if (description.asKnown().isPresent) 1 else 0) +
535+
(if (parentCommit.asKnown().isPresent) 1 else 0)
468536

469537
override fun equals(other: Any?): Boolean {
470538
if (this === other) {
471539
return true
472540
}
473541

474542
return other is Body &&
543+
description == other.description &&
475544
manifest == other.manifest &&
476545
parentCommit == other.parentCommit &&
477546
skipWebhooks == other.skipWebhooks &&
478547
additionalProperties == other.additionalProperties
479548
}
480549

481550
private val hashCode: Int by lazy {
482-
Objects.hash(manifest, parentCommit, skipWebhooks, additionalProperties)
551+
Objects.hash(description, manifest, parentCommit, skipWebhooks, additionalProperties)
483552
}
484553

485554
override fun hashCode(): Int = hashCode
486555

487556
override fun toString() =
488-
"Body{manifest=$manifest, parentCommit=$parentCommit, skipWebhooks=$skipWebhooks, additionalProperties=$additionalProperties}"
557+
"Body{description=$description, manifest=$manifest, parentCommit=$parentCommit, skipWebhooks=$skipWebhooks, additionalProperties=$additionalProperties}"
489558
}
490559

491560
override fun equals(other: Any?): Boolean {

langsmith-java-core/src/main/kotlin/com/langchain/smith/models/commits/CommitRetrieveResponse.kt

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class CommitRetrieveResponse
2222
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
2323
private constructor(
2424
private val commitHash: JsonField<String>,
25+
private val description: JsonField<String>,
2526
private val examples: JsonField<List<Example>>,
2627
private val isDraft: JsonField<Boolean>,
2728
private val manifest: JsonValue,
@@ -35,6 +36,9 @@ private constructor(
3536
@JsonProperty("commit_hash")
3637
@ExcludeMissing
3738
commitHash: JsonField<String> = JsonMissing.of(),
39+
@JsonProperty("description")
40+
@ExcludeMissing
41+
description: JsonField<String> = JsonMissing.of(),
3842
@JsonProperty("examples")
3943
@ExcludeMissing
4044
examples: JsonField<List<Example>> = JsonMissing.of(),
@@ -44,14 +48,29 @@ private constructor(
4448
@JsonProperty("model_provider")
4549
@ExcludeMissing
4650
modelProvider: JsonField<String> = JsonMissing.of(),
47-
) : this(commitHash, examples, isDraft, manifest, modelConfig, modelProvider, mutableMapOf())
51+
) : this(
52+
commitHash,
53+
description,
54+
examples,
55+
isDraft,
56+
manifest,
57+
modelConfig,
58+
modelProvider,
59+
mutableMapOf(),
60+
)
4861

4962
/**
5063
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if the
5164
* server responded with an unexpected value).
5265
*/
5366
fun commitHash(): Optional<String> = commitHash.getOptional("commit_hash")
5467

68+
/**
69+
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if the
70+
* server responded with an unexpected value).
71+
*/
72+
fun description(): Optional<String> = description.getOptional("description")
73+
5574
/**
5675
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if the
5776
* server responded with an unexpected value).
@@ -93,6 +112,13 @@ private constructor(
93112
*/
94113
@JsonProperty("commit_hash") @ExcludeMissing fun _commitHash(): JsonField<String> = commitHash
95114

115+
/**
116+
* Returns the raw JSON value of [description].
117+
*
118+
* Unlike [description], this method doesn't throw if the JSON field has an unexpected type.
119+
*/
120+
@JsonProperty("description") @ExcludeMissing fun _description(): JsonField<String> = description
121+
96122
/**
97123
* Returns the raw JSON value of [examples].
98124
*
@@ -138,6 +164,7 @@ private constructor(
138164
class Builder internal constructor() {
139165

140166
private var commitHash: JsonField<String> = JsonMissing.of()
167+
private var description: JsonField<String> = JsonMissing.of()
141168
private var examples: JsonField<MutableList<Example>>? = null
142169
private var isDraft: JsonField<Boolean> = JsonMissing.of()
143170
private var manifest: JsonValue = JsonMissing.of()
@@ -148,6 +175,7 @@ private constructor(
148175
@JvmSynthetic
149176
internal fun from(commitRetrieveResponse: CommitRetrieveResponse) = apply {
150177
commitHash = commitRetrieveResponse.commitHash
178+
description = commitRetrieveResponse.description
151179
examples = commitRetrieveResponse.examples.map { it.toMutableList() }
152180
isDraft = commitRetrieveResponse.isDraft
153181
manifest = commitRetrieveResponse.manifest
@@ -167,6 +195,17 @@ private constructor(
167195
*/
168196
fun commitHash(commitHash: JsonField<String>) = apply { this.commitHash = commitHash }
169197

198+
fun description(description: String) = description(JsonField.of(description))
199+
200+
/**
201+
* Sets [Builder.description] to an arbitrary JSON value.
202+
*
203+
* You should usually call [Builder.description] with a well-typed [String] value instead.
204+
* This method is primarily for setting the field to an undocumented or not yet supported
205+
* value.
206+
*/
207+
fun description(description: JsonField<String>) = apply { this.description = description }
208+
170209
fun examples(examples: List<Example>) = examples(JsonField.of(examples))
171210

172211
/**
@@ -246,6 +285,7 @@ private constructor(
246285
fun build(): CommitRetrieveResponse =
247286
CommitRetrieveResponse(
248287
commitHash,
288+
description,
249289
(examples ?: JsonMissing.of()).map { it.toImmutable() },
250290
isDraft,
251291
manifest,
@@ -263,6 +303,7 @@ private constructor(
263303
}
264304

265305
commitHash()
306+
description()
266307
examples().ifPresent { it.forEach { it.validate() } }
267308
isDraft()
268309
modelProvider()
@@ -285,6 +326,7 @@ private constructor(
285326
@JvmSynthetic
286327
internal fun validity(): Int =
287328
(if (commitHash.asKnown().isPresent) 1 else 0) +
329+
(if (description.asKnown().isPresent) 1 else 0) +
288330
(examples.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
289331
(if (isDraft.asKnown().isPresent) 1 else 0) +
290332
(if (modelProvider.asKnown().isPresent) 1 else 0)
@@ -542,6 +584,7 @@ private constructor(
542584

543585
return other is CommitRetrieveResponse &&
544586
commitHash == other.commitHash &&
587+
description == other.description &&
545588
examples == other.examples &&
546589
isDraft == other.isDraft &&
547590
manifest == other.manifest &&
@@ -553,6 +596,7 @@ private constructor(
553596
private val hashCode: Int by lazy {
554597
Objects.hash(
555598
commitHash,
599+
description,
556600
examples,
557601
isDraft,
558602
manifest,
@@ -565,5 +609,5 @@ private constructor(
565609
override fun hashCode(): Int = hashCode
566610

567611
override fun toString() =
568-
"CommitRetrieveResponse{commitHash=$commitHash, examples=$examples, isDraft=$isDraft, manifest=$manifest, modelConfig=$modelConfig, modelProvider=$modelProvider, additionalProperties=$additionalProperties}"
612+
"CommitRetrieveResponse{commitHash=$commitHash, description=$description, examples=$examples, isDraft=$isDraft, manifest=$manifest, modelConfig=$modelConfig, modelProvider=$modelProvider, additionalProperties=$additionalProperties}"
569613
}

0 commit comments

Comments
 (0)