-
Notifications
You must be signed in to change notification settings - Fork 76
upgrading from 0.0.6 -> 0.0.9, getting _async_engine not found #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Ran into the same issue when trying to deploy a chain containing a PGVector vectorstore using LangServe. Downgrading to 0.0.6 helped. |
Hi, If you actually want to use the async methods with latest version (0.0.9), you could use the following snippet, which uses from langchain_postgres import PGVector
from sqlalchemy.ext.asyncio import create_async_engine
connection_str = "postgresql+psycopg://[...]"
[...]
engine = create_async_engine(connection)
vectorstore = PGVector(
embeddings=embeddings,
collection_name=collection_name,
connection=engine,
use_jsonb=True,
) Best, |
LangServe is async by default. So if you're using langserve you should be creating an async engine. This is not a bug in the library -- just bad documentation |
While running this in Windows I encountered this exception.
Adding the correct EventLoopPolicy help resolving this. If it helps other below is the code snippet.
Found the solution here: |
Log signature:
_async_engine not found
error emerges from
langchain_postgres.vectorstores.PGVector.acreate_vector_extension
I'm trying to call
invoke()
, so I don't really understand why it's trying to use the async versionI'm going to downgrade back to 0.0.6 for now.
How I'm instantiating PGVector -
I tried updating the connection string so it used
postgresql+asyncpg://
instead ofpostgresql+psycopg://
but got a bunch of downstream errors related to module not found, then tried adding these dependencies to pyproject.toml:But at this point, when using langserve I'm not totally certain how to make it instantiate the async version.
Expected Behavior
ainvoke
and other methods use the async postgres connection, callinginvoke
uses the sync postgres connectionActual Behavior
The text was updated successfully, but these errors were encountered: