Langchain and AsyncIteratorCallbackHandler()
I am trying to wrap my head around Langchain and streaming content from an agent to the frontend token after token (to mitigate long response times). AsyncIteratorCallbackHandler() looked promising since it appears to create a queue of tokens I should be able to iterate through. I get a “TypeError: ‘async_generator’ object is not iterable” error however, and I’m not sure how to remedy the problem to bring about the solution I’m looking for: