Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net MEVD: Consider removing copy constructor on VectorStoreRecordProperty #10366

Open
roji opened this issue Feb 1, 2025 · 2 comments
Open
Assignees
Labels
memory connector memory msft.ext.vectordata Related to Microsoft.Extensions.VectorData .NET Issue or Pull requests regarding .NET code sk team issue A tag to denote issues that where created by the Semantic Kernel team (i.e., not the community)

Comments

@roji
Copy link
Member

roji commented Feb 1, 2025

VectorStoreRecordDataProperty, VectorStoreRecordKeyProperty and VectorStoreRecordVectorProperty have copy constructors, which accept another instance of the same type to copy details from. However, since these types are all immutable (init-initializable only), it's hard to see what would be the use for these.

/cc @westey-m

@roji roji added memory memory connector msft.ext.vectordata Related to Microsoft.Extensions.VectorData labels Feb 1, 2025
@roji roji self-assigned this Feb 1, 2025
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code triage labels Feb 1, 2025
@westey-m
Copy link
Contributor

westey-m commented Feb 3, 2025

The idea was to allow anyone to make copies and just change one property instead of having to copy all. E.g. someone wants the same schema for three DBs, but each supports different distance functions. Everything else stays the same though.

var original = new VectorStoreRecordVectorProperty("DefinitionEmbedding", typeof(ReadOnlyMemory<float>)) { Dimensions = 1536, DistanceFunction = DistanceFunction.DotProductSimilarity };
var copy = new VectorStoreRecordVectorProperty(original) { DistanceFunction = DistanceFunction.CosineDistance };

@sphenry sphenry removed the triage label Feb 4, 2025
@roji
Copy link
Member Author

roji commented Feb 5, 2025

@westey-m thanks, I see... .NET doesn't usually do copy constructors much, and given that there simply aren't many things there, these may not actually be needed (plus they can always be added later). But I don't have very strong feelings on this.

@evchaki evchaki added the sk team issue A tag to denote issues that where created by the Semantic Kernel team (i.e., not the community) label Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
memory connector memory msft.ext.vectordata Related to Microsoft.Extensions.VectorData .NET Issue or Pull requests regarding .NET code sk team issue A tag to denote issues that where created by the Semantic Kernel team (i.e., not the community)
Projects
None yet
Development

No branches or pull requests

5 participants