A fast and scalable app that adds vector search capabilities to your Django applications. It offers low latency, fast search results, native Django integration, and automatic syncing between your models and the vector index. Incremental updates are also supported out of the box.
The embedding function model.objects.embedding_fn is sometimes called with singular text of type str, but other times called with a list of str texts.
On line 80 of queryset.py, we have query_embeddings = self.model.objects.embedding_fn([text]), which will break the get_embedding function of the OpenAIEmbeddings class. You get an error with text = text.replace("\n", " ") because text is not a string but instead a list.
This change fixes this so that get_embedding is only called with type string.
The embedding function
model.objects.embedding_fn
is sometimes called with singular text of type str, but other times called with a list of strtexts
.On line 80 of
queryset.py
, we havequery_embeddings = self.model.objects.embedding_fn([text])
, which will break theget_embedding
function of theOpenAIEmbeddings
class. You get an error withtext = text.replace("\n", " ")
because text is not a string but instead a list.This change fixes this so that
get_embedding
is only called with type string.