You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Any object that implements the trait Embedabble can be added to the embeddings builder and therefore can be embedded.
Motivation
Currently, embeddings builder is tightly coupled with the DocumentEmbedding type (only objects of this type can be used by the builder). Downsides: user needs to type cast their types to DocumentEmbedding and the structure of DocumentEmbedding is predetermined so the user needs to design their embedding code around this.
Proposal
Define the trait Embedabble which contains a method fn embedabble() which returns a list of strings (the strings that should be embedded).
Change the EmbeddingsBuilder to accept any type that implements the trait Embedabble.
Write a custom derive macro that can be used on any struct which derives the Embedabble trait automatically.
Feature Request
Any object that implements the trait
Embedabble
can be added to the embeddings builder and therefore can be embedded.Motivation
Currently, embeddings builder is tightly coupled with the
DocumentEmbedding
type (only objects of this type can be used by the builder). Downsides: user needs to type cast their types toDocumentEmbedding
and the structure ofDocumentEmbedding
is predetermined so the user needs to design their embedding code around this.Proposal
Embedabble
which contains a methodfn embedabble()
which returns a list of strings (the strings that should be embedded).EmbeddingsBuilder
to accept any type that implements the traitEmbedabble
.Embedabble
trait automatically.Linked issues:
#60
#61
#62
Todo:
Give trait and macro same name like serde
implement Embeddable trait for many primitive types
macro fails when there are no embed tags
macro fails when embed with is empty string
need to handle error in custom embed function
review borrow and owning eveywhere. done for embeddings.rs
update docstrings. done for embeddings.rs
clean up embedding builder definition with traits maybe?
should build() return
Embedding
object or just string? returnEmbedding
object - document string used for debuggingin memory vector store, rethink type of document D --> move to another branch
why is vector search of in memory vector store so bad? bug found
in memory store - implement from trait from both returns types of build into add_document
tests
make macro as feature flag
The text was updated successfully, but these errors were encountered: