run-llama / sec-insights

A real world full-stack application using LlamaIndex
https://www.secinsights.ai/
MIT License
2.32k stars 631 forks source link

AttributeError: 'CustomPGVectorStore' object has no attribute '_async_session' #72

Closed shavejshaikh closed 10 months ago

shavejshaikh commented 10 months ago

image

While running a application getting attributeError

After set the value of _async_session getting below error image

sourabhdesai commented 10 months ago

@shavejshaikh I think you just need to update your fork to the latest code in this main repo. Your stacktrace shows the error coming from async with self._async_session() as session: on line 43 of pg_vector.py. As you can see in the latest code here, we've since added a call to self._initialize() that sets up these session variables. Let me know if that fixes your error!

shavejshaikh commented 10 months ago

@sourabhdesai After update pg_vector.pygetting error AttributeError: 'CustomPGVectorStore' object has no attribute '_initialize' image

shavejshaikh commented 10 months ago

@sourabhdesai , now getting DETAIL: Could not open extension control file "/usr/share/postgresql/16/extension/vector.control": No such file or directory. Created env using conda and install dependency using poetry image

Any idea ?

shavejshaikh commented 10 months ago

Found the solution since pgvector isn't install along with postgres (Ubuntu).

  1. Check postgres version postgres=# SHOW SERVER_VERSION; image

  2. Install pgvector based on above postgres version sudo apt install postgresql-16-pgvector Change 16 based on your postgres version