-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathRagFilters.cs
More file actions
53 lines (45 loc) · 1.28 KB
/
Copy pathRagFilters.cs
File metadata and controls
53 lines (45 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
namespace Mythosia.AI.Rag
{
public sealed class RagFilter
{
public int TopK { get; set; } = 5;
public double? MinScore { get; set; }
/// <summary>
/// Returns a copy of this <see cref="RagFilter"/> with the same field values.
/// </summary>
public RagFilter Clone()
{
return new RagFilter
{
TopK = TopK,
MinScore = MinScore
};
}
}
public sealed class RagRetrievalDerivation
{
public int TopKMultiplier { get; set; } = 3;
public double MinScoreDivider { get; set; } = 3d;
/// <summary>
/// Returns a copy of this <see cref="RagRetrievalDerivation"/> with the same field values.
/// </summary>
public RagRetrievalDerivation Clone()
{
return new RagRetrievalDerivation
{
TopKMultiplier = TopKMultiplier,
MinScoreDivider = MinScoreDivider
};
}
}
public sealed class RagRetrievalFilter
{
public int TopK { get; }
public double? MinScore { get; }
public RagRetrievalFilter(int topK, double? minScore)
{
TopK = topK;
MinScore = minScore;
}
}
}