Make Python EventEncoder robust to non-JSONable fields (pluggable serializer / pre-serialize hook) #338
Unanswered
GinoLlerena
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When streaming AG-UI events from a LangGraph/LangChain backend, the Python encoder crashes if any non-JSON-serializable runtime object (e.g., langchain_core.callbacks.manager.AsyncCallbackManager) leaks into the event payload. The crash originates from the encoder calling event.model_dump_json(...), which is strict and fails on unknown types.
Beta Was this translation helpful? Give feedback.
All reactions