react agent with astream_events is very slow after the first response #2001
Unanswered
fatiiiiima
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.
-
I'm building a chatbot to chat with my SQL database. I followed this tutorial: https://python.langchain.com/docs/tutorials/sql_qa/, so I am using the pre built react agent from Langgraph. I am using astream_events to stream the responses. However, I have noticed that while the first response is always really fast (within 5 to 6 secs), any response after that is very slow (like over a minute). The reason why I went with streaming in the first place is because while using .invoke, my responses were slow too, so I wanted to build a better experience for the users. Has anyone faced a similar issue like this before?
Here is my code for reference:
I have not copied the prompt or the table names as I want to keep that private.
Beta Was this translation helpful? Give feedback.
All reactions