Implemented interface members:
28 references to Count
Microsoft.Extensions.AI (6)
Embeddings\CachingEmbeddingGenerator.cs (5)
52
if (generated.
Count
!= 1)
54
throw new InvalidOperationException($"Expected exactly one embedding to be generated, but received {generated.
Count
}.");
81
(uncached ??= []).Add((results.
Count
, cacheKey, input));
93
for (int i = 0; i < uncachedResults.
Count
; i++)
99
for (int i = 0; i < uncachedResults.
Count
; i++)
Embeddings\LoggingEmbeddingGenerator.cs (1)
67
LogCompleted(embeddings.
Count
);
Microsoft.Extensions.AI.Abstractions (3)
Embeddings\EmbeddingGeneratorExtensions.cs (3)
147
if (embeddings.
Count
!= inputsCount)
149
throw new InvalidOperationException($"Expected the number of embeddings ({embeddings.
Count
}) to match the number of inputs ({inputsCount}).");
152
var results = new (TInput, TEmbedding)[embeddings.
Count
];
Microsoft.Extensions.AI.Abstractions.Tests (19)
Embeddings\GeneratedEmbeddingsTests.cs (19)
39
Assert.Equal(0, instance.
Count
);
66
Assert.Equal(2, generatedEmbeddings.
Count
);
87
Assert.Equal(3, generatedEmbeddings.
Count
);
119
Assert.Equal(1, embeddings.
Count
);
133
Assert.Equal(2, embeddings.
Count
);
147
Assert.Equal(2, embeddings.
Count
);
150
Assert.Equal(0, embeddings.
Count
);
163
Assert.Equal(2, embeddings.
Count
);
166
Assert.Equal(1, embeddings.
Count
);
170
Assert.Equal(1, embeddings.
Count
);
174
Assert.Equal(0, embeddings.
Count
);
186
Assert.Equal(2, embeddings.
Count
);
189
Assert.Equal(1, embeddings.
Count
);
193
Assert.Equal(0, embeddings.
Count
);
205
Assert.Equal(2, embeddings.
Count
);
209
Assert.Equal(3, embeddings.
Count
);
223
Assert.Equal(2, embeddings.
Count
);
227
Assert.Equal(2, embeddings.
Count
);
241
Assert.Equal(2, embeddings.
Count
);