mirror of
https://github.com/langchain-ai/langserve.git
synced 2026-07-21 00:55:22 -04:00
How AgentExecutor in LCEL makes LLM streaming output in the final step #61
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @wangcailin on GitHub (Dec 8, 2023).
How can AgentExecutor in LCEL in the last step how to make LLM streaming output, my business logic is
Currently the business processes are all achievable, but the final answer cannot be streamed through astream, astream streams the steps of AgentExecutor, and what I want to achieve is to stream the LLM answer of the last step.
@eyurtsev Please help guide me on how to achieve this, thanks
@eyurtsev commented on GitHub (Dec 8, 2023):
This does not appear to be a langserve issue, but an LCEL question. Please let me know if i got that wrong.
Likely the issue is that the code is using RunnableLambda which does not preserve streaming capabilities. Instead use
RunnableGenerator