-
Notifications
You must be signed in to change notification settings - Fork 17.1k
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
No value was obtained for history.messages in RedisChatMessageHistory #30535
Comments
session_id="RAG_admin_ceshi-999" also does not work, you must remove the superfluous symbol RAGadminceshi999 |
Would appreciate a bug fix if you're able to do it! We also recommend that users transition to langgraph for memory use cases. We have a much more limited offering there of integrations, but the implementations generalize to things beyond just a message history. https://langchain-ai.github.io/langgraph/tutorials/introduction/ It's also much simpler to set up |
@1098842836 what is the version of |
Name: langchain-redis |
I'd be more than happy to fix this bug if the author would let me |
Checked other resources
Example Code
`from langchain_redis import RedisChatMessageHistory
from langchain_core.messages import AIMessage, HumanMessage
history = RedisChatMessageHistory(session_id="test002",
redis_url="redis://localhost:6379",
key_prefix="chat_test:",
)
Add messages to the history
history.add_user_message("Hello, AI assistant!")
history.add_ai_message("Hello! How can I assist you today?")
Retrieve messages
print("Chat History:")
for message in history.messages:
print(f"{type(message).name}: {message.content}")
(myenv) PS D:\java-project\RuoYi\Russ-AI-Python> d:; cd 'd:\java-project\RuoYi\Russ-AI-Python'; & 'd:\software\system-software\Anaconda\envs\myenv\python.exe' 'c:\Users\yl.cursor\extensions\ms-python.debugpy-2024.6.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher' '60479' '--' 'd:\java-project\RuoYi\Russ-AI-Python\src\test555.py'
Chat History:
As long as key_prefix is added for the first initialization, history.messages will not get any value`
Error Message and Stack Trace (if applicable)
No response
Description
As long as key_prefix is added for the first initialization, history.messages will not get any value
System Info
(myenv) PS D:\java-project\RuoYi\Russ-AI-Python> d:; cd 'd:\java-project\RuoYi\Russ-AI-Python'; & 'd:\software\system-software\Anaconda\envs\myenv\python.exe' 'c:\Users\yl.cursor\extensions\ms-python.debugpy-2024.6.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher' '60479' '--' 'd:\java-project\RuoYi\Russ-AI-Python\src\test555.py'
Chat History:
The text was updated successfully, but these errors were encountered: