NotImplementedError: QAsyncioEventLoop.getaddrinfo() is not implemented yet
-
I was pointed to the QtAsyncio module to allow me to integrate asynchronous calls into my PyQt app.
I have a langgraph app that was working stand-alone, but when I port the code into an async method of my PyQt app, I get the error mentioned in the title.The offending code is this:
messages = await app.ainvoke(inputs)
ainvoke()
Is a standard langchain asynchronous function, and it worked when I ran the code in its own program before porting it to my PyQt app.
Can anybody please shed some light on this?
-
Yes, I also encountered that. Sadly, that's exactly what it means: PySide's asyncio event loop does not implement getaddrinfo: https://code.qt.io/cgit/pyside/pyside-setup.git/tree/sources/pyside6/PySide6/QtAsyncio/events.py#n552
In fact, none or almost none of the IO-related methods are implemented. Documentation also says that directly at https://doc.qt.io/qtforpython-6/PySide6/QtAsyncio/index.html:
We consider that this API consists of two levels:
- Fundamental infrastructure for event loops and asynchronous operations, including futures, tasks, handles, executors, and event loop management functions (see below).
- A user-facing API for use in applications, including transports and protocols, network connections, servers, sockets, signals, subprocesses.
QtAsyncio currently covers the first level.:
One solution is to use
trio
in guest mode, like in this example: https://doc.qt.io/qtforpython-6/examples/example_async_minimal.html. Except it will not help you, because LangChain does not support trio. There are a few libraries that implement a similar capability for asyncio, but none of them seem particularly mature.