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/src/SemanticKernel/Memory/Collections/MinHeap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Microsoft.SemanticKernel.Memory.Collections;
/// Implements the classic 'heap' data structure. By default, the item with the lowest value is at the top of the heap.
/// </summary>
/// <typeparam name="T">Data type.</typeparam>
internal class MinHeap<T> : IEnumerable<T> where T : IComparable<T>
public class MinHeap<T> : IEnumerable<T> where T : IComparable<T>
{
private const int DefaultCapacity = 7;
private const int MinCapacity = 0;
Expand Down
2 changes: 1 addition & 1 deletion dotnet/src/SemanticKernel/Memory/Collections/Score.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Microsoft.SemanticKernel.Memory.Collections;
/// <summary>
/// Structure for storing score value.
/// </summary>
internal struct Score : IComparable<Score>, IEquatable<Score>
public struct Score : IComparable<Score>, IEquatable<Score>
{
public double Value { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Microsoft.SemanticKernel.Memory.Collections;
/// Structure for storing data which can be scored.
/// </summary>
/// <typeparam name="T">Data type.</typeparam>
internal struct ScoredValue<T> : IComparable<ScoredValue<T>>, IEquatable<ScoredValue<T>>
public struct ScoredValue<T> : IComparable<ScoredValue<T>>, IEquatable<ScoredValue<T>>
{
public ScoredValue(T item, double score)
{
Expand Down Expand Up @@ -92,6 +92,8 @@ public override int GetHashCode()
return left.CompareTo(right) >= 0;
}


[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1000:Do not declare static members on generic types", Justification = "Min value convenience method")]
public static ScoredValue<T> Min()
{
return new ScoredValue<T>(default!, Score.Min);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Microsoft.SemanticKernel.Memory.Collections;
/// Automatically flushes out any not in the top N.
/// By default, items are not sorted by score until you call <see cref="TopNCollection{T}.SortByScore"/>.
/// </summary>
internal class TopNCollection<T> : IEnumerable<ScoredValue<T>>
public class TopNCollection<T> : IEnumerable<ScoredValue<T>>
{
private readonly int _maxItems;
private readonly MinHeap<ScoredValue<T>> _heap;
Expand Down
2 changes: 1 addition & 1 deletion dotnet/src/SemanticKernel/Memory/MemoryRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Microsoft.SemanticKernel.Memory;
/// <summary>
/// IMPORTANT: this is a storage schema. Changing the fields will invalidate existing metadata stored in persistent vector DBs.
/// </summary>
internal class MemoryRecord : IEmbeddingWithMetadata<float>
public class MemoryRecord : IEmbeddingWithMetadata<float>
{
/// <summary>
/// Source content embeddings.
Expand Down