Closed
Description
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
- https://github.com/deepset-ai/haystack-core-integrations/blob/61ac2f457c53697e8f906d9f44c39995a008f140/integrations/langfuse/src/haystack_integrations/components/connectors/langfuse/langfuse_connector.py#L108
self.tracer = LangfuseTracer(tracer=Langfuse(), name=name, public=public)
->tracer=Langfuse(httpx_client=httpx_client or httpx.Client(verify=os.getenv('LANGFUSE_PATH_TO_CERTIFICATE')))
- https://github.com/deepset-ai/haystack-core-integrations/blob/61ac2f457c53697e8f906d9f44c39995a008f140/integrations/langfuse/src/haystack_integrations/components/connectors/langfuse/langfuse_connector.py#L108` ->
def __init__(self, name: str, public: bool = False, httpx_client: Optional[httpx.Client] = None)
Thanks!
Metadata
Metadata
Assignees
Labels
No labels