mirror of
https://github.com/langchain-ai/langserve.git
synced 2026-07-16 09:34:30 -04:00
How to check Langserve Rest API swagger for ConversationalRetrievalChain with memory. #8
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 @NageshMashette on GitHub (Oct 25, 2023).
memory = ConversationBufferWindowMemory(k=4, memory_key="chat_history", return_messages=True)
qa = ConversationalRetrievalChain.from_llm(
llm,
db.as_retriever(search_kwargs={"k": 3}),
memory=memory
)
I created RAG QA with ConversationalRetrievalChain with memory, and did
app = FastAPI()
from langserve import add_routes
add_routes(app, qa)
its executed and given api also swagger UI also available how to test and in which endpoint i need to pass user question to get the response.
@eyurtsev commented on GitHub (Oct 25, 2023):
Hi @NageshMashette,
localhost:800/docs. Check the examples directory to see client and server combinations. I suggest using the python RemoteRunnable client to interact with the server.@eyurtsev commented on GitHub (Oct 25, 2023):
Closing as this is not an issue but a question
@NageshMashette commented on GitHub (Oct 25, 2023):
https://github.com/langchain-ai/langserve/blob/main/examples/conversational_retrieval_chain/client.ipynb
without memory also im facing issue , i fallowed client code provided in example folder.
i used
**from langserve import RemoteRunnable
remote_runnable = RemoteRunnable("http://localhost:8000/")
await remote_runnable.ainvoke({"question": "Hi how are you?", "chat_history": ""})**
HTTPStatusError: Client error '404 Not Found' for url 'http://localhost:8000/invoke'
For more information check: https://httpstatuses.com/404 for {"detail":"Not Found"}
@murali-innerfit commented on GitHub (Oct 28, 2023):
faced same issue .After updating to latest version of langserve its started working for me.
@NageshMashette commented on GitHub (Oct 30, 2023):
are you able to execute with memory?
@navjotmakkar commented on GitHub (Feb 3, 2024):
Has anyone tried to combine conversation memory with langchain chain that is served using langserve?
@eyurtsev commented on GitHub (Feb 3, 2024):
I don't recommend using the old memory abstractions. Instead take a look at the examples in the readme there are examples that show how to handle conversation history including multi user support.
@NageshMashette commented on GitHub (Feb 6, 2024):
thanks @eyurtsev ok let me try it.