Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dotnet/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
<PackageVersion Include="YamlDotNet" Version="15.3.0" />
<PackageVersion Include="Fluid.Core" Version="2.11.1" />
<!-- Memory stores -->
<PackageVersion Include="Microsoft.Azure.Cosmos" Version="3.44.0-preview.1" />
<PackageVersion Include="Microsoft.Azure.Cosmos" Version="3.45.2" />
<PackageVersion Include="Pgvector" Version="0.2.0" />
<PackageVersion Include="NRedisStack" Version="0.12.0" />
<PackageVersion Include="Milvus.Client" Version="2.3.0-preview.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,6 @@ public async Task CreateCollectionUsesValidContainerPropertiesAsync(IndexingMode

var expectedVectorEmbeddingPolicy = new VectorEmbeddingPolicy(
[
new Embedding
{
DataType = VectorDataType.Float16,
Dimensions = 1,
DistanceFunction = Microsoft.Azure.Cosmos.DistanceFunction.Cosine,
Path = "/DescriptionEmbedding1"
},
new Embedding
{
DataType = VectorDataType.Float32,
Expand Down Expand Up @@ -157,7 +150,6 @@ public async Task CreateCollectionUsesValidContainerPropertiesAsync(IndexingMode
{
VectorIndexes =
[
new VectorIndexPath { Type = VectorIndexType.Flat, Path = "/DescriptionEmbedding1" },
new VectorIndexPath { Type = VectorIndexType.Flat, Path = "/DescriptionEmbedding2" },
new VectorIndexPath { Type = VectorIndexType.QuantizedFlat, Path = "/DescriptionEmbedding3" },
new VectorIndexPath { Type = VectorIndexType.DiskANN, Path = "/DescriptionEmbedding4" },
Expand All @@ -172,7 +164,6 @@ public async Task CreateCollectionUsesValidContainerPropertiesAsync(IndexingMode
expectedIndexingPolicy.IncludedPaths.Add(new IncludedPath { Path = "/IndexableData2/?" });
expectedIndexingPolicy.IncludedPaths.Add(new IncludedPath { Path = "/" });

expectedIndexingPolicy.ExcludedPaths.Add(new ExcludedPath { Path = "/DescriptionEmbedding1/*" });
expectedIndexingPolicy.ExcludedPaths.Add(new ExcludedPath { Path = "/DescriptionEmbedding2/*" });
expectedIndexingPolicy.ExcludedPaths.Add(new ExcludedPath { Path = "/DescriptionEmbedding3/*" });
expectedIndexingPolicy.ExcludedPaths.Add(new ExcludedPath { Path = "/DescriptionEmbedding4/*" });
Expand Down Expand Up @@ -704,9 +695,6 @@ private sealed class TestIndexingModel
[VectorStoreRecordKey]
public string? Id { get; set; }

[VectorStoreRecordVector(Dimensions: 1, DistanceFunction: DistanceFunction.CosineSimilarity, IndexKind: IndexKind.Flat)]
public ReadOnlyMemory<Half>? DescriptionEmbedding1 { get; set; }

[VectorStoreRecordVector(Dimensions: 2, DistanceFunction: DistanceFunction.CosineSimilarity, IndexKind: IndexKind.Flat)]
public ReadOnlyMemory<float>? DescriptionEmbedding2 { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public AzureCosmosDBNoSQLMemoryStore(
new Embedding
{
DataType = vectorDataType,
Dimensions = dimensions,
Dimensions = (int)dimensions,
DistanceFunction = DistanceFunction.Cosine,
Path = EmbeddingPath,
}
Expand Down Expand Up @@ -141,10 +141,10 @@ contain an embedding path at {EmbeddingPath}. It's also recommended to include t
be specified as {nameof(DistanceFunction)}.{nameof(DistanceFunction.Cosine)}.
""");
}
else if (embedding.DataType != VectorDataType.Float16 && embedding.DataType != VectorDataType.Float32)
else if (embedding.DataType != VectorDataType.Float32)
{
throw new NotSupportedException($"""
Only {nameof(VectorDataType)}.{nameof(VectorDataType.Float16)} and {nameof(VectorDataType)}.{nameof(VectorDataType.Float32)}
Only {nameof(VectorDataType)}.{nameof(VectorDataType.Float32)}
are supported.
""");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ public sealed class AzureCosmosDBNoSQLVectorStoreRecordCollection<TRecord> :
/// <summary>A <see cref="HashSet{T}"/> of types that vector properties on the provided model may have, based on <see cref="VectorDataType"/> enumeration.</summary>
private static readonly HashSet<Type> s_supportedVectorTypes =
[
// Float16
#if NET5_0_OR_GREATER
typeof(ReadOnlyMemory<Half>),
typeof(ReadOnlyMemory<Half>?),
#endif
// Float32
typeof(ReadOnlyMemory<float>),
typeof(ReadOnlyMemory<float>?),
Expand Down Expand Up @@ -485,7 +480,7 @@ private ContainerProperties GetContainerProperties()
var embedding = new Embedding
{
DataType = GetDataType(property.PropertyType, vectorPropertyName),
Dimensions = (ulong)property.Dimensions,
Dimensions = (int)property.Dimensions,
DistanceFunction = GetDistanceFunction(property.DistanceFunction, vectorPropertyName),
Path = path
};
Expand Down Expand Up @@ -576,9 +571,6 @@ private static VectorDataType GetDataType(Type vectorDataType, string vectorProp
{
return vectorDataType switch
{
#if NET5_0_OR_GREATER
Type type when type == typeof(ReadOnlyMemory<Half>) || type == typeof(ReadOnlyMemory<Half>?) => VectorDataType.Float16,
#endif
Type type when type == typeof(ReadOnlyMemory<float>) || type == typeof(ReadOnlyMemory<float>?) => VectorDataType.Float32,
Type type when type == typeof(ReadOnlyMemory<byte>) || type == typeof(ReadOnlyMemory<byte>?) => VectorDataType.Uint8,
Type type when type == typeof(ReadOnlyMemory<sbyte>) || type == typeof(ReadOnlyMemory<sbyte>?) => VectorDataType.Int8,
Expand Down
Loading