When events stucks in EventQueue (because of error on sending events to self-hosted Lunary service) they are modified after by still running and streaming agent. Error is caused by messages are added at langchain\agents\agent_iterator.py in function _return/a_return
returned_output["messages"] = output.messages
Solution: I think lunary.track_event should copy the output object to event making it read only
Exception:
TypeError('Object of type AIMessage is not JSON serializable
during sending events Lcel chain configuration: AgentExecutor agent tool Lunary version: 0.1.38 Langchain version: 0.1.6 Langchain-community: 0.0.19Error in sending json:
When events stucks in EventQueue (because of error on sending events to self-hosted Lunary service) they are modified after by still running and streaming agent. Error is caused by messages are added at
langchain\agents\agent_iterator.py
in function_return/a_return
Solution: I think
lunary.track_event
should copy the output object to event making it read only