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

Add prompt template from langfuse #2883

Merged

Conversation

cruz-lucas
Copy link
Contributor

I added a prompt component that fetches a prompt from LangFuse's repository.

The credentials come from the environment variables, that is, the variables LANGFUSE_SECRET_KEY, LANGFUSE_PUBLIC_KEY, LANGFUSE_HOST must be defined in the .env file in the packages/server/ directory.

The name of the prompt must be the exact name saved in the repository. The version of the prompt will be added in the future.

You can override the name of the template and variables like this:

import requests

API_URL = "api_url"


def query(payload):
    response = requests.post(API_URL, json=payload)
    return response.json()


output = query(
    {
        "question": "Hi, how are you?",
        "overrideConfig": {
            "template": "name_of_prompt",
            "promptValues": {
                "var1": "value1",
                "..."
            },
        },
    }
)

Copy link
Contributor

@HenryHengZJ HenryHengZJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @cruz-lucas !

@HenryHengZJ HenryHengZJ merged commit c7306c9 into FlowiseAI:main Aug 7, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants