LanceDb handles calculating embeddings on the way into the database – for bot…
LanceDb handles calculating embeddings on the way into the database – for both the query term, and the source material.
To take advantage of this using pydantic, you have to implement the following:
- Have a model that inherits from
LanceModel - Define an embedding function, ie:
- Use that embedding function as the provider of both your source, and embedding field type:
With this in place, you can pass your embedding model when you create your LanceDb table and the magic will happen automatically.