Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to check Langserve Rest API swagger for ConversationalRetrievalChain with memory. #96

Closed
NageshMashette opened this issue Oct 25, 2023 · 8 comments

Comments

@NageshMashette
Copy link

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.

@NageshMashette NageshMashette changed the title How to check Rest API swagger for ConversationalRetrievalChain with memory in invoke endpoint. How to check Langserve Rest API swagger for ConversationalRetrievalChain with memory. Oct 25, 2023
@eyurtsev
Copy link
Collaborator

Hi @NageshMashette,

  1. Docs are available here: 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.
  2. The chain that you've implementing will NOT work correctly for what I'd consider server use since it has a single global state for the memory that will be shared between all users. We'll be releasing more documentation on how to set this up in the upcoming 1-2 weeks.

@eyurtsev
Copy link
Collaborator

Closing as this is not an issue but a question

@NageshMashette
Copy link
Author

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
Copy link

faced same issue .After updating to latest version of langserve its started working for me.

@NageshMashette
Copy link
Author

faced same issue .After updating to latest version of langserve its started working for me.

are you able to execute with memory?

@navjotmakkar
Copy link

Has anyone tried to combine conversation memory with langchain chain that is served using langserve?

@eyurtsev
Copy link
Collaborator

eyurtsev commented 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
Copy link
Author

thanks @eyurtsev ok let me try it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants