跳到主要内容
Open In ColabOpen on GitHub

SingleStoreDB

本笔记本介绍了如何使用 SingleStoreDB 存储聊天消息历史记录。

from langchain_community.chat_message_histories import (
SingleStoreDBChatMessageHistory,
)

history = SingleStoreDBChatMessageHistory(
session_id="foo", host="root:pass@localhost:3306/db"
)

history.add_user_message("hi!")

history.add_ai_message("whats up?")
history.messages
© . This site is unofficial and not affiliated with LangChain, Inc.
这些文档随着 LangChain v1.0 在 2025 年 10 月的发布而弃用,并且不再维护。 请访问 v1.0 文档