Fixed classic RAG sending more passages than the model can take (#1168)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-05 19:27:08 +01:00
1 parent 7342c436dd
commit 188d17688a
16 files changed
+847 -78

No files matched your search

@@ -0,0 +1,9 @@
namespace AIStudio.Tools.RAG;
/// <summary>
/// Which passages of the classic RAG process fit into its budget, see PassageBudget.SelectAsync.
/// </summary>
/// <param name="Contexts">The passages which fit, grouped by data source in the order the data sources came in, and within a data source in the order of their rank. A passage which had to be shortened is here in its shorter form.</param>
/// <param name="PassageCounts">How many passages of each data source fit, in the order the data sources came in.</param>
/// <param name="LeftOutCount">How many passages did not fit.</param>
public sealed record PassageSelection(IReadOnlyList<PreparedRetrievalContext> Contexts, IReadOnlyList<int> PassageCounts, int LeftOutCount);