chainlit icon indicating copy to clipboard operation
chainlit copied to clipboard

Enhanced LangGraph Streaming Support & Documentation

Open JerePlum99 opened this issue 1 year ago • 0 comments
trafficstars

Is your feature request related to a problem? Please describe.

  • Utilizing LangGraph within Chainlit to stream events and the final response remains difficult and hard for users to implement. Moreover, current implementations appear to significantly decrease the responsiveness of LangGraph agent within the UI.
  • #801 Tackled part of the issue and the example implementation is useful, but I wouldn't count that as full support. As mentioned in that thread, I think this is relatively complex.

Describe the solution you'd like

  • A similar solution/demo as that provided for by Langroid for integration with Chainlit.
  • Tighter support and documentation around how to use astream_events to display events and stream the final response

Describe alternatives you've considered

  • There are workshopped solutions and a PR in the cookbook, but they are not easy to find and generally the cl.LangchainCallbackHandler does not seem to have clean support for streaming. It only streams if force_stream_final_answer=True.

Additional context

  • Example of speed inconsistency below - my actual LangGraph performs fine in a CLI or standalone, but consistently adds significant time when streamed in Chainlit image

JerePlum99 avatar Oct 02 '24 17:10 JerePlum99