Replies: 3 comments 3 replies
-
I'm in a similar situation... I have my own override class for the langfuse callback with some modifications to get the observation id per generation. But is not pretty... basically I avoid clearing the "runs" dict and I collect the latest generation id. |
Beta Was this translation helpful? Give feedback.
-
Is there any news on that? I'm also interested in retrieving the observation id rather than the root trace id. |
Beta Was this translation helpful? Give feedback.
-
I managed to workaround this issue by also overriding the langfuse callback handler. Wrote a comment about it here. |
Beta Was this translation helpful? Give feedback.
-
I've been really struggling today to get something which I think should be obvious. Inside a langgraph node (inside any langchain runnable I believe), how do I get the current observation id?
Using
langfuse_context.get_current_observation_id()
returns the root trace id.I've worked around this by passing in a "run_id" to the langchain invoke call as both the run id and a configurable value, then inside the node I can get the langfuse handler from the langchain handlers and access the run by run id. This is quite hacky and it would be nice to access the observation id through the normal context method.
Beta Was this translation helpful? Give feedback.
All reactions