Open ishaan-mehta opened 1 month ago
@ishaan-mehta thanks for opening this issue. Have you used nest_asyncio?
In environments that already have an active event loop (like Databricks or Jupyter), attempting to create a new event loop can lead to conflicts. The nest_asyncio allows you to nest event loops safely.
Before invoking any asynchronous functions or methods, apply nest_asyncio. For example modify your main execution script as follows:
import nest_asyncio
nest_asyncio.apply()
@ishaan-mehta any update on this issue?
Hi @Pouyanpi, thanks for the response — unfortunately, this issue is not solved by running nest_asyncio.apply()
. It seems the issue lies with nemoguardrails
compatibility with openai
somewhere between openai
versions 1.45.0
and 1.54.3
(both of these are working, but I find that 1.50.0
, for example, is not).
I am consistently seeing this error when I try to invoke my LangChain chain which includes
RunnableRails
inside of an MLflow run:It happens whenever I invoke the model quickly in succession.
I am running inside a Databricks notebook (DBR 13.3 ML, 14.3 ML, 15.2 ML all don't work — haven't tried others).
This does not occur when I remove the guardrails from the chain, so it definitely related to this package. The guardrails are also hitting the same endpoint as the other LLM calls in the chain, so it is not an error on the LLM endpoint side. Also note that the root cause here is an event loop issue.
Here is my Python environment:
Full stack trace: