wagtail / wagtail-vector-index

Store Wagtail pages & Django models as embeddings in vector databases
https://wagtail-vector-index.readthedocs.io/en/latest/
MIT License
15 stars 10 forks source link

Create the `PageVectorIndexedMixin` class #41

Open mgax opened 7 months ago

mgax commented 7 months ago

It's an explicit way to include Wagtail-specific behaviour (i.e. use of PageVectorIndex instead of ModelVectorIndex) when defining a Page model. This also helps with type annotations for the return value of the get_vector_index() method.

mgax commented 7 months ago

I have this WIP patch to wagtail-vector-index lying around my repo since two weeks ago. It's a bit of a refactoring of the (page) model mixin class, to make typing easier, and make the code a bit more robust, but it introduces a breaking change. Not sure if it's worth pursuing, and I don't have bandwidth for it, so I've made it into a draft PR, in case somebody else finds it useful. If not, feel free to close it.