Replies: 2 comments
-
I ran into the same thing and found an interim workaround. You have to make async versions of BaseTracer, RootListenersTracer, and RunnableWithMessageHistory, but most of it’s just adding async await statements. I got it to work with a custom async MongoDB ChatMessageHistory class and haven’t had any issues…yet. See link below. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Yes. The idea would be to have all this built in LangChain and not have to rewrite everything async. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Checked
Feature request
Add async support to
Runnable.with_listeners
method.Currently it's only possible to attach Callables and not Coroutines.
Motivation
The current behavior is problematic when running in asyncio and the callback uses I/O as it will block the event loop.
For instance
RunnableWithMessageHistory
is configured withrunnable.with_listeners(on_end=self._exit_history)
and_exit_history
will in turn get messages fromBaseChatMessageHistory
in a synchronous way.Proposal (If applicable)
No response
Beta Was this translation helpful? Give feedback.
All reactions