A prompt pulled from the LangSmith hub that can be invoked with input variables.
public class PromptA prompt pulled from the LangSmith hub that can be invoked with input variables. This is the primary object returned by [PromptClient.pull]. It wraps a parsed prompt manifest and provides an [invoke] method to format the prompt with variable values, producing a [PromptValue] that can then be converted to provider-specific formats using [convertToOpenAIParams] or [convertToAnthropicParams].
PromptClient promptClient = PromptClient.create(langsmithClient);
Prompt prompt = promptClient.pull("my-org/joke-generator");
PromptValue formattedPrompt = prompt.invoke(Map.of("topic", "cats"));
// OpenAI
ChatCompletion completion = openai.chat().completions().create(
convertToOpenAIParams(formattedPrompt)
.model(ChatModel.GPT_4_1_MINI)
.build());
// Anthropic
Message message = anthropic.messages().create(
convertToAnthropicParams(formattedPrompt)
.model(Model.CLAUDE_SONNET_4_6)
.maxTokens(1024)
.build());Returns true if this prompt includes a structured output schema..
Formats this prompt with the given input variables, producing a [PromptValue].
Formats this prompt with the given input variables, producing a [PromptValue].
Creates a [Prompt] directly from a list of messages.