Skip to content

Commit d99b42f

Browse files
fix: fix typing
1 parent 19b171e commit d99b42f

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

langsmith-java-example/src/main/kotlin/com/langchain/smith/example/PromptManagementExample.kt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ fun main() {
101101
val manifestResponse = client.commits()
102102
.retrieve(
103103
CommitRetrieveParams.builder()
104-
.owner(JsonValue.from(owner))
105-
.repo(JsonValue.from(promptName))
106-
.commit(JsonValue.from("latest"))
104+
.owner(owner)
105+
.repo(promptName)
106+
.commit("latest")
107107
.build()
108108
)
109109

@@ -295,9 +295,9 @@ private fun hasLatestCommit(client: LangsmithClient, promptName: String, owner:
295295
return runCatching {
296296
client.commits().retrieve(
297297
CommitRetrieveParams.builder()
298-
.owner(JsonValue.from(owner))
299-
.repo(JsonValue.from(promptName))
300-
.commit(JsonValue.from("latest"))
298+
.owner(owner)
299+
.repo(promptName)
300+
.commit("latest")
301301
.build()
302302
)
303303
}.isSuccess
@@ -312,7 +312,7 @@ private fun createCommit(
312312
client: LangsmithClient,
313313
promptName: String,
314314
owner: String,
315-
parentCommit: String?
315+
parentCommitHash: String?
316316
): Boolean {
317317
println("3. Adding prompt content using client.commits().create()...")
318318
// Use the builder API - no need to know internal manifest structure
@@ -322,12 +322,12 @@ private fun createCommit(
322322
.inputVariables("topic")
323323
.build()
324324

325-
val params = CommitCreateParams.builder()
326-
.owner(JsonValue.from(owner))
327-
.repo(JsonValue.from(promptName))
325+
val paramsBuilder = CommitCreateParams.builder()
326+
.owner(owner)
327+
.repo(promptName)
328328
.manifest(JsonValue.from(manifest))
329-
.apply { parentCommit?.let { parentCommit(it) } }
330-
.build()
329+
parentCommitHash?.let { paramsBuilder.parentCommit(it) }
330+
val params = paramsBuilder.build()
331331

332332
return runCatching {
333333
client.commits().create(params)

0 commit comments

Comments
 (0)