79178026

Date: 2024-11-11 14:31:09
Score: 0.5
Natty:
Report link

Well, I found the error to my own script. The difference between one script and the other are the following parameters in the connection to the PGVectore store:

    hnsw_kwargs={
    "hnsw_m": 16,
    "hnsw_ef_construction": 64,
    "hnsw_ef_search": 40,
    "hnsw_dist_method": "vector_cosine_ops",
},

This needs to be there so that the query to database is in the same format as it was being inserted (pretty obvious, isn't it?). When I was trying to add this, I was getting an error of the kind "PGVectorStore.from_params doesn't have any hnsw_kwargs parameters", so apparently I had two different set of functions with the same name. The problem was that I was using different PGVector packages in both scripts. When I was inserting I was using the legacy PGVector import and while querying I was using the core one which doesn't accept these parameters. That's the reason why I was getting the pydantic error.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: asemprini87