Skip to content

Add httpx_client parameter in LangfuseConnector #279

Closed
@alex-stoica

Description

@alex-stoica

The current environment variables LANGFUSE_SECRET_KEY / LANGFUSE_API_KEY, LANGFUSE_PUBLIC_KEY, and LANGFUSE_HOST may not be sufficient for tracing in Langfuse.

For example, the following code:

tracer = Langfuse()
tracer.create_prompt(
    name="greeting-prompt",
    prompt="..."
)

might return an error:

...
ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed

However, this works correctly if the env variables are set correctly:

Langfuse(
    httpx_client=httpx.Client(verify=os.getenv('LANGFUSE_PATH_TO_CERTIFICATE'))
)

To address this, please update the wrapper in haystack_integrations.components.connectors.langfuse.LangfuseConnector to accept httpx_client as a parameter.
The code fix would only affect the lines

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions