You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The langchain callbacks are very local and do not provide a lot of context to where it is being invoked [1]. You can only get a little bit of context about the location in the graph by decoding the metadata (which is something like {'thread_id': 10984505292623872, 'langgraph_step': 1, 'langgraph_node': 'agent', 'langgraph_triggers': ['start:agent'], 'langgraph_task_idx': 0, 'thread_ts': '1ef4f0e7-cb9b-647c-8000-005bd4c94b44', 'ls_provider': 'openai', 'ls_model_name': 'gpt-4o', 'ls_model_type': 'chat', 'ls_temperature': 0.7})
There are two specific types of callbacks that I want:
Callbacks which provide context of the whole state, langchain can only give me a list of messages
A callback for when a certain edge is called, so that I don't have to add those information in metadata and filter for them. (Btw it feels really hard to make config fields local to one invocation and not propagate to subsequent invokes)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
The langchain callbacks are very local and do not provide a lot of context to where it is being invoked [1]. You can only get a little bit of context about the location in the graph by decoding the metadata (which is something like
{'thread_id': 10984505292623872, 'langgraph_step': 1, 'langgraph_node': 'agent', 'langgraph_triggers': ['start:agent'], 'langgraph_task_idx': 0, 'thread_ts': '1ef4f0e7-cb9b-647c-8000-005bd4c94b44', 'ls_provider': 'openai', 'ls_model_name': 'gpt-4o', 'ls_model_type': 'chat', 'ls_temperature': 0.7}
)There are two specific types of callbacks that I want:
[1] https://api.python.langchain.com/en/latest/callbacks/langchain_core.callbacks.base.AsyncCallbackHandler.html#langchain_core.callbacks.base.AsyncCallbackHandler.on_chat_model_start
Beta Was this translation helpful? Give feedback.
All reactions