langchain/libs/core/langchain_core/runnables
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 core[patch]: fix chat history circular import (#23182) 2024-06-19 09:08:36 -07:00
base.py core[patch]: Fix doc-strings for code blocks (#23232) 2024-06-20 19:34:52 +00:00
branch.py [Enhancement] Add support for directly providing a run_id (#18990) 2024-03-18 15:03:04 -07:00
config.py core: run_in_executor: Wrap StopIteration in RuntimeError (#22997) 2024-06-17 20:40:01 +00:00
configurable.py core[patch[: docstring update (#21036) 2024-04-29 15:35:34 -04:00
fallbacks.py core[patch]: allow access RunnableWithFallbacks.runnable attrs (#22139) 2024-05-28 13:18:09 -07:00
graph_ascii.py infra: rm unused # noqa violations (#22049) 2024-05-22 15:21:08 -07:00
graph_mermaid.py core[minor]: handle boolean data in draw_mermaid (#23135) 2024-06-18 20:15:42 +00:00
graph_png.py core[minor]: handle boolean data in draw_mermaid (#23135) 2024-06-18 20:15:42 +00:00
graph.py core[minor]: handle boolean data in draw_mermaid (#23135) 2024-06-18 20:15:42 +00:00
history.py core[patch]: fix no current event loop for sql history in async mode (#22933) 2024-06-21 10:39:47 -04:00
learnable.py [Enhancement] Add support for directly providing a run_id (#18990) 2024-03-18 15:03:04 -07:00
passthrough.py core[patch[: docstring update (#21036) 2024-04-29 15:35:34 -04:00
retry.py core[patch]: docstring update (#16813) 2024-02-09 12:47:41 -08:00
router.py docs: Add docs for RouterRunnable (#19191) 2024-03-17 00:48:00 +00:00
schema.py core[minor]: Add parent_ids to astream_events API (#22563) 2024-06-06 16:14:28 -04:00
utils.py [Core] Check is async callable (#21714) 2024-05-15 10:49:49 -07:00