36 references to Type
Microsoft.Extensions.VectorData.Abstractions (36)
ProviderServices\CollectionModel.cs (2)
77
EmbeddingGenerationRequired = vectorProperties.Any(p => p.EmbeddingType != p.
Type
);
166
.Where(l => l.
Type
== typeof(string) && l.IsFullTextIndexed)
ProviderServices\CollectionModelBuilder.cs (16)
128
if ((Nullable.GetUnderlyingType(clrPropertyType) ?? clrPropertyType) != (Nullable.GetUnderlyingType(property.
Type
) ?? property.
Type
))
131
$"Property '{property.ModelName}' has a different CLR type in the record definition ('{property.
Type
.Name}') and on the .NET property ('{clrProperty.PropertyType}').");
244
keyProperty.IsAutoGenerated = keyAttribute.IsAutoGeneratedNullable ?? SupportsKeyAutoGeneration(keyProperty.
Type
);
251
keyProperty.IsAutoGenerated = defKey.IsAutoGenerated ?? SupportsKeyAutoGeneration(keyProperty.
Type
);
433
if (IsVectorPropertyTypeValid(vectorProperty.
Type
, out _))
435
if (userRequestedEmbeddingType is not null && userRequestedEmbeddingType != vectorProperty.
Type
)
440
vectorProperty.EmbeddingType = vectorProperty.
Type
;
520
var type = propertyModel.
Type
;
522
Debug.Assert(propertyModel.
Type
is not null, "propertyModel.Type must be non-null");
527
if (keyProperty.IsAutoGenerated && !SupportsKeyAutoGeneration(keyProperty.
Type
))
530
$"Property '{keyProperty.ModelName}' is configured for auto-generation, but key properties of type '{keyProperty.
Type
.Name}' do not support auto-generation.");
537
if (!IsDataPropertyTypeValid(dataProperty.
Type
, out var supportedTypes))
547
if (IsVectorPropertyTypeValid(vectorProperty.
Type
, out string? supportedVectorTypes))
606
if (KeyType is not null && KeyType != typeof(object) && KeyType != keyProperty.
Type
)
609
$"The collection's generic key type is '{KeyType.Name}', but the key property '{keyProperty.ModelName}' has type '{keyProperty.
Type
.Name}'. " +
ProviderServices\DataPropertyModel.cs (1)
35
=> $"{ModelName} (Data, {
Type
.Name})";
ProviderServices\Filter\FilterTranslatorBase.cs (3)
218
var unwrappedPropertyType = Nullable.GetUnderlyingType(propertyModel.
Type
) ?? propertyModel.
Type
;
225
throw new InvalidCastException($"Property '{propertyModel.ModelName}' is being cast to type '{convert.Type.Name}', but its configured type is '{propertyModel.
Type
.Name}'.");
ProviderServices\KeyPropertyModel.cs (1)
34
=> $"{ModelName} (Key, {
Type
.Name}{(IsAutoGenerated ? ", auto-generated" : string.Empty)})";
ProviderServices\PropertyModel.cs (3)
79
if (
Type
.IsValueType)
81
return Nullable.GetUnderlyingType(
Type
) is not null;
122
var propertyType =
Type
;
ProviderServices\VectorDataStrings.cs (5)
32
=> $"Property '{vectorProperty.ModelName}' has embedding type '{TypeName(vectorProperty.
Type
)}', but an embedding generator is configured on the property. Remove the embedding generator or change the property's .NET type to a non-embedding input type to the generator (e.g. string).";
35
=> $"Property '{vectorProperty.ModelName}' has {nameof(VectorStoreVectorProperty.EmbeddingType)} configured to '{TypeName(embeddingType)}', but the property already has natively supported '{TypeName(vectorProperty.
Type
)}'. {nameof(VectorStoreVectorProperty.EmbeddingType)} only needs to be specified for properties that require embedding generation.";
44
=> $"Embedding generator '{TypeName(embeddingGenerator.GetType())}' on vector property '{vectorProperty.ModelName}' cannot convert the input type '{TypeName(vectorProperty.
Type
)}' to a supported vector type (one of: {supportedOutputTypes}).";
56
=> $"Vector property '{vectorProperty.ModelName}' has type '{TypeName(vectorProperty.
Type
)}' which isn't supported by your provider, and no embedding generator is configured. Configure a generator that supports converting '{TypeName(vectorProperty.
Type
)}' to vector type supported by your provider.";
ProviderServices\VectorPropertyModel.cs (4)
66
/// Otherwise, this property is identical to <see cref="PropertyModel.
Type
"/>.
120
IEmbeddingGenerator<string, TEmbedding> when
Type
== typeof(string) && (userRequestedEmbeddingType is null || userRequestedEmbeddingType == typeof(TEmbedding))
122
IEmbeddingGenerator<DataContent, TEmbedding> when
Type
== typeof(DataContent) && (userRequestedEmbeddingType is null || userRequestedEmbeddingType == typeof(TEmbedding))
203
=> $"{ModelName} (Vector, {
Type
.Name})";
ProviderServices\VectorPropertyModel{TInput}.cs (1)
29
IEmbeddingGenerator<TInput, TEmbedding> when
Type
== typeof(TInput) && (userRequestedEmbeddingType is null || userRequestedEmbeddingType == typeof(TEmbedding))