Skip to content

.Net: [MEVD] Throw for non-nullable embedding-generated vector properties without a setter #11740

@roji

Description

@roji

In #10492, we're adding the ability to map arbitrary properties to a data store vector property, via an IEmbeddingGenerator:

[VectorStoreRecordVector(Dimensions: 3)]
public string Description { get; set; }

Such properties aren't read back from the database (embeddings can't be converted back to their source input) - we through if Include Vectors is set to true.

To tighten things a bit, we could validate that such properties are nullable. However, these properties can also be getter-only, as follows:

[VectorStoreRecordData]
public string Description { get; set; }

[VectorStoreRecordVector(Dimensions: 3)]
public string DescriptionEmbedding => Description;

So we should do this only when there's a setter.

Metadata

Metadata

Assignees

Labels

.NETIssue or Pull requests regarding .NET codeBuildFeatures planned for next Build conferencemsft.ext.vectordataRelated to Microsoft.Extensions.VectorDatastaleIssue is stale because it has been open for a while and has no activity

Projects

Status

Backlog: Planned

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions