How do I update my get_history() function to use langchain_postgres.PostgresChatMessageHistory instead of langchain_community? #32317
Unanswered
rjthegreatxx
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I’m updating a LangChain-based app to use the new langchain_postgres package instead of the deprecated langchain_community.chat_message_histories.
Previously, my function looked like this:
After switching from:
from langchain_community.chat_message_histories import PostgresChatMessageHistory
to:
from langchain_postgres import PostgresChatMessageHistory
…I get this warning in VSCode:
Expected 2 more positional arguments (Pylance reportCallIssue)
What I’ve Tried
I understand that the new PostgresChatMessageHistory requires more arguments, but I can’t find updated documentation or examples that clarify which ones are mandatory and what values to use for them.
Question
What is the correct way to rewrite my get_history() function to work with langchain_postgres.PostgresChatMessageHistory?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions