7 instantiations of BinaryEmbedding
Microsoft.Extensions.AI.Abstractions (1)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.BinaryEmbedding.g.cs (1)
34
ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.
BinaryEmbedding
((global::System.Collections.BitArray)args[0]),
Microsoft.Extensions.AI.Abstractions.Tests (4)
Embeddings\BinaryEmbeddingTests.cs (3)
20
BinaryEmbedding e =
new
(vector);
32
BinaryEmbedding e =
new
(vector);
67
BinaryEmbedding e =
new
(vector);
Generated\361d1da7f942c932\TestJsonSerializerContext.BinaryEmbedding.g.cs (1)
32
ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.
BinaryEmbedding
((global::System.Collections.BitArray)args[0]),
Microsoft.Extensions.AI.Integration.Tests (1)
QuantizationEmbeddingGenerator.cs (1)
59
return
new
(result)
Microsoft.Extensions.VectorData.ConformanceTests (1)
TypeTests\EmbeddingTypeTests.cs (1)
201
=> Task.FromResult(new GeneratedEmbeddings<BinaryEmbedding>([
new
(data)]));
52 references to BinaryEmbedding
Microsoft.Extensions.AI.Abstractions (20)
Embeddings\BinaryEmbedding.cs (1)
20
/// <summary>Initializes a new instance of the <see cref="
BinaryEmbedding
"/> class with the embedding vector.</summary>
Embeddings\Embedding.cs (1)
13
[JsonDerivedType(typeof(
BinaryEmbedding
), typeDiscriminator: "binary")]
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.BinaryEmbedding.g.cs (17)
15
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
BinaryEmbedding
>? _BinaryEmbedding;
21
public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
BinaryEmbedding
> BinaryEmbedding
24
get => _BinaryEmbedding ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
BinaryEmbedding
>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.
BinaryEmbedding
));
27
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
BinaryEmbedding
> Create_BinaryEmbedding(global::System.Text.Json.JsonSerializerOptions options)
29
if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.
BinaryEmbedding
>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
BinaryEmbedding
> jsonTypeInfo))
31
var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.
BinaryEmbedding
>
37
ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.
BinaryEmbedding
).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(global::System.Collections.BitArray)}, modifiers: null),
41
jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.
BinaryEmbedding
>(options, objectInfo);
58
DeclaringType = typeof(global::Microsoft.Extensions.AI.
BinaryEmbedding
),
59
Converter = (global::System.Text.Json.Serialization.JsonConverter<global::System.Collections.BitArray>)ExpandConverter(typeof(global::System.Collections.BitArray), new global::Microsoft.Extensions.AI.
BinaryEmbedding
.VectorConverter(), options),
60
Getter = static obj => ((global::Microsoft.Extensions.AI.
BinaryEmbedding
)obj).Vector,
61
Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.
BinaryEmbedding
)obj).Vector = value!,
68
AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.
BinaryEmbedding
).GetProperty("Vector", InstanceMemberBindingFlags, null, typeof(global::System.Collections.BitArray), global::System.Array.Empty<global::System.Type>(), null),
80
DeclaringType = typeof(global::Microsoft.Extensions.AI.
BinaryEmbedding
),
90
AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.
BinaryEmbedding
).GetProperty("Dimensions", InstanceMemberBindingFlags, null, typeof(int), global::System.Array.Empty<global::System.Type>(), null),
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.GetJsonTypeInfo.g.cs (1)
80
if (type == typeof(global::Microsoft.Extensions.AI.
BinaryEmbedding
))
Microsoft.Extensions.AI.Abstractions.Tests (25)
Embeddings\BinaryEmbeddingTests.cs (7)
20
BinaryEmbedding
e = new(vector);
32
BinaryEmbedding
e = new(vector);
67
BinaryEmbedding
e = new(vector);
72
BinaryEmbedding
result = Assert.IsType<
BinaryEmbedding
>(JsonSerializer.Deserialize(json, TestJsonSerializerContext.Default.Embedding));
80
BinaryEmbedding
result = Assert.IsType<
BinaryEmbedding
>(JsonSerializer.Deserialize(
Generated\361d1da7f942c932\TestJsonSerializerContext.BinaryEmbedding.g.cs (17)
13
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
BinaryEmbedding
>? _BinaryEmbedding;
19
public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
BinaryEmbedding
> BinaryEmbedding
22
get => _BinaryEmbedding ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
BinaryEmbedding
>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.
BinaryEmbedding
));
25
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
BinaryEmbedding
> Create_BinaryEmbedding(global::System.Text.Json.JsonSerializerOptions options)
27
if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.
BinaryEmbedding
>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
BinaryEmbedding
> jsonTypeInfo))
29
var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.
BinaryEmbedding
>
35
ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.
BinaryEmbedding
).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(global::System.Collections.BitArray)}, modifiers: null),
39
jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.
BinaryEmbedding
>(options, objectInfo);
56
DeclaringType = typeof(global::Microsoft.Extensions.AI.
BinaryEmbedding
),
57
Converter = (global::System.Text.Json.Serialization.JsonConverter<global::System.Collections.BitArray>)ExpandConverter(typeof(global::System.Collections.BitArray), new global::Microsoft.Extensions.AI.
BinaryEmbedding
.VectorConverter(), options),
58
Getter = static obj => ((global::Microsoft.Extensions.AI.
BinaryEmbedding
)obj).Vector,
59
Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.
BinaryEmbedding
)obj).Vector = value!,
66
AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.
BinaryEmbedding
).GetProperty("Vector", InstanceMemberBindingFlags, null, typeof(global::System.Collections.BitArray), global::System.Array.Empty<global::System.Type>(), null),
78
DeclaringType = typeof(global::Microsoft.Extensions.AI.
BinaryEmbedding
),
88
AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.
BinaryEmbedding
).GetProperty("Dimensions", InstanceMemberBindingFlags, null, typeof(int), global::System.Array.Empty<global::System.Type>(), null),
Generated\361d1da7f942c932\TestJsonSerializerContext.GetJsonTypeInfo.g.cs (1)
74
if (type == typeof(global::Microsoft.Extensions.AI.
BinaryEmbedding
))
Microsoft.Extensions.AI.Integration.Tests (4)
QuantizationEmbeddingGenerator.cs (4)
17
IEmbeddingGenerator<string,
BinaryEmbedding
>
35
async Task<GeneratedEmbeddings<
BinaryEmbedding
>> IEmbeddingGenerator<string,
BinaryEmbedding
>.GenerateAsync(
46
private static
BinaryEmbedding
QuantizeToBinary(Embedding<float> embedding)
Microsoft.Extensions.VectorData.ConformanceTests (3)
TypeTests\EmbeddingTypeTests.cs (3)
195
protected sealed class BinaryEmbeddingGenerator(BitArray data) : IEmbeddingGenerator<string,
BinaryEmbedding
>
197
public Task<GeneratedEmbeddings<
BinaryEmbedding
>> GenerateAsync(
201
=> Task.FromResult(new GeneratedEmbeddings<
BinaryEmbedding
>([new(data)]));