CollectionModelBuilder class abstract

Builds a CollectionModel from a VectorStoreCollectionDefinition.

Subclass this and implement isDataPropertyTypeValid and isVectorPropertyTypeValid for each provider. Override customize to adjust the model after property processing, and validate / validateProperty to add provider-specific validation rules.

This is a support type for provider implementors; application code should not reference it directly.

Annotations
  • @Source(name: 'CollectionModelBuilder.cs', namespace: 'Microsoft.Extensions.VectorData.ProviderServices', repository: 'dotnet/extensions', path: 'src/Libraries/Microsoft.Extensions.VectorData.Abstractions/' 'ProviderServices/')

Constructors

CollectionModelBuilder(CollectionModelBuildingOptions options)
Creates a CollectionModelBuilder with the given options.

Properties

dataProperties List<DataPropertyModel>
The data properties accumulated during processProperty.
final
embeddingGenerationDispatchers List<EmbeddingGenerationDispatcher>
The dispatchers used to resolve embedding types and generate embeddings.
no setter
hashCode int
The hash code for this object.
no setterinherited
keyProperties List<KeyPropertyModel>
The key properties accumulated during processProperty.
final
options CollectionModelBuildingOptions
The options controlling model construction.
final
properties Iterable<PropertyModel>
All properties of all types.
no setter
propertyMap Map<String, PropertyModel>
All properties, indexed by their model name.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
vectorProperties List<VectorPropertyModel>
The vector properties accumulated during processProperty.
final

Methods

buildDynamic(VectorStoreCollectionDefinition definition, {EmbeddingGenerator? defaultEmbeddingGenerator}) CollectionModel
Builds a CollectionModel for dynamic record mapping (using Map<String, Object?> records) from definition.
customize() → void
Override to perform provider-specific model adjustments after all properties have been processed and before validation.
isDataPropertyTypeValid(Type type, {String? supportedTypes}) bool
Returns whether type is a valid type for a data property.
isVectorPropertyTypeValid(Type type, {String? supportedTypes}) bool
Returns whether type is a valid type for a vector property.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
processProperty(VectorStoreProperty definitionProperty) → void
Processes a single property from the definition, creating the appropriate PropertyModel subtype and adding it to the property lists.
supportsKeyAutoGeneration(Type keyPropertyType) bool
Returns whether the given keyPropertyType supports auto-generation.
toString() String
A string representation of this object.
inherited
validate(VectorStoreCollectionDefinition? definition) → void
Validates the fully built model.
validateProperty(PropertyModel propertyModel, VectorStoreCollectionDefinition? definition) → void
Validates a single propertyModel.

Operators

operator ==(Object other) bool
The equality operator.
inherited