Agent Executor is not working as expected in streaming responses.
To be able to receive a streaming response, we need to convert an engine model to a langchain chat model using the to_langchain_chat_model() method and then initialize an agent using this model.
When calling the LLM using the agent executor astream_events() method, agent sends ‘on_chain_stream’ events when its supposed to send ‘on_chat_model_stream’ events.
This results in a not valid streaming response because its not sending chunks of streaming while being executed, instead, it returns a single chunk of data.