Open abbottdev opened 1 month ago
Hi @abbottdev,
You're really supposed to have a IVectorizer<T>
actually do the work of embedding the T
in your Vector<T>
, so I'm not entirely sure why you would need a non-generic version of Vector, if you really did though, you could always just implement the abstract class and ignore the object, dropping your embedding directly into it's place.
@slorello89 - Thanks for the reply - It doesn't need to be non-generic, what I'm saying is that I'm working with structs
due to performance reasons I can keep allocations on the heap to a minimum that way - unfortunately as the type constraint on Vector<T>
has a class
constraint I'm unable to use it:
public sealed class Vector<T> : Vector, IEquatable<Vector<T>>
where T : class
I tried to implement the base abstract class, but unfortunately there is aObj
variable that's defined internally that I'm unable to override, which means I can't implement the base abstract class:
internal override object? Obj => Value;
Hi.
So I have some types which have their own precomputed embeddings, for example, a PDQ hash. I have implemented these data structures using
structs
in my code. I have no facility however to be able to use Redis OM for these types.I tried implementing a custom
Vector
(and re-implementVector<T>
) without the class constraint but there is an internal prop which I can't override due to it's accessibility.If I could re-use the existing
Vector<T>
without the class constraint, I can then build my own vectorizer attributes to extract the relevant embeddings as needed.