langfuse / langfuse-python

🪢 Langfuse Python SDK - Instrument your LLM app with decorators or low-level SDK and get detailed tracing/observability. Works with any LLM or framework
https://langfuse.com/docs/sdk/python
MIT License
81 stars 86 forks source link

fix(langchain) python langchain retriever - parent run not found #925

Open Meteord opened 5 days ago

Meteord commented 5 days ago

if an langchain retriever is without a chain, no parent run can be found:

retriever =  vectorstore.as_retriever(...)
retriever.invoke(input=query, config={"callbacks": [langfuse_handler]})

In this case, no exception is thrown but a new parent trace generated.

fixes https://github.com/langfuse/langfuse/issues/3223

CLAassistant commented 5 days ago

CLA assistant check
All committers have signed the CLA.