Open nikithakriz opened 1 month ago
This is a bug. The config
parameter is not used properly. It needs to be fixed. Contributions are welcomed here!
Hi @nikithakriz have you checked this doc from langchain on using session id https://github.com/langchain-ai/langchain/blob/master/docs/docs/integrations/memory/mongodb_chat_message_history.ipynb . chat_history for session_id requires "session_id":
chain_with_history = RunnableWithMessageHistory(
chain,
lambda session_id: MongoDBChatMessageHistory(
session_id=session_id,
connection_string="mongodb://mongo_user:password123@mongo:27017",
database_name="my_db",
collection_name="chat_histories",
),
input_messages_key="question",
history_messages_key="history",
)
Hi @nikithakriz have you checked this doc from langchain on using session id https://github.com/langchain-ai/langchain/blob/master/docs/docs/integrations/memory/mongodb_chat_message_history.ipynb . chat_history for session_id requires "session_id":
chain_with_history = RunnableWithMessageHistory( chain, lambda session_id: MongoDBChatMessageHistory( session_id=session_id, connection_string="mongodb://mongo_user:password123@mongo:27017", database_name="my_db", collection_name="chat_histories", ), input_messages_key="question", history_messages_key="history", )
I am able to create chain with chat history without nemoguardrails, the error raising when integrating with nemoguardrails
@nikithakriz : can you test on the latest develop
branch and see if the issue is fixed? Thanks!
I am currently exploring the ways to integrate nemoguardrails to my existing RAG chatbot system.
Guardrail Script
RAG chain with message history
When i try to invoke this chain by following line of code
rag_with_guardrails .invoke( {"input": user_query}, config={"configurable": {"session_id": self.session_id}} )
It raises this error when i ask question which needs retrieval
for normal greeting query i got response like below:
{'output': 'Hello there!'}
So, how can i overcome the error and integrate RunnableWithMessageHistory and nemoguardrails together? am i missing something??