Skip to content

[MEVD] Expose an ability to make any VectorStoreDataProperty non-nullable #7770

Description

@adamsitnik

In C#, nullability of given property/field/argument is expressed by the compiler using metadata.

The POCO-collections describe specific type and have access to PropertyInfo, which provides not only type but also metadata info like attributes annotations.

The dynamic collections don’t have access to PropertyInfo so their members are always assumed to be nullable. This is by design and covered with tests.

We can’t workaround it by passing things like typeof(string?) as the compiler fails with:

Error (active)	CS8639	The typeof operator cannot be used on a nullable reference type

We should expose a new public API that would allow the users to make given property of a dynamic collection as non-nullable.

Example:

new VectorStoreDataProperty("document_id", typeof(string))
{
    IsNullable = false
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api-suggestionEarly API idea and discussion, it is NOT ready for implementationarea-mevduntriaged

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions