Enable images in prompt placeholders #9435
Replies: 3 comments 7 replies
-
|
Hi @VildMedPap - do I understand you correctly that your chat prompt has a placeholder declared at which point you'd like to insert a chat message that includes a |
Beta Was this translation helpful? Give feedback.
-
|
+1 Here's a snippet from the TS sdk that would be great if it can be implement. Currently, it's returning a mustache#render error, so I suspect it would be a fairly easy fix. Desired outcome: const chatPrompt = await langfuse.prompt.get('email-inbox/chat');
const attachments = [{
role: 'user',
content: [{
type: 'input_file',
file_url: 'path_to_pdf',
}]
}];
const input = chatPrompt.compile({ emailBody: '...' }, { attachments });
console.log('input :', input);throws |
Beta Was this translation helpful? Give feedback.
-
|
+1 this feature would be deeply appreciated. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the feature or potential improvement
Currently, the Message Placeholders in Chat Prompts feature only supports pure text content. This prevents developers from fully using the chat prompt templates when working with multimodal models.
Right now, if you want to include images along side the user text input, you can’t rely on Langfuse’s chat templates. Instead, you must fall back to text-only prompt templates and reconstruct the entire chat history and combine with the system prompt. This defeats the purpose of having rich chat templates, reduces maintainability, and makes it more cumbersome to test.
Supporting images in placeholders would allow more flexible and realistic prompt templates for use cases like:
Current limitation (works fine with text):
Attempting to include an image fails because placeholders cannot handle the
contentkey being a list:Extend message placeholders to support multimodal content (at least images) alongside text, following the same array-of-blocks structure used in OpenAI/Anthropic APIs.
This would allow developers to use chat templates as intended, rather than being pushed into text-only templates when working with multimodal inputs.
Additional information
No response
Beta Was this translation helpful? Give feedback.
All reactions