Conversation with history in LangServe #286
-
Hi, everyone! Could you tell me if there is a way to build application with LangServe that can keep the context of conversation? It is not mentioned in official docs, and I did not find any examples. Is there a way to use RunnableWithMessageHistory in LangServe application? I will be grateful if some one give a link to an example of code. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
I found the discussion in issues. So I am waiting eyurtsev answer |
Beta Was this translation helpful? Give feedback.
-
Example is here: https://github.com/langchain-ai/langserve/pull/300/files It's reverted until a PR lands in langchain: If you're blocked on this, you can copy paste the updates to the RunnableWithMessageHistory into your own code base. I'll update this issue once relevant code has been merged and released |
Beta Was this translation helpful? Give feedback.
-
Example here: Using https://github.com/langchain-ai/langserve/tree/main/examples/chat_with_persistence Using https://github.com/langchain-ai/langserve/tree/main/examples/chat_with_persistence_and_user These require langchain_core >= 0.1.0 |
Beta Was this translation helpful? Give feedback.
Example here:
Using
session_id
passed via config:https://github.com/langchain-ai/langserve/tree/main/examples/chat_with_persistence
Using
conversation_id
and auser_id
. In this exampleuser_id
is lifted off a cookie, but you can swap with your own way of identifying the user (e.g., jwt)https://github.com/langchain-ai/langserve/tree/main/examples/chat_with_persistence_and_user
These require langchain_core >= 0.1.0