Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support mustache type export to langchain from PromptClient #1801

Open
marcklingen opened this issue Apr 22, 2024 Discussed in #1774 · 1 comment
Open

feat: Support mustache type export to langchain from PromptClient #1801

marcklingen opened this issue Apr 22, 2024 Discussed in #1774 · 1 comment

Comments

@marcklingen
Copy link
Member

Discussed in https://github.com/orgs/langfuse/discussions/1774

Originally posted by maxjacu April 18, 2024

Describe the feature or potential improvement

Langchain as of recent supports (finally) mustache style variables {{var}}. Langfuse would have to implement some minor changes to export ChatPrompts correctly into that format.

ChatPromptClient
Was able to simplify conversion of get_langchain_prompt to [(msg["role"], msg["content"]) for msg in prompt].

TextPromptClient
Could just return the prompt, so no need for the helper function if mustache is used.

Additional information

No response

@marcklingen
Copy link
Member Author

@maxjacu is there an upside compared to the current implementation? downside here: langchain changed this recently, thus if we change this in langfuse sdk, this does not work if used with older langchain versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant