From 0a0321efd75ca5ff7a5d725cb8efb9c126024768 Mon Sep 17 00:00:00 2001 From: Marces Engel Date: Mon, 1 Sep 2025 11:08:26 +0200 Subject: [PATCH] fix: support non-string content in message placeholders --- langfuse-core/src/prompts/promptClients.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/langfuse-core/src/prompts/promptClients.ts b/langfuse-core/src/prompts/promptClients.ts index d9d3c17a1..26f1352d8 100644 --- a/langfuse-core/src/prompts/promptClients.ts +++ b/langfuse-core/src/prompts/promptClients.ts @@ -235,7 +235,7 @@ export class ChatPromptClient extends BasePromptClient { } return messagesWithPlaceholdersReplaced.map((item) => { - if (typeof item === "object" && item !== null && "role" in item && "content" in item) { + if (typeof item === "object" && item !== null && "role" in item && "content" in item && typeof item.content === "string") { return { ...item, content: mustache.render(item.content, variables ?? {}),