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 token parameter to LangfuseConnector #1235

Open
Emil-io opened this issue Dec 9, 2024 · 2 comments
Open

Add token parameter to LangfuseConnector #1235

Emil-io opened this issue Dec 9, 2024 · 2 comments
Labels
feature request Ideas to improve an integration integration:langfuse P2

Comments

@Emil-io
Copy link

Emil-io commented Dec 9, 2024

Is your feature request related to a problem? Please describe.
Currently haystack supports Secrets. This is not consistent, with the LangfuseConnector. For this component, the keys and other settings (like host, ...) are set as environment variables. This does not align with they way one configures the OpenAIGenerator as an example.

Describe the solution you'd like
Update the init of the Langfuse Connector, so that it has all the parameters, which have to be set through environment variables as of now (auth keys, host, ...)

@Emil-io Emil-io added the feature request Ideas to improve an integration label Dec 9, 2024
@julian-risch
Copy link
Member

Hi @Emil-io just to double check: The three parameters we are talking about are LANGFUSE_SECRET_KEY, LANGFUSE_PUBLIC_KEY and LANGFUSE_HOST, correct? Any others? I assume LANGFUSE_RELEASE, LANGFUSE_THREADS aren't needed.

If it's just those, we should update the init of the LangfuseConnector to include

secret_key: Secret = Secret.from_env_var("LANGFUSE_SECRET_KEY"),
public_key: Secret = Secret.from_env_var("LANGFUSE_PUBLIC_KEY"),
host: Secret = Secret.from_env_var("LANGFUSE_HOST")

and then when we initialize Langfuse, we should pass the parameters:

self.tracer = LangfuseTracer(tracer=Langfuse(secret_key=secret_key, public_key=public_key, host=host), name=name, public=public)

based on https://langfuse.com/docs/sdk/python/low-level-sdk

@Emil-io
Copy link
Author

Emil-io commented Dec 10, 2024

@julian-risch Exactly. Maybe also a parameter, through which one can control this:

In addition, you need to set the HAYSTACK_CONTENT_TRACING_ENABLED environment variable to true in order to enable Haystack tracing in your pipeline. (https://docs.haystack.deepset.ai/reference/integrations-langfuse)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Ideas to improve an integration integration:langfuse P2
Projects
None yet
Development

No branches or pull requests

3 participants