langchain/libs/community/langchain_community/chat_message_histories
mackong 360a70c8a8
core[patch]: fix no current event loop for sql history in async mode (#22933)
- **Description:** When use
RunnableWithMessageHistory/SQLChatMessageHistory in async mode, we'll
get the following error:
```
Error in RootListenersTracer.on_chain_end callback: RuntimeError("There is no current event loop in thread 'asyncio_3'.")
```
which throwed by
ddfbca38df/libs/community/langchain_community/chat_message_histories/sql.py (L259).
and no message history will be add to database.

In this patch, a new _aexit_history function which will'be called in
async mode is added, and in turn aadd_messages will be called.

In this patch, we use `afunc` attribute of a Runnable to check if the
end listener should be run in async mode or not.

  - **Issue:** #22021, #22022 
  - **Dependencies:** N/A
2024-06-21 10:39:47 -04:00
..
__init__.py community: add KafkaChatMessageHistory (#22216) 2024-06-17 20:34:01 -07:00
astradb.py (all): update removal in deprecation warnings from 0.2 to 0.3 (#21265) 2024-05-03 14:29:36 -04:00
cassandra.py community[minor]: Add async methods to CassandraChatMessageHistory (#21975) 2024-05-23 10:13:05 -04:00
cosmos_db.py infra: rm unused # noqa violations (#22049) 2024-05-22 15:21:08 -07:00
dynamodb.py community[patch]: history size support for DynamoDBChatMessageHistory (#16794) 2024-03-29 18:56:21 +00:00
elasticsearch.py community[patch]: mypy ignore fix (#18483) 2024-03-28 15:36:53 -07:00
file.py core[patch],community[patch]: Move file chat history back to community (#20834) 2024-04-24 12:47:25 -04:00
firestore.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
in_memory.py core[minor],langchain[patch],community[patch]: Move InMemory and File implementations of Chat History to core (#20752) 2024-04-23 10:22:11 -04:00
kafka.py community: add KafkaChatMessageHistory (#22216) 2024-06-17 20:34:01 -07:00
momento.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
mongodb.py (all): update removal in deprecation warnings from 0.2 to 0.3 (#21265) 2024-05-03 14:29:36 -04:00
neo4j.py community[patch]: chat message history mypy fixes #17048 (#20114) 2024-05-06 22:17:45 +00:00
postgres.py docs: Fix URL formatting in deprecation warnings (#23075) 2024-06-18 14:49:58 -04:00
redis.py community[patch]: chat message history mypy fixes #17048 (#20114) 2024-05-06 22:17:45 +00:00
rocksetdb.py infra: add print rule to ruff (#16221) 2024-02-09 16:13:30 -08:00
singlestoredb.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
sql.py core[patch]: fix no current event loop for sql history in async mode (#22933) 2024-06-21 10:39:47 -04:00
streamlit.py community: Fix bug with StreamlitChatMessageHistory (#18834) 2024-03-09 13:42:22 -08:00
tidb.py community[patch]: chat message history mypy fixes (#17059) 2024-02-05 13:13:25 -08:00
upstash_redis.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
xata.py multiple: Remove unnecessary Ruff suppression comments (#21050) 2024-04-30 17:13:48 +00:00
zep_cloud.py community: docstrings (#23202) 2024-06-20 11:08:13 -04:00
zep.py docs: community docstring updates (#21040) 2024-04-29 17:40:23 -04:00