mirror of
https://github.com/langchain-ai/docs.git
synced 2026-08-27 21:00:00 -04:00
38 lines
996 B
Plaintext
38 lines
996 B
Plaintext
```java Java
|
|
import com.langchain.smith.client.LangsmithClient;
|
|
import com.langchain.smith.client.okhttp.LangsmithOkHttpClient;
|
|
import com.langchain.smith.core.JsonValue;
|
|
import com.langchain.smith.models.commits.CommitCreateParams;
|
|
import com.langchain.smith.models.repos.RepoCreateParams;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
LangsmithClient client = LangsmithOkHttpClient.fromEnv();
|
|
|
|
|
|
client.repos().create(
|
|
RepoCreateParams.builder()
|
|
.repoHandle("joke-generator")
|
|
.isPublic(false)
|
|
.build()
|
|
);
|
|
|
|
Map<String, Object> manifest = Map.of(
|
|
"lc", 1,
|
|
"type", "constructor",
|
|
"id", List.of("langchain_core", "prompts", "prompt", "PromptTemplate"),
|
|
"kwargs", Map.of(
|
|
"template", "tell me a joke about {topic}",
|
|
"input_variables", List.of("topic")
|
|
)
|
|
);
|
|
|
|
client.commits().create(
|
|
CommitCreateParams.builder()
|
|
.owner("-")
|
|
.repo("joke-generator")
|
|
.manifest(JsonValue.from(manifest))
|
|
.build()
|
|
);
|
|
```
|