-
Notifications
You must be signed in to change notification settings - Fork 382
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
bug: async calling of LangGraph with a LangFuse callback does not log the model invocations (Python client) #1926
Comments
Thanks for reporting this, we need to look into what causes this as ainvoke works for non-langgraph. Happy to support if you want to contribute to this fix |
do you get any error logs from the sdk? |
I am not seeing any errors on normal verbosity, but let me try to increase that, maybe then something will visible |
I ran it again with the langfuse logs set to DEBUG. Simply when making the Debug logs when running sync:
When running async, that whole section (where you have the
|
Describe the bug
I am implementing the a ReAct agent in LangGraph (see https://github.com/roboticsocialism/langgraph_demo/blob/main/langgraph_demo.py) and use LangFuse for callbacks.
When I call the created LangGraph compiled graph with
app.invoke(inputs, config={"callbacks": [langfuse_handler]})
then it properly register in LangFuse the model invocations part of the ReAct chain, but when I replace that call to be async (await app.ainvoke(inputs, config={"callbacks": [langfuse_handler]})
then the model invocations are no longer logged in LangFuse.Trace when called sync (
app.invoke(inputs, config={"callbacks": [langfuse_handler]})
):Trace when the same compiled graph is called async (
await app.ainvoke(inputs, config={"callbacks": [langfuse_handler]})
):To reproduce
Implement a ReAct graph in LangGraph (https://github.com/roboticsocialism/langgraph_demo/blob/main/langgraph_demo.py) and add LangFuse as callback to the invocation.
Try out both with the sync and async invocation and observe the difference in tracing in LangFuse.
Additional information
langgraph v0.0.39
langfuse Python client v2.27.3
Note: I am not sure whether should I have posted this against the Python SDK (https://github.com/langfuse/langfuse-python)?
The text was updated successfully, but these errors were encountered: