@@ -4,9 +4,8 @@ import com.fasterxml.jackson.databind.ObjectMapper
44import com.langchain.smith.client.LangsmithClient
55import com.langchain.smith.client.okhttp.LangsmithOkHttpClient
66import com.langchain.smith.core.JsonValue
7- import com.langchain.smith.models.commits.CommitManifestResponse
7+ import com.langchain.smith.models.commits.CommitCreateParams
88import com.langchain.smith.models.commits.CommitRetrieveParams
9- import com.langchain.smith.models.commits.CommitUpdateParams
109import com.langchain.smith.models.repos.RepoCreateParams
1110import com.langchain.smith.models.repos.RepoListParams
1211import com.langchain.smith.models.repos.RepoWithLookups
@@ -101,10 +100,10 @@ fun main() {
101100 // Retrieve the manifest using "latest" as the commit hash
102101 val manifestResponse = client.commits()
103102 .retrieve(
104- " latest" ,
105103 CommitRetrieveParams .builder()
106- .owner(owner)
107- .repo(promptName)
104+ .owner(JsonValue .from(owner))
105+ .repo(JsonValue .from(promptName))
106+ .commit(JsonValue .from(" latest" ))
108107 .build()
109108 )
110109
@@ -295,10 +294,10 @@ private fun findPrompt(client: LangsmithClient, promptName: String): java.util.O
295294private fun hasLatestCommit (client : LangsmithClient , promptName : String , owner : String ): Boolean {
296295 return runCatching {
297296 client.commits().retrieve(
298- " latest" ,
299297 CommitRetrieveParams .builder()
300- .owner(owner)
301- .repo(promptName)
298+ .owner(JsonValue .from(owner))
299+ .repo(JsonValue .from(promptName))
300+ .commit(JsonValue .from(" latest" ))
302301 .build()
303302 )
304303 }.isSuccess
@@ -315,22 +314,23 @@ private fun createCommit(
315314 owner : String ,
316315 parentCommit : String?
317316): Boolean {
318- println (" 3. Adding prompt content using client.commits().update ()..." )
317+ println (" 3. Adding prompt content using client.commits().create ()..." )
319318 // Use the builder API - no need to know internal manifest structure
320319 val manifest = ChatPromptBuilder ()
321320 .systemMessage(" You are a helpful assistant that tells jokes." )
322321 .userMessage(" Tell me a joke about {topic}" )
323322 .inputVariables(" topic" )
324323 .build()
325324
326- val params = CommitUpdateParams .builder()
327- .owner(owner)
325+ val params = CommitCreateParams .builder()
326+ .owner(JsonValue .from(owner))
327+ .repo(JsonValue .from(promptName))
328328 .manifest(JsonValue .from(manifest))
329329 .apply { parentCommit?.let { parentCommit(it) } }
330330 .build()
331331
332332 return runCatching {
333- client.commits().update(promptName, params)
333+ client.commits().create( params)
334334 println (" ✓ Added prompt content as commit\n " )
335335 true
336336 }.getOrElse { e ->
0 commit comments