https://promptfoo.dev/ logo
Langfuse chat prompt
# ❓|questions
p
How can I add langfuse chat prompt using Langfuse integration? https://www.promptfoo.dev/docs/integrations/langfuse I'm experiencing error
[FAIL] TypeError: prompt.trim is not a function
. here's my YAML
Copy code
description: "My first eval"

prompts:
  - "langfuse://test-chat-prompt:2"

providers:
  - openai:gpt-3.5-turbo-0613
  - openai:gpt-4

tests:
  - vars:
      question: "Albert is a startup founder who is a member of YCombinator"
There's only system message in the prompt, 0 variables, I just want to add user message.
I tried to use the regular prompt from langfuse and it works, but I don't think it works for the chat prompt yet
i
Hmm yeah that could be the problem, I’ll look into it
p
I think I can fix it. Should I try opening PR?
Basically in recent version of Langfuse they added chat prompt. But in the
getPrompt
we output
getLangchainPrompt()
which for the
chat
type, it returns
ChatMessage[]
which doesn't have
.trim
method
maybe if we
JSON.stringify
the
ChatMessage[]
it'd work?
Seems like promptfoo assumes that the prompt will be
string
i
Ah thanks so much!
I’ll give it a review asap when I’m at my computer
p
@ian is it possible to release new version for the patch? thanks!
i
yes will do within a few hours!
p
Thank you @ian !
i
released in 0.58.1 🙂
p
@ian https://github.com/promptfoo/promptfoo/pull/779 new PR kinda related to langfuse. Do you need examples for this? I can add some to
examples/
doc.
m
nice stuff, thank you for improving langfuse integration
i
👀 thanks for the PR, will take a look