WIP: adds text streaming to console, not working for API front end #3
+81
−22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a WIP for adding text streaming to the web interface and the console interface.
It is not ready for
main
, as text streaming to the console does not accommodate for Markdown format in the current state (it prints plaintext); and text streaming through flask has not been solved.Some resources:
https://langchain-ai.github.io/langgraph/how-tos/streaming-tokens/#streaming-llm-tokens
https://langchain-ai.github.io/langgraph/concepts/streaming/
langchain-ai/langchain#20124
https://flask.palletsprojects.com/en/stable/patterns/streaming/
Using an alternative API to Flask such as FastAPI or LangChain's LangServe (when it works with LangGraph) may be advisable for this objective.
Related issue: #4