langchain/docs/extras/integrations
Viktor Zhemchuzhnikov 507e46844e
Extend SQLChatMessageHistory (#9849)
### Description

There is a really nice class for saving chat messages into a database -
SQLChatMessageHistory.
It leverages SqlAlchemy to be compatible with any supported database (in
contrast with PostgresChatMessageHistory, which is basically the same
but is limited to Postgres).

However, the class is not really customizable in terms of what you can
store. I can imagine a lot of use cases, when one will need to save a
message date, along with some additional metadata.

To solve this, I propose to extract the converting logic from
BaseMessage to SQLAlchemy model (and vice versa) into a separate class -
message converter. So instead of rewriting the whole
SQLChatMessageHistory class, a user will only need to write a custom
model and a simple mapping class, and pass its instance as a parameter.

I also noticed that there is no documentation on this class, so I added
that too, with an example of custom message converter.

### Issue

N/A

### Dependencies

N/A

### Tag maintainer

Not yet

### Twitter handle

N/A
2023-09-03 15:49:53 -07:00
..
callbacks rm base64 images from docs (#10110) 2023-09-01 15:15:12 -07:00
chat feat: add bedrock chat model (#8017) 2023-09-01 13:16:57 -07:00
chat_loaders iMessage loader (#9832) 2023-08-28 13:43:59 -07:00
document_loaders Add parser and loader for Azure document intelligence service. (#10136) 2023-09-03 14:25:39 -07:00
document_transformers Added a pdf parser based on DocAI (#9579) 2023-08-24 21:44:49 -07:00
llms docs: fixed title in Bittensor example (#9893) 2023-09-03 15:10:42 -07:00
memory Extend SQLChatMessageHistory (#9849) 2023-09-03 15:49:53 -07:00
providers rm base64 images from docs (#10110) 2023-09-01 15:15:12 -07:00
retrievers Update google drive notebooks (#9851) 2023-08-28 19:29:35 -07:00
text_embedding EdenAI LLM update. Add models name option (#8963) 2023-09-01 12:11:33 -07:00
toolkits Add example of running Q&A over structured data using the Airbyte loaders and pandas (#10069) 2023-09-03 14:32:33 -07:00
tools Yahoo Finance News tool (#10014) 2023-09-03 14:43:57 -07:00
vectorstores implement vectorstores by tencent vectordb (#9989) 2023-08-31 00:48:25 -07:00