mirror of
https://github.com/langchain-ai/langserve.git
synced 2026-07-18 10:54:29 -04:00
How to do Human in Loop in /stream Endpoint #66
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 @wolvever on GitHub (Dec 12, 2023).
LangServe can stream output using
/streamEndpoint. However, if I want to send an event and wait for human feedback, wait for a parameter value or confirm, for example. It seems impossible to use SSE only. Users have to do some conversation keeping and implement coversations in two functions, one returns an generator, save conversation to cache and load them in another request handler.Is there any demo to implement SSE and Human in Loop at the same time. If not, how do we implement that without websockets.
@eyurtsev commented on GitHub (Dec 12, 2023):
We can't do it with the
streamingendpoint right now since that's just one way communication from server to client.Right now, the way to achieve this is by issuing a new request for every human in the loop action.
Options are either:
Also more context will be super helpful in terms of expanding support in langserve/langchain: