-
Is there a way to obtain the graph state when handling the
Thank you! |
Beta Was this translation helpful? Give feedback.
Answered by
hinthornw
Jun 14, 2024
Replies: 2 comments 1 reply
-
If I were doing this, I would fetch the state from the last checkpoint: graph = builder.compile(checkpointer=...)
config = {"configurable": {"thread_id": "abcd123"}}
try:
res = self.graph.invoke({"query": query}, config={"recursion_limit": 1, **config})
except GraphRecursionError:
# I want to read the state here
logger.exception(f"The invocation to graph reached the recursion limit")
state = self.graph.get_state(config) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
balvisio
-
Are there any other way w/o using checkpoint? I don't want to implement a checkpointer but just want to log the messages to my error tracker when error occurs. Including the last state in the exception object might be a better idea. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If I were doing this, I would fetch the state from the last checkpoint: