mirror of
https://github.com/langchain-ai/docs.git
synced 2026-08-27 02:41:59 -04:00
16 lines
630 B
Plaintext
16 lines
630 B
Plaintext
```java Java
|
|
import com.langchain.smith.client.LangsmithClient;
|
|
import com.langchain.smith.client.okhttp.LangsmithOkHttpClient;
|
|
import com.langchain.smith.prompts.Prompt;
|
|
import com.langchain.smith.prompts.PromptClient;
|
|
import com.langchain.smith.prompts.PromptValue;
|
|
import java.util.Map;
|
|
|
|
LangsmithClient client = LangsmithOkHttpClient.fromEnv();
|
|
PromptClient promptClient = PromptClient.create(client);
|
|
|
|
Prompt prompt = promptClient.pull("joke-generator");
|
|
PromptValue formattedPrompt = prompt.invoke(Map.of("topic", "cats"));
|
|
// Use formattedPrompt with your model provider — see "Use a prompt without LangChain" below.
|
|
```
|