The result of invoking a [Prompt] with input variables.
public class PromptValueThe result of invoking a [Prompt] with input variables.
A PromptValue holds the formatted messages (with variables substituted) and any structured
output schema from the original prompt. It is the input to the conversion functions
[convertToOpenAIParams] and [convertToAnthropicParams].
This is analogous to LangChain's ChatPromptValue — it represents a fully-resolved prompt ready
to be sent to a model provider.
Prompt prompt = promptClient.pull("my-org/joke-generator");
PromptValue formatted = prompt.invoke(Map.of("topic", "cats"));
// Inspect the messages
for (PromptMessage msg : formatted.getMessages()) {
System.out.println(msg.getRole() + ": " + msg.getTemplate());
}
// Convert to provider format
ChatCompletion completion = openai.chat().completions().create(
convertToOpenAIParams(formatted).model(ChatModel.GPT_4_1_MINI).build());