Find answers from the community

Updated 3 months ago

Hi! I'm stuck running the default

Hi! I'm stuck running the default notebook to run postgres vector store on llama-index.

https://docs.llamaindex.ai/en/stable/examples/vector_stores/postgres/#create-the-database

Ran the notebook both on colab and locally and got the following error. Any help fixing this would be great!
Plain Text
File ~/Documents/llama-index-postgres/.venv/lib/python3.11/site-packages/llama_index/vector_stores/postgres/base.py:236, in PGVectorStore.__init__(self, connection_string, async_connection_string, table_name, schema_name, hybrid_search, text_search_config, embed_dim, cache_ok, perform_setup, debug, use_jsonb, hnsw_kwargs, create_engine_kwargs)
    224 self._base = declarative_base()
    225 self._table_class = get_data_model(
    226     self._base,
    227     table_name,
   (...)
    233     use_jsonb=use_jsonb,
    234 )
--> 236 self.create_engine_kwargs = create_engine_kwargs or {}

File ~/Documents/llama-index-postgres/.venv/lib/python3.11/site-packages/pydantic/main.py:881, in BaseModel.__setattr__(self, name, value)
    878     self.__pydantic_validator__.validate_assignment(self, name, value)
    879 elif self.model_config.get('extra') != 'allow' and name not in self.model_fields:
    880     # TODO - matching error
--> 881     raise ValueError(f'"{self.__class__.__name__}" object has no field "{name}"')
    882 elif self.model_config.get('extra') == 'allow' and name not in self.model_fields:
    883     if self.model_extra and name in self.model_extra:

ValueError: "PGVectorStore" object has no field "create_engine_kwargs"
L
f
4 comments
Huh, weird, surprised this wasn't an issue sooner. Maybe related to your pydantic version?

In any case, this will fix it
https://github.com/run-llama/llama_index/pull/15961
Oh wow. Thanks for the super speedy fix!
Just merged it, it should publish in about 5 mins

you can run pip install -U llama-index-vector-stores-postgres to get the latest version then πŸ‘
Add a reply
Sign up and join the conversation on Discord