Skip to content

LangfusePromptResponse

This docs was updated at: 2026-02-23

com.paragon.prompts.LangfusePromptResponse  ยท  Record


Response DTO for Langfuse prompt API.

Handles both "text" and "chat" prompt types from the Langfuse API.

Since: 1.0

Fields

TYPE_TEXT

public static final String TYPE_TEXT = "text"

Constant for text prompt type.


TYPE_CHAT

public static final String TYPE_CHAT = "chat"

Constant for chat prompt type.

Methods

isTextPrompt

public boolean isTextPrompt()

Returns whether this is a text prompt.

Returns

true if text prompt, false otherwise


isChatPrompt

public boolean isChatPrompt()

Returns whether this is a chat prompt.

Returns

true if chat prompt, false otherwise


getPromptContent

public @NonNull String getPromptContent()

Returns the prompt content as a string.

For text prompts, returns the prompt string directly. For chat prompts, concatenates all message contents with newlines.

Returns

the prompt content as a string


getChatMessages

public @NonNull List<ChatMessage> getChatMessages()

Returns the chat messages if this is a chat prompt.

Returns

list of chat messages, or empty list if not a chat prompt


isPlaceholder

public boolean isPlaceholder()

Returns whether this is a placeholder message.

Returns

true if placeholder, false otherwise