@absolutejs/absolute 0.19.0-beta.635 → 0.19.0-beta.637
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/client/index.js +17 -3
- package/dist/ai/client/index.js.map +4 -4
- package/dist/ai/client/ui.js +17 -3
- package/dist/ai/client/ui.js.map +4 -4
- package/dist/ai/index.js +59 -9
- package/dist/ai/index.js.map +8 -8
- package/dist/ai/rag/quality.js +17 -3
- package/dist/ai/rag/quality.js.map +4 -4
- package/dist/ai/rag/ui.js +17 -3
- package/dist/ai/rag/ui.js.map +4 -4
- package/dist/angular/ai/index.js +17 -3
- package/dist/angular/ai/index.js.map +4 -4
- package/dist/react/ai/index.js +17 -3
- package/dist/react/ai/index.js.map +4 -4
- package/dist/src/react/ai/useRAG.d.ts +2 -0
- package/dist/src/svelte/ai/createRAG.d.ts +2 -0
- package/dist/src/vue/ai/useRAG.d.ts +16 -0
- package/dist/src/vue/ai/useRAGEvaluate.d.ts +8 -0
- package/dist/src/vue/ai/useRAGIndexAdmin.d.ts +4 -0
- package/dist/src/vue/ai/useRAGSearch.d.ts +2 -0
- package/dist/svelte/ai/index.js +17 -3
- package/dist/svelte/ai/index.js.map +4 -4
- package/dist/types/ai.d.ts +9 -0
- package/dist/vue/ai/index.js +17 -3
- package/dist/vue/ai/index.js.map +4 -4
- package/package.json +7 -7
package/dist/ai/index.js
CHANGED
|
@@ -749,7 +749,7 @@ var formatLeadMediaCueSummary = (input) => {
|
|
|
749
749
|
return parts.length > 0 ? parts.join(" \xB7 ") : "none";
|
|
750
750
|
};
|
|
751
751
|
var formatRAGTraceMetadataRow = (key, value) => ({
|
|
752
|
-
label: key === "sqliteQueryMode" ? "SQLite query mode" : key === "postgresQueryMode" ? "Postgres query mode" : key === "sqliteQueryPushdownMode" ? "SQLite pushdown mode" : key === "postgresQueryPushdownMode" ? "Postgres pushdown mode" : key === "sqliteQueryPushdownApplied" ? "SQLite pushdown applied" : key === "postgresQueryPushdownApplied" ? "Postgres pushdown applied" : key === "sqliteQueryPushdownClauseCount" ? "SQLite pushdown clauses" : key === "postgresQueryPushdownClauseCount" ? "Postgres pushdown clauses" : key === "sqliteQueryPushdownCoverageRatio" ? "SQLite pushdown coverage" : key === "postgresQueryPushdownCoverageRatio" ? "Postgres pushdown coverage" : key === "sqliteQueryTotalFilterClauseCount" ? "SQLite total filter clauses" : key === "postgresQueryTotalFilterClauseCount" ? "Postgres total filter clauses" : key === "sqliteQueryJsRemainderClauseCount" ? "SQLite JS remainder clauses" : key === "sqliteQueryMultiplierUsed" ? "SQLite query multiplier" : key === "sqliteQueryCandidateLimitUsed" ? "SQLite candidate limit" : key === "sqliteQueryMaxBackfillsUsed" ? "SQLite max backfills" : key === "sqliteQueryMinResultsUsed" ? "SQLite min results" : key === "postgresQueryJsRemainderClauseCount" ? "Postgres JS remainder clauses" : key === "postgresQueryMultiplierUsed" ? "Postgres query multiplier" : key === "postgresQueryCandidateLimitUsed" ? "Postgres candidate limit" : key === "postgresQueryMaxBackfillsUsed" ? "Postgres max backfills" : key === "postgresQueryMinResultsUsed" ? "Postgres min results" : key === "sqliteQueryJsRemainderRatio" ? "SQLite JS remainder share" : key === "postgresQueryJsRemainderRatio" ? "Postgres JS remainder share" : key === "sqliteQueryFilteredCandidates" ? "SQLite filtered candidates" : key === "postgresQueryFilteredCandidates" ? "Postgres filtered candidates" : key === "sqliteQueryInitialSearchK" ? "SQLite initial searchK" : key === "postgresQueryInitialSearchK" ? "Postgres initial searchK" : key === "sqliteQueryFinalSearchK" ? "SQLite final searchK" : key === "postgresQueryFinalSearchK" ? "Postgres final searchK" : key === "sqliteQuerySearchExpansionRatio" ? "SQLite search expansion" : key === "postgresQuerySearchExpansionRatio" ? "Postgres search expansion" : key === "sqliteQueryBackfillCount" ? "SQLite backfill count" : key === "sqliteQueryBackfillLimitReached" ? "SQLite backfill limit reached" : key === "sqliteQueryMinResultsSatisfied" ? "SQLite min results satisfied" : key === "postgresQueryBackfillCount" ? "Postgres backfill count" : key === "postgresQueryBackfillLimitReached" ? "Postgres backfill limit reached" : key === "postgresQueryMinResultsSatisfied" ? "Postgres min results satisfied" : key === "sqliteQueryReturnedCount" ? "SQLite returned hits" : key === "postgresQueryReturnedCount" ? "Postgres returned hits" : key === "sqliteQueryCandidateYieldRatio" ? "SQLite candidate yield" : key === "postgresQueryCandidateYieldRatio" ? "Postgres candidate yield" : key === "sqliteQueryTopKFillRatio" ? "SQLite topK fill rate" : key === "postgresQueryTopKFillRatio" ? "Postgres topK fill rate" : key === "sqliteQueryUnderfilledTopK" ? "SQLite underfilled topK" : key === "postgresQueryUnderfilledTopK" ? "Postgres underfilled topK" : key === "sqliteQueryCandidateBudgetExhausted" ? "SQLite candidate budget exhausted" : key === "postgresQueryCandidateBudgetExhausted" ? "Postgres candidate budget exhausted" : key === "sqliteQueryCandidateCoverage" ? "SQLite candidate coverage" : key === "postgresQueryCandidateCoverage" ? "Postgres candidate coverage" : key === "leadSpeakerCue" ? "Lead speaker cue" : key === "leadSpeakerAttributionCue" ? "Lead speaker attribution" : key === "leadChannelAttributionCue" ? "Lead channel attribution" : key === "leadChannelCue" ? "Lead channel cue" : key === "leadContinuityCue" ? "Lead continuity cue" : key,
|
|
752
|
+
label: key === "sqliteQueryMode" ? "SQLite query mode" : key === "postgresQueryMode" ? "Postgres query mode" : key === "sqliteQueryPushdownMode" ? "SQLite pushdown mode" : key === "postgresQueryPushdownMode" ? "Postgres pushdown mode" : key === "sqliteQueryPushdownApplied" ? "SQLite pushdown applied" : key === "postgresQueryPushdownApplied" ? "Postgres pushdown applied" : key === "sqliteQueryPushdownClauseCount" ? "SQLite pushdown clauses" : key === "postgresQueryPushdownClauseCount" ? "Postgres pushdown clauses" : key === "sqliteQueryPushdownCoverageRatio" ? "SQLite pushdown coverage" : key === "postgresQueryPushdownCoverageRatio" ? "Postgres pushdown coverage" : key === "sqliteQueryTotalFilterClauseCount" ? "SQLite total filter clauses" : key === "postgresQueryTotalFilterClauseCount" ? "Postgres total filter clauses" : key === "sqliteQueryJsRemainderClauseCount" ? "SQLite JS remainder clauses" : key === "sqliteQueryMultiplierUsed" ? "SQLite query multiplier" : key === "sqliteQueryCandidateLimitUsed" ? "SQLite candidate limit" : key === "sqliteQueryMaxBackfillsUsed" ? "SQLite max backfills" : key === "sqliteQueryMinResultsUsed" ? "SQLite min results" : key === "sqliteQueryFillPolicyUsed" ? "SQLite fill policy" : key === "postgresQueryJsRemainderClauseCount" ? "Postgres JS remainder clauses" : key === "postgresQueryMultiplierUsed" ? "Postgres query multiplier" : key === "postgresQueryCandidateLimitUsed" ? "Postgres candidate limit" : key === "postgresQueryMaxBackfillsUsed" ? "Postgres max backfills" : key === "postgresQueryMinResultsUsed" ? "Postgres min results" : key === "postgresQueryFillPolicyUsed" ? "Postgres fill policy" : key === "sqliteQueryJsRemainderRatio" ? "SQLite JS remainder share" : key === "postgresQueryJsRemainderRatio" ? "Postgres JS remainder share" : key === "sqliteQueryFilteredCandidates" ? "SQLite filtered candidates" : key === "postgresQueryFilteredCandidates" ? "Postgres filtered candidates" : key === "sqliteQueryInitialSearchK" ? "SQLite initial searchK" : key === "postgresQueryInitialSearchK" ? "Postgres initial searchK" : key === "sqliteQueryFinalSearchK" ? "SQLite final searchK" : key === "postgresQueryFinalSearchK" ? "Postgres final searchK" : key === "sqliteQuerySearchExpansionRatio" ? "SQLite search expansion" : key === "postgresQuerySearchExpansionRatio" ? "Postgres search expansion" : key === "sqliteQueryBackfillCount" ? "SQLite backfill count" : key === "sqliteQueryBackfillLimitReached" ? "SQLite backfill limit reached" : key === "sqliteQueryMinResultsSatisfied" ? "SQLite min results satisfied" : key === "postgresQueryBackfillCount" ? "Postgres backfill count" : key === "postgresQueryBackfillLimitReached" ? "Postgres backfill limit reached" : key === "postgresQueryMinResultsSatisfied" ? "Postgres min results satisfied" : key === "sqliteQueryReturnedCount" ? "SQLite returned hits" : key === "postgresQueryReturnedCount" ? "Postgres returned hits" : key === "sqliteQueryCandidateYieldRatio" ? "SQLite candidate yield" : key === "postgresQueryCandidateYieldRatio" ? "Postgres candidate yield" : key === "sqliteQueryTopKFillRatio" ? "SQLite topK fill rate" : key === "postgresQueryTopKFillRatio" ? "Postgres topK fill rate" : key === "sqliteQueryUnderfilledTopK" ? "SQLite underfilled topK" : key === "postgresQueryUnderfilledTopK" ? "Postgres underfilled topK" : key === "sqliteQueryCandidateBudgetExhausted" ? "SQLite candidate budget exhausted" : key === "postgresQueryCandidateBudgetExhausted" ? "Postgres candidate budget exhausted" : key === "sqliteQueryCandidateCoverage" ? "SQLite candidate coverage" : key === "postgresQueryCandidateCoverage" ? "Postgres candidate coverage" : key === "leadSpeakerCue" ? "Lead speaker cue" : key === "leadSpeakerAttributionCue" ? "Lead speaker attribution" : key === "leadChannelAttributionCue" ? "Lead channel attribution" : key === "leadChannelCue" ? "Lead channel cue" : key === "leadContinuityCue" ? "Lead continuity cue" : key,
|
|
753
753
|
value: key === "sourceAwareChunkReason" ? formatSourceAwareChunkReason(value) ?? formatRAGTraceValue(value) : key === "leadSpeakerAttributionCue" ? formatLeadSpeakerAttributionCue(value) ?? formatRAGTraceValue(value) : key === "leadChannelAttributionCue" ? formatLeadChannelAttributionCue(value) ?? formatRAGTraceValue(value) : key === "leadContinuityCue" ? formatLeadContinuityCue(value) ?? formatRAGTraceValue(value) : formatRAGTraceValue(value)
|
|
754
754
|
});
|
|
755
755
|
var buildRAGRetrievalTracePresentation = (trace) => {
|
|
@@ -2525,6 +2525,7 @@ var formatSQLitePlannerCueSummary = (input) => {
|
|
|
2525
2525
|
typeof input?.sqliteQueryCandidateLimitUsed === "number" ? `cap ${input.sqliteQueryCandidateLimitUsed}` : undefined,
|
|
2526
2526
|
typeof input?.sqliteQueryMaxBackfillsUsed === "number" ? `backfills ${input.sqliteQueryMaxBackfillsUsed}` : undefined,
|
|
2527
2527
|
typeof input?.sqliteQueryMinResultsUsed === "number" ? `min ${input.sqliteQueryMinResultsUsed}` : undefined,
|
|
2528
|
+
input?.sqliteQueryFillPolicyUsed ? `fill ${input.sqliteQueryFillPolicyUsed}` : undefined,
|
|
2528
2529
|
typeof input?.sqliteQueryJsRemainderRatio === "number" ? `js ${(input.sqliteQueryJsRemainderRatio * 100).toFixed(0)}%` : undefined,
|
|
2529
2530
|
typeof input?.sqliteQueryTotalFilterClauseCount === "number" ? `total clauses ${input.sqliteQueryTotalFilterClauseCount}` : undefined,
|
|
2530
2531
|
typeof input?.sqliteQueryFilteredCandidates === "number" ? `filtered ${input.sqliteQueryFilteredCandidates}` : undefined,
|
|
@@ -2556,6 +2557,7 @@ var formatPostgresPlannerCueSummary = (input) => {
|
|
|
2556
2557
|
typeof input?.postgresQueryCandidateLimitUsed === "number" ? `cap ${input.postgresQueryCandidateLimitUsed}` : undefined,
|
|
2557
2558
|
typeof input?.postgresQueryMaxBackfillsUsed === "number" ? `backfills ${input.postgresQueryMaxBackfillsUsed}` : undefined,
|
|
2558
2559
|
typeof input?.postgresQueryMinResultsUsed === "number" ? `min ${input.postgresQueryMinResultsUsed}` : undefined,
|
|
2560
|
+
input?.postgresQueryFillPolicyUsed ? `fill ${input.postgresQueryFillPolicyUsed}` : undefined,
|
|
2559
2561
|
typeof input?.postgresQueryJsRemainderRatio === "number" ? `js ${(input.postgresQueryJsRemainderRatio * 100).toFixed(0)}%` : undefined,
|
|
2560
2562
|
typeof input?.postgresQueryTotalFilterClauseCount === "number" ? `total clauses ${input.postgresQueryTotalFilterClauseCount}` : undefined,
|
|
2561
2563
|
typeof input?.postgresQueryFilteredCandidates === "number" ? `filtered ${input.postgresQueryFilteredCandidates}` : undefined,
|
|
@@ -2587,6 +2589,7 @@ var formatComparisonSQLitePlannerCueSummary = (entry) => {
|
|
|
2587
2589
|
sqliteQueryCandidateLimitUsed: snapshot.sqliteQueryCandidateLimitUsed,
|
|
2588
2590
|
sqliteQueryMaxBackfillsUsed: snapshot.sqliteQueryMaxBackfillsUsed,
|
|
2589
2591
|
sqliteQueryMinResultsUsed: snapshot.sqliteQueryMinResultsUsed,
|
|
2592
|
+
sqliteQueryFillPolicyUsed: snapshot.sqliteQueryFillPolicyUsed,
|
|
2590
2593
|
sqliteQueryMode: snapshot.sqliteQueryMode,
|
|
2591
2594
|
sqliteQueryPushdownApplied: snapshot.sqliteQueryPushdownApplied,
|
|
2592
2595
|
sqliteQueryPushdownClauseCount: snapshot.sqliteQueryPushdownClauseCount,
|
|
@@ -2616,6 +2619,7 @@ var formatComparisonPostgresPlannerCueSummary = (entry) => {
|
|
|
2616
2619
|
postgresQueryCandidateLimitUsed: snapshot.postgresQueryCandidateLimitUsed,
|
|
2617
2620
|
postgresQueryMaxBackfillsUsed: snapshot.postgresQueryMaxBackfillsUsed,
|
|
2618
2621
|
postgresQueryMinResultsUsed: snapshot.postgresQueryMinResultsUsed,
|
|
2622
|
+
postgresQueryFillPolicyUsed: snapshot.postgresQueryFillPolicyUsed,
|
|
2619
2623
|
postgresQueryMultiplierUsed: snapshot.postgresQueryMultiplierUsed,
|
|
2620
2624
|
postgresQueryMode: snapshot.postgresQueryMode,
|
|
2621
2625
|
postgresQueryPushdownApplied: snapshot.postgresQueryPushdownApplied,
|
|
@@ -2786,6 +2790,7 @@ var formatHistorySQLitePlannerShift = (history) => {
|
|
|
2786
2790
|
sqliteQueryCandidateLimitUsed: entry.previousSqliteQueryCandidateLimitUsed,
|
|
2787
2791
|
sqliteQueryMaxBackfillsUsed: entry.previousSqliteQueryMaxBackfillsUsed,
|
|
2788
2792
|
sqliteQueryMinResultsUsed: entry.previousSqliteQueryMinResultsUsed,
|
|
2793
|
+
sqliteQueryFillPolicyUsed: entry.previousSqliteQueryFillPolicyUsed,
|
|
2789
2794
|
sqliteQueryMode: entry.previousSqliteQueryMode,
|
|
2790
2795
|
sqliteQueryPushdownApplied: entry.previousSqliteQueryPushdownApplied,
|
|
2791
2796
|
sqliteQueryPushdownClauseCount: entry.previousSqliteQueryPushdownClauseCount,
|
|
@@ -2825,6 +2830,7 @@ var formatHistoryPostgresPlannerShift = (history) => {
|
|
|
2825
2830
|
postgresQueryCandidateLimitUsed: entry.previousPostgresQueryCandidateLimitUsed,
|
|
2826
2831
|
postgresQueryMaxBackfillsUsed: entry.previousPostgresQueryMaxBackfillsUsed,
|
|
2827
2832
|
postgresQueryMinResultsUsed: entry.previousPostgresQueryMinResultsUsed,
|
|
2833
|
+
postgresQueryFillPolicyUsed: entry.previousPostgresQueryFillPolicyUsed,
|
|
2828
2834
|
postgresQueryMultiplierUsed: entry.previousPostgresQueryMultiplierUsed,
|
|
2829
2835
|
postgresQueryMode: entry.previousPostgresQueryMode,
|
|
2830
2836
|
postgresQueryPushdownApplied: entry.previousPostgresQueryPushdownApplied,
|
|
@@ -3894,6 +3900,7 @@ var buildEvaluationSQLiteQueryPlanSnapshot = (trace) => {
|
|
|
3894
3900
|
sqliteQueryCandidateLimitUsed: typeof metadata.sqliteQueryCandidateLimitUsed === "number" ? metadata.sqliteQueryCandidateLimitUsed : undefined,
|
|
3895
3901
|
sqliteQueryMaxBackfillsUsed: typeof metadata.sqliteQueryMaxBackfillsUsed === "number" ? metadata.sqliteQueryMaxBackfillsUsed : undefined,
|
|
3896
3902
|
sqliteQueryMinResultsUsed: typeof metadata.sqliteQueryMinResultsUsed === "number" ? metadata.sqliteQueryMinResultsUsed : undefined,
|
|
3903
|
+
sqliteQueryFillPolicyUsed: metadata.sqliteQueryFillPolicyUsed === "strict_topk" || metadata.sqliteQueryFillPolicyUsed === "satisfy_min_results" ? metadata.sqliteQueryFillPolicyUsed : undefined,
|
|
3897
3904
|
sqliteQueryPushdownCoverageRatio: typeof metadata.sqliteQueryPushdownCoverageRatio === "number" ? metadata.sqliteQueryPushdownCoverageRatio : undefined,
|
|
3898
3905
|
sqliteQueryJsRemainderRatio: typeof metadata.sqliteQueryJsRemainderRatio === "number" ? metadata.sqliteQueryJsRemainderRatio : undefined,
|
|
3899
3906
|
sqliteQueryReturnedCount: typeof metadata.sqliteQueryReturnedCount === "number" ? metadata.sqliteQueryReturnedCount : undefined,
|
|
@@ -3925,6 +3932,7 @@ var buildEvaluationPostgresQueryPlanSnapshot = (trace) => {
|
|
|
3925
3932
|
postgresQueryCandidateLimitUsed: typeof metadata.postgresQueryCandidateLimitUsed === "number" ? metadata.postgresQueryCandidateLimitUsed : undefined,
|
|
3926
3933
|
postgresQueryMaxBackfillsUsed: typeof metadata.postgresQueryMaxBackfillsUsed === "number" ? metadata.postgresQueryMaxBackfillsUsed : undefined,
|
|
3927
3934
|
postgresQueryMinResultsUsed: typeof metadata.postgresQueryMinResultsUsed === "number" ? metadata.postgresQueryMinResultsUsed : undefined,
|
|
3935
|
+
postgresQueryFillPolicyUsed: metadata.postgresQueryFillPolicyUsed === "strict_topk" || metadata.postgresQueryFillPolicyUsed === "satisfy_min_results" ? metadata.postgresQueryFillPolicyUsed : undefined,
|
|
3928
3936
|
postgresQueryPushdownCoverageRatio: typeof metadata.postgresQueryPushdownCoverageRatio === "number" ? metadata.postgresQueryPushdownCoverageRatio : undefined,
|
|
3929
3937
|
postgresQueryJsRemainderRatio: typeof metadata.postgresQueryJsRemainderRatio === "number" ? metadata.postgresQueryJsRemainderRatio : undefined,
|
|
3930
3938
|
postgresQueryReturnedCount: typeof metadata.postgresQueryReturnedCount === "number" ? metadata.postgresQueryReturnedCount : undefined,
|
|
@@ -5185,6 +5193,7 @@ var buildEvaluationCaseTraceSnapshot = ({
|
|
|
5185
5193
|
const sqliteQueryCandidateLimitUsed = currentSQLiteQueryPlanSnapshot.sqliteQueryCandidateLimitUsed ?? currentSnapshot?.sqliteQueryCandidateLimitUsed;
|
|
5186
5194
|
const sqliteQueryMaxBackfillsUsed = currentSQLiteQueryPlanSnapshot.sqliteQueryMaxBackfillsUsed ?? currentSnapshot?.sqliteQueryMaxBackfillsUsed;
|
|
5187
5195
|
const sqliteQueryMinResultsUsed = currentSQLiteQueryPlanSnapshot.sqliteQueryMinResultsUsed ?? currentSnapshot?.sqliteQueryMinResultsUsed;
|
|
5196
|
+
const sqliteQueryFillPolicyUsed = currentSQLiteQueryPlanSnapshot.sqliteQueryFillPolicyUsed ?? currentSnapshot?.sqliteQueryFillPolicyUsed;
|
|
5188
5197
|
const sqliteQueryPushdownCoverageRatio = currentSQLiteQueryPlanSnapshot.sqliteQueryPushdownCoverageRatio ?? currentSnapshot?.sqliteQueryPushdownCoverageRatio;
|
|
5189
5198
|
const sqliteQueryJsRemainderRatio = currentSQLiteQueryPlanSnapshot.sqliteQueryJsRemainderRatio ?? currentSnapshot?.sqliteQueryJsRemainderRatio;
|
|
5190
5199
|
const sqliteQueryFilteredCandidates = currentSQLiteQueryPlanSnapshot.sqliteQueryFilteredCandidates ?? currentSnapshot?.sqliteQueryFilteredCandidates;
|
|
@@ -5210,6 +5219,7 @@ var buildEvaluationCaseTraceSnapshot = ({
|
|
|
5210
5219
|
const postgresQueryCandidateLimitUsed = currentPostgresQueryPlanSnapshot.postgresQueryCandidateLimitUsed ?? currentSnapshot?.postgresQueryCandidateLimitUsed;
|
|
5211
5220
|
const postgresQueryMaxBackfillsUsed = currentPostgresQueryPlanSnapshot.postgresQueryMaxBackfillsUsed ?? currentSnapshot?.postgresQueryMaxBackfillsUsed;
|
|
5212
5221
|
const postgresQueryMinResultsUsed = currentPostgresQueryPlanSnapshot.postgresQueryMinResultsUsed ?? currentSnapshot?.postgresQueryMinResultsUsed;
|
|
5222
|
+
const postgresQueryFillPolicyUsed = currentPostgresQueryPlanSnapshot.postgresQueryFillPolicyUsed ?? currentSnapshot?.postgresQueryFillPolicyUsed;
|
|
5213
5223
|
const postgresQueryPushdownCoverageRatio = currentPostgresQueryPlanSnapshot.postgresQueryPushdownCoverageRatio ?? currentSnapshot?.postgresQueryPushdownCoverageRatio;
|
|
5214
5224
|
const postgresQueryJsRemainderRatio = currentPostgresQueryPlanSnapshot.postgresQueryJsRemainderRatio ?? currentSnapshot?.postgresQueryJsRemainderRatio;
|
|
5215
5225
|
const postgresQueryFilteredCandidates = currentPostgresQueryPlanSnapshot.postgresQueryFilteredCandidates ?? currentSnapshot?.postgresQueryFilteredCandidates;
|
|
@@ -5229,7 +5239,7 @@ var buildEvaluationCaseTraceSnapshot = ({
|
|
|
5229
5239
|
const previousFilterSignature = JSON.stringify(previousTrace?.inputFilter ?? undefined);
|
|
5230
5240
|
const currentRetrievalSignature = JSON.stringify(retrieval ?? undefined);
|
|
5231
5241
|
const previousRetrievalSignature = JSON.stringify(previousTrace?.inputRetrieval ?? undefined);
|
|
5232
|
-
const traceChange = !previousTrace ? currentTrace ? "new" : "unchanged" : previousTrace.traceMode !== currentTrace?.mode || previousFilterSignature !== currentFilterSignature || previousRetrievalSignature !== currentRetrievalSignature || previousTrace.sourceBalanceStrategy !== currentTrace?.sourceBalanceStrategy || previousTrace.transformedQuery !== (currentTrace?.transformedQuery || undefined) || previousTrace.variantQueries.join("|") !== (currentTrace?.variantQueries ?? []).join("|") || previousTrace.finalCount !== (currentTrace?.resultCounts.final ?? 0) || previousTrace.vectorCount !== (currentTrace?.resultCounts.vector ?? 0) || previousTrace.lexicalCount !== (currentTrace?.resultCounts.lexical ?? 0) || previousTrace.candidateTopK !== (currentTrace?.candidateTopK ?? 0) || previousTrace.lexicalTopK !== (currentTrace?.lexicalTopK ?? 0) || previousTrace.topContextLabel !== topContextLabel || previousTrace.topLocatorLabel !== topLocatorLabel || previousTrace.sourceAwareChunkReasonLabel !== sourceAwareChunkReasonLabel || previousTrace.sourceAwareUnitScopeLabel !== sourceAwareUnitScopeLabel || previousTrace.leadSpeakerCue !== leadSpeakerCue || previousTrace.leadSpeakerAttributionCue !== leadSpeakerAttributionCue || previousTrace.leadChannelCue !== leadChannelCue || previousTrace.leadChannelAttributionCue !== leadChannelAttributionCue || previousTrace.leadContinuityCue !== leadContinuityCue || previousTrace.sqliteQueryMode !== sqliteQueryMode || previousTrace.sqliteQueryPushdownMode !== sqliteQueryPushdownMode || previousTrace.sqliteQueryPushdownApplied !== sqliteQueryPushdownApplied || previousTrace.sqliteQueryPushdownClauseCount !== sqliteQueryPushdownClauseCount || previousTrace.sqliteQueryTotalFilterClauseCount !== sqliteQueryTotalFilterClauseCount || previousTrace.sqliteQueryJsRemainderClauseCount !== sqliteQueryJsRemainderClauseCount || previousTrace.sqliteQueryMultiplierUsed !== sqliteQueryMultiplierUsed || previousTrace.sqliteQueryCandidateLimitUsed !== sqliteQueryCandidateLimitUsed || previousTrace.sqliteQueryMaxBackfillsUsed !== sqliteQueryMaxBackfillsUsed || previousTrace.sqliteQueryMinResultsUsed !== sqliteQueryMinResultsUsed || previousTrace.sqliteQueryPushdownCoverageRatio !== sqliteQueryPushdownCoverageRatio || previousTrace.sqliteQueryJsRemainderRatio !== sqliteQueryJsRemainderRatio || previousTrace.sqliteQueryFilteredCandidates !== sqliteQueryFilteredCandidates || previousTrace.sqliteQueryInitialSearchK !== sqliteQueryInitialSearchK || previousTrace.sqliteQueryFinalSearchK !== sqliteQueryFinalSearchK || previousTrace.sqliteQuerySearchExpansionRatio !== sqliteQuerySearchExpansionRatio || previousTrace.sqliteQueryBackfillCount !== sqliteQueryBackfillCount || previousTrace.sqliteQueryBackfillLimitReached !== sqliteQueryBackfillLimitReached || previousTrace.sqliteQueryMinResultsSatisfied !== sqliteQueryMinResultsSatisfied || previousTrace.sqliteQueryReturnedCount !== sqliteQueryReturnedCount || previousTrace.sqliteQueryCandidateYieldRatio !== sqliteQueryCandidateYieldRatio || previousTrace.sqliteQueryTopKFillRatio !== sqliteQueryTopKFillRatio || previousTrace.sqliteQueryUnderfilledTopK !== sqliteQueryUnderfilledTopK || previousTrace.sqliteQueryCandidateBudgetExhausted !== sqliteQueryCandidateBudgetExhausted || previousTrace.sqliteQueryCandidateCoverage !== sqliteQueryCandidateCoverage || previousTrace.postgresQueryMode !== postgresQueryMode || previousTrace.postgresQueryPushdownMode !== postgresQueryPushdownMode || previousTrace.postgresQueryPushdownApplied !== postgresQueryPushdownApplied || previousTrace.postgresQueryPushdownClauseCount !== postgresQueryPushdownClauseCount || previousTrace.postgresQueryTotalFilterClauseCount !== postgresQueryTotalFilterClauseCount || previousTrace.postgresQueryJsRemainderClauseCount !== postgresQueryJsRemainderClauseCount || previousTrace.postgresQueryMultiplierUsed !== postgresQueryMultiplierUsed || previousTrace.postgresQueryCandidateLimitUsed !== postgresQueryCandidateLimitUsed || previousTrace.postgresQueryMaxBackfillsUsed !== postgresQueryMaxBackfillsUsed || previousTrace.postgresQueryMinResultsUsed !== postgresQueryMinResultsUsed || previousTrace.postgresQueryPushdownCoverageRatio !== postgresQueryPushdownCoverageRatio || previousTrace.postgresQueryJsRemainderRatio !== postgresQueryJsRemainderRatio || previousTrace.postgresQueryFilteredCandidates !== postgresQueryFilteredCandidates || previousTrace.postgresQueryInitialSearchK !== postgresQueryInitialSearchK || previousTrace.postgresQueryFinalSearchK !== postgresQueryFinalSearchK || previousTrace.postgresQuerySearchExpansionRatio !== postgresQuerySearchExpansionRatio || previousTrace.postgresQueryBackfillCount !== postgresQueryBackfillCount || previousTrace.postgresQueryBackfillLimitReached !== postgresQueryBackfillLimitReached || previousTrace.postgresQueryMinResultsSatisfied !== postgresQueryMinResultsSatisfied || previousTrace.postgresQueryReturnedCount !== postgresQueryReturnedCount || previousTrace.postgresQueryCandidateYieldRatio !== postgresQueryCandidateYieldRatio || previousTrace.postgresQueryTopKFillRatio !== postgresQueryTopKFillRatio || previousTrace.postgresQueryUnderfilledTopK !== postgresQueryUnderfilledTopK || previousTrace.postgresQueryCandidateBudgetExhausted !== postgresQueryCandidateBudgetExhausted || previousTrace.postgresQueryCandidateCoverage !== postgresQueryCandidateCoverage || !areStageCountsEqual(previousStageCounts, stageCounts) ? "changed" : "unchanged";
|
|
5242
|
+
const traceChange = !previousTrace ? currentTrace ? "new" : "unchanged" : previousTrace.traceMode !== currentTrace?.mode || previousFilterSignature !== currentFilterSignature || previousRetrievalSignature !== currentRetrievalSignature || previousTrace.sourceBalanceStrategy !== currentTrace?.sourceBalanceStrategy || previousTrace.transformedQuery !== (currentTrace?.transformedQuery || undefined) || previousTrace.variantQueries.join("|") !== (currentTrace?.variantQueries ?? []).join("|") || previousTrace.finalCount !== (currentTrace?.resultCounts.final ?? 0) || previousTrace.vectorCount !== (currentTrace?.resultCounts.vector ?? 0) || previousTrace.lexicalCount !== (currentTrace?.resultCounts.lexical ?? 0) || previousTrace.candidateTopK !== (currentTrace?.candidateTopK ?? 0) || previousTrace.lexicalTopK !== (currentTrace?.lexicalTopK ?? 0) || previousTrace.topContextLabel !== topContextLabel || previousTrace.topLocatorLabel !== topLocatorLabel || previousTrace.sourceAwareChunkReasonLabel !== sourceAwareChunkReasonLabel || previousTrace.sourceAwareUnitScopeLabel !== sourceAwareUnitScopeLabel || previousTrace.leadSpeakerCue !== leadSpeakerCue || previousTrace.leadSpeakerAttributionCue !== leadSpeakerAttributionCue || previousTrace.leadChannelCue !== leadChannelCue || previousTrace.leadChannelAttributionCue !== leadChannelAttributionCue || previousTrace.leadContinuityCue !== leadContinuityCue || previousTrace.sqliteQueryMode !== sqliteQueryMode || previousTrace.sqliteQueryPushdownMode !== sqliteQueryPushdownMode || previousTrace.sqliteQueryPushdownApplied !== sqliteQueryPushdownApplied || previousTrace.sqliteQueryPushdownClauseCount !== sqliteQueryPushdownClauseCount || previousTrace.sqliteQueryTotalFilterClauseCount !== sqliteQueryTotalFilterClauseCount || previousTrace.sqliteQueryJsRemainderClauseCount !== sqliteQueryJsRemainderClauseCount || previousTrace.sqliteQueryMultiplierUsed !== sqliteQueryMultiplierUsed || previousTrace.sqliteQueryCandidateLimitUsed !== sqliteQueryCandidateLimitUsed || previousTrace.sqliteQueryMaxBackfillsUsed !== sqliteQueryMaxBackfillsUsed || previousTrace.sqliteQueryMinResultsUsed !== sqliteQueryMinResultsUsed || previousTrace.sqliteQueryFillPolicyUsed !== sqliteQueryFillPolicyUsed || previousTrace.sqliteQueryPushdownCoverageRatio !== sqliteQueryPushdownCoverageRatio || previousTrace.sqliteQueryJsRemainderRatio !== sqliteQueryJsRemainderRatio || previousTrace.sqliteQueryFilteredCandidates !== sqliteQueryFilteredCandidates || previousTrace.sqliteQueryInitialSearchK !== sqliteQueryInitialSearchK || previousTrace.sqliteQueryFinalSearchK !== sqliteQueryFinalSearchK || previousTrace.sqliteQuerySearchExpansionRatio !== sqliteQuerySearchExpansionRatio || previousTrace.sqliteQueryBackfillCount !== sqliteQueryBackfillCount || previousTrace.sqliteQueryBackfillLimitReached !== sqliteQueryBackfillLimitReached || previousTrace.sqliteQueryMinResultsSatisfied !== sqliteQueryMinResultsSatisfied || previousTrace.sqliteQueryReturnedCount !== sqliteQueryReturnedCount || previousTrace.sqliteQueryCandidateYieldRatio !== sqliteQueryCandidateYieldRatio || previousTrace.sqliteQueryTopKFillRatio !== sqliteQueryTopKFillRatio || previousTrace.sqliteQueryUnderfilledTopK !== sqliteQueryUnderfilledTopK || previousTrace.sqliteQueryCandidateBudgetExhausted !== sqliteQueryCandidateBudgetExhausted || previousTrace.sqliteQueryCandidateCoverage !== sqliteQueryCandidateCoverage || previousTrace.postgresQueryMode !== postgresQueryMode || previousTrace.postgresQueryPushdownMode !== postgresQueryPushdownMode || previousTrace.postgresQueryPushdownApplied !== postgresQueryPushdownApplied || previousTrace.postgresQueryPushdownClauseCount !== postgresQueryPushdownClauseCount || previousTrace.postgresQueryTotalFilterClauseCount !== postgresQueryTotalFilterClauseCount || previousTrace.postgresQueryJsRemainderClauseCount !== postgresQueryJsRemainderClauseCount || previousTrace.postgresQueryMultiplierUsed !== postgresQueryMultiplierUsed || previousTrace.postgresQueryCandidateLimitUsed !== postgresQueryCandidateLimitUsed || previousTrace.postgresQueryMaxBackfillsUsed !== postgresQueryMaxBackfillsUsed || previousTrace.postgresQueryMinResultsUsed !== postgresQueryMinResultsUsed || previousTrace.postgresQueryFillPolicyUsed !== postgresQueryFillPolicyUsed || previousTrace.postgresQueryPushdownCoverageRatio !== postgresQueryPushdownCoverageRatio || previousTrace.postgresQueryJsRemainderRatio !== postgresQueryJsRemainderRatio || previousTrace.postgresQueryFilteredCandidates !== postgresQueryFilteredCandidates || previousTrace.postgresQueryInitialSearchK !== postgresQueryInitialSearchK || previousTrace.postgresQueryFinalSearchK !== postgresQueryFinalSearchK || previousTrace.postgresQuerySearchExpansionRatio !== postgresQuerySearchExpansionRatio || previousTrace.postgresQueryBackfillCount !== postgresQueryBackfillCount || previousTrace.postgresQueryBackfillLimitReached !== postgresQueryBackfillLimitReached || previousTrace.postgresQueryMinResultsSatisfied !== postgresQueryMinResultsSatisfied || previousTrace.postgresQueryReturnedCount !== postgresQueryReturnedCount || previousTrace.postgresQueryCandidateYieldRatio !== postgresQueryCandidateYieldRatio || previousTrace.postgresQueryTopKFillRatio !== postgresQueryTopKFillRatio || previousTrace.postgresQueryUnderfilledTopK !== postgresQueryUnderfilledTopK || previousTrace.postgresQueryCandidateBudgetExhausted !== postgresQueryCandidateBudgetExhausted || previousTrace.postgresQueryCandidateCoverage !== postgresQueryCandidateCoverage || !areStageCountsEqual(previousStageCounts, stageCounts) ? "changed" : "unchanged";
|
|
5233
5243
|
return {
|
|
5234
5244
|
candidateTopK: currentTrace?.candidateTopK ?? 0,
|
|
5235
5245
|
caseId: caseResult.caseId,
|
|
@@ -5270,6 +5280,7 @@ var buildEvaluationCaseTraceSnapshot = ({
|
|
|
5270
5280
|
previousSqliteQueryCandidateLimitUsed: previousTrace?.sqliteQueryCandidateLimitUsed,
|
|
5271
5281
|
previousSqliteQueryMaxBackfillsUsed: previousTrace?.sqliteQueryMaxBackfillsUsed,
|
|
5272
5282
|
previousSqliteQueryMinResultsUsed: previousTrace?.sqliteQueryMinResultsUsed,
|
|
5283
|
+
previousSqliteQueryFillPolicyUsed: previousTrace?.sqliteQueryFillPolicyUsed,
|
|
5273
5284
|
previousSqliteQueryPushdownCoverageRatio: previousTrace?.sqliteQueryPushdownCoverageRatio,
|
|
5274
5285
|
previousSqliteQueryJsRemainderRatio: previousTrace?.sqliteQueryJsRemainderRatio,
|
|
5275
5286
|
previousSqliteQueryReturnedCount: previousTrace?.sqliteQueryReturnedCount,
|
|
@@ -5295,6 +5306,7 @@ var buildEvaluationCaseTraceSnapshot = ({
|
|
|
5295
5306
|
previousPostgresQueryCandidateLimitUsed: previousTrace?.postgresQueryCandidateLimitUsed,
|
|
5296
5307
|
previousPostgresQueryMaxBackfillsUsed: previousTrace?.postgresQueryMaxBackfillsUsed,
|
|
5297
5308
|
previousPostgresQueryMinResultsUsed: previousTrace?.postgresQueryMinResultsUsed,
|
|
5309
|
+
previousPostgresQueryFillPolicyUsed: previousTrace?.postgresQueryFillPolicyUsed,
|
|
5298
5310
|
previousPostgresQueryPushdownCoverageRatio: previousTrace?.postgresQueryPushdownCoverageRatio,
|
|
5299
5311
|
previousPostgresQueryJsRemainderRatio: previousTrace?.postgresQueryJsRemainderRatio,
|
|
5300
5312
|
previousPostgresQueryReturnedCount: previousTrace?.postgresQueryReturnedCount,
|
|
@@ -5336,6 +5348,7 @@ var buildEvaluationCaseTraceSnapshot = ({
|
|
|
5336
5348
|
sqliteQueryCandidateLimitUsed,
|
|
5337
5349
|
sqliteQueryMaxBackfillsUsed,
|
|
5338
5350
|
sqliteQueryMinResultsUsed,
|
|
5351
|
+
sqliteQueryFillPolicyUsed,
|
|
5339
5352
|
sqliteQueryPushdownCoverageRatio,
|
|
5340
5353
|
sqliteQueryJsRemainderRatio,
|
|
5341
5354
|
sqliteQueryReturnedCount,
|
|
@@ -5361,6 +5374,7 @@ var buildEvaluationCaseTraceSnapshot = ({
|
|
|
5361
5374
|
postgresQueryCandidateLimitUsed,
|
|
5362
5375
|
postgresQueryMaxBackfillsUsed,
|
|
5363
5376
|
postgresQueryMinResultsUsed,
|
|
5377
|
+
postgresQueryFillPolicyUsed,
|
|
5364
5378
|
postgresQueryPushdownCoverageRatio,
|
|
5365
5379
|
postgresQueryJsRemainderRatio,
|
|
5366
5380
|
postgresQueryReturnedCount,
|
|
@@ -16980,6 +16994,7 @@ var buildStoreQueryPlanTraceMetadata = (store) => {
|
|
|
16980
16994
|
sqliteQueryCandidateLimitUsed: sqliteNativePlan.candidateLimitUsed ?? null,
|
|
16981
16995
|
sqliteQueryMaxBackfillsUsed: sqliteNativePlan.maxBackfillsUsed ?? null,
|
|
16982
16996
|
sqliteQueryMinResultsUsed: sqliteNativePlan.minResultsUsed ?? null,
|
|
16997
|
+
sqliteQueryFillPolicyUsed: sqliteNativePlan.fillPolicyUsed ?? null,
|
|
16983
16998
|
sqliteQueryJsRemainderRatio: sqliteNativePlan.jsRemainderRatio ?? null,
|
|
16984
16999
|
sqliteQueryCandidateYieldRatio: sqliteNativePlan.candidateYieldRatio ?? null,
|
|
16985
17000
|
sqliteQueryReturnedCount: sqliteNativePlan.returnedCount ?? null,
|
|
@@ -17012,6 +17027,7 @@ var buildStoreQueryPlanTraceMetadata = (store) => {
|
|
|
17012
17027
|
postgresQueryCandidateLimitUsed: postgresNativePlan.candidateLimitUsed ?? null,
|
|
17013
17028
|
postgresQueryMaxBackfillsUsed: postgresNativePlan.maxBackfillsUsed ?? null,
|
|
17014
17029
|
postgresQueryMinResultsUsed: postgresNativePlan.minResultsUsed ?? null,
|
|
17030
|
+
postgresQueryFillPolicyUsed: postgresNativePlan.fillPolicyUsed ?? null,
|
|
17015
17031
|
postgresQueryJsRemainderRatio: postgresNativePlan.jsRemainderRatio ?? null,
|
|
17016
17032
|
postgresQueryCandidateYieldRatio: postgresNativePlan.candidateYieldRatio ?? null,
|
|
17017
17033
|
postgresQueryReturnedCount: postgresNativePlan.returnedCount ?? null,
|
|
@@ -17146,6 +17162,7 @@ var createRAGCollection = (options) => {
|
|
|
17146
17162
|
}, "query").then((nextQueryVector) => options.store.query({
|
|
17147
17163
|
filter: input.filter,
|
|
17148
17164
|
candidateLimit: input.nativeCandidateLimit,
|
|
17165
|
+
fillPolicy: input.nativeFillPolicy,
|
|
17149
17166
|
maxBackfills: input.nativeMaxBackfills,
|
|
17150
17167
|
minResults: input.nativeMinResults,
|
|
17151
17168
|
queryMultiplier: input.nativeQueryMultiplier,
|
|
@@ -22141,6 +22158,7 @@ var ragChat = (config) => {
|
|
|
22141
22158
|
nativeCandidateLimit: typeof body.nativeCandidateLimit === "number" ? body.nativeCandidateLimit : undefined,
|
|
22142
22159
|
nativeMaxBackfills: typeof body.nativeMaxBackfills === "number" ? body.nativeMaxBackfills : undefined,
|
|
22143
22160
|
nativeMinResults: typeof body.nativeMinResults === "number" ? body.nativeMinResults : undefined,
|
|
22161
|
+
nativeFillPolicy: body.nativeFillPolicy === "strict_topk" || body.nativeFillPolicy === "satisfy_min_results" ? body.nativeFillPolicy : undefined,
|
|
22144
22162
|
nativeQueryMultiplier: typeof body.nativeQueryMultiplier === "number" ? body.nativeQueryMultiplier : undefined,
|
|
22145
22163
|
retrieval: undefined,
|
|
22146
22164
|
model: getStringProperty(body, "model"),
|
|
@@ -29100,6 +29118,13 @@ var normalizeMinResults = (value, topK) => {
|
|
|
29100
29118
|
}
|
|
29101
29119
|
return Math.min(topK, Math.max(1, Math.floor(value)));
|
|
29102
29120
|
};
|
|
29121
|
+
var resolveFillTarget = (input) => {
|
|
29122
|
+
const fillPolicy = input.fillPolicy ?? "satisfy_min_results";
|
|
29123
|
+
return {
|
|
29124
|
+
fillPolicy,
|
|
29125
|
+
targetResults: fillPolicy === "strict_topk" ? input.topK : input.minResults
|
|
29126
|
+
};
|
|
29127
|
+
};
|
|
29103
29128
|
var toQualifiedTableName = (schemaName, tableName) => `${schemaName}.${tableName}`;
|
|
29104
29129
|
var toVectorLiteral = (vector) => `[${vector.join(",")}]`;
|
|
29105
29130
|
var parseMetadata = (value) => {
|
|
@@ -29190,6 +29215,7 @@ var updatePostgresLastQueryPlan = (input) => {
|
|
|
29190
29215
|
candidateLimitUsed: input.candidateLimitUsed,
|
|
29191
29216
|
maxBackfillsUsed: input.maxBackfillsUsed,
|
|
29192
29217
|
minResultsUsed: input.minResultsUsed,
|
|
29218
|
+
fillPolicyUsed: input.fillPolicyUsed,
|
|
29193
29219
|
jsRemainderClauseCount: pushdown.jsRemainderClauseCount,
|
|
29194
29220
|
queryMultiplierUsed: input.queryMultiplierUsed,
|
|
29195
29221
|
jsRemainderRatio: pushdown.jsRemainderRatio,
|
|
@@ -29287,6 +29313,11 @@ var createPostgresRAGStore = (options = {}) => {
|
|
|
29287
29313
|
const candidateLimit = normalizeCandidateLimit(input.candidateLimit);
|
|
29288
29314
|
const maxBackfills = normalizeMaxBackfills(input.maxBackfills);
|
|
29289
29315
|
const minResults = normalizeMinResults(input.minResults, input.topK);
|
|
29316
|
+
const fillTarget = resolveFillTarget({
|
|
29317
|
+
fillPolicy: input.fillPolicy,
|
|
29318
|
+
minResults,
|
|
29319
|
+
topK: input.topK
|
|
29320
|
+
});
|
|
29290
29321
|
const queryVectorLiteral = toVectorLiteral(queryVector);
|
|
29291
29322
|
const pushdownFilter = buildPostgresPushdownFilter(input.filter);
|
|
29292
29323
|
const countFilterPlan = buildPostgresFilterPlan(pushdownFilter);
|
|
@@ -29345,7 +29376,7 @@ var createPostgresRAGStore = (options = {}) => {
|
|
|
29345
29376
|
source: entry.chunk.source,
|
|
29346
29377
|
title: entry.chunk.title
|
|
29347
29378
|
})).sort((left, right) => right.score - left.score);
|
|
29348
|
-
if (mapped.length >=
|
|
29379
|
+
if (mapped.length >= fillTarget.targetResults) {
|
|
29349
29380
|
break;
|
|
29350
29381
|
}
|
|
29351
29382
|
const nextSearchK = planNativeCandidateSearchBackfillK({
|
|
@@ -29356,8 +29387,8 @@ var createPostgresRAGStore = (options = {}) => {
|
|
|
29356
29387
|
maxBackfills
|
|
29357
29388
|
});
|
|
29358
29389
|
if (nextSearchK <= currentSearchK) {
|
|
29359
|
-
backfillLimitReached = typeof maxBackfills === "number" && backfillCount >= maxBackfills && mapped.length <
|
|
29360
|
-
candidateBudgetExhausted = mapped.length <
|
|
29390
|
+
backfillLimitReached = typeof maxBackfills === "number" && backfillCount >= maxBackfills && mapped.length < fillTarget.targetResults;
|
|
29391
|
+
candidateBudgetExhausted = mapped.length < fillTarget.targetResults;
|
|
29361
29392
|
break;
|
|
29362
29393
|
}
|
|
29363
29394
|
currentSearchK = nextSearchK;
|
|
@@ -29372,6 +29403,7 @@ var createPostgresRAGStore = (options = {}) => {
|
|
|
29372
29403
|
candidateLimitUsed: candidateLimit,
|
|
29373
29404
|
maxBackfillsUsed: maxBackfills,
|
|
29374
29405
|
minResultsUsed: minResults,
|
|
29406
|
+
fillPolicyUsed: fillTarget.fillPolicy,
|
|
29375
29407
|
filter: input.filter,
|
|
29376
29408
|
pushdownFilter,
|
|
29377
29409
|
queryMultiplierUsed: queryMultiplier2,
|
|
@@ -29435,8 +29467,12 @@ var createPostgresRAGStore = (options = {}) => {
|
|
|
29435
29467
|
await init();
|
|
29436
29468
|
await db.unsafe(`truncate table ${qualifiedTableName}`);
|
|
29437
29469
|
};
|
|
29470
|
+
const close = async () => {
|
|
29471
|
+
await db.close?.();
|
|
29472
|
+
};
|
|
29438
29473
|
return {
|
|
29439
29474
|
clear,
|
|
29475
|
+
close,
|
|
29440
29476
|
embed,
|
|
29441
29477
|
getCapabilities: () => capabilities,
|
|
29442
29478
|
getStatus: () => createPostgresStatus(dimensions, nativeDiagnostics),
|
|
@@ -29605,6 +29641,13 @@ var normalizeMinResults2 = (value, topK) => {
|
|
|
29605
29641
|
}
|
|
29606
29642
|
return Math.min(topK, Math.max(1, Math.floor(value)));
|
|
29607
29643
|
};
|
|
29644
|
+
var resolveFillTarget2 = (input) => {
|
|
29645
|
+
const fillPolicy = input.fillPolicy ?? "satisfy_min_results";
|
|
29646
|
+
return {
|
|
29647
|
+
fillPolicy,
|
|
29648
|
+
targetResults: fillPolicy === "strict_topk" ? input.topK : input.minResults
|
|
29649
|
+
};
|
|
29650
|
+
};
|
|
29608
29651
|
var toJSONString = (metadata) => metadata === undefined ? null : JSON.stringify(metadata);
|
|
29609
29652
|
var parseMetadata2 = (value) => {
|
|
29610
29653
|
if (value === null) {
|
|
@@ -30185,6 +30228,7 @@ var updateSQLiteLastQueryPlan = (input) => {
|
|
|
30185
30228
|
candidateLimitUsed: input.candidateLimitUsed,
|
|
30186
30229
|
maxBackfillsUsed: input.maxBackfillsUsed,
|
|
30187
30230
|
minResultsUsed: input.minResultsUsed,
|
|
30231
|
+
fillPolicyUsed: input.fillPolicyUsed,
|
|
30188
30232
|
queryMultiplierUsed: input.queryMultiplierUsed,
|
|
30189
30233
|
jsRemainderRatio: pushdown.jsRemainderRatio,
|
|
30190
30234
|
pushdownApplied: pushdown.pushdownClauseCount > 0,
|
|
@@ -30356,6 +30400,11 @@ var createSQLiteRAGStore = (options = {}) => {
|
|
|
30356
30400
|
const candidateLimit = normalizeCandidateLimit2(input.candidateLimit);
|
|
30357
30401
|
const maxBackfills = normalizeMaxBackfills2(input.maxBackfills);
|
|
30358
30402
|
const minResults = normalizeMinResults2(input.minResults, input.topK);
|
|
30403
|
+
const fillTarget = resolveFillTarget2({
|
|
30404
|
+
fillPolicy: input.fillPolicy,
|
|
30405
|
+
minResults,
|
|
30406
|
+
topK: input.topK
|
|
30407
|
+
});
|
|
30359
30408
|
const queryVector = normalizeVector(input.queryVector);
|
|
30360
30409
|
const queryVectorText = toVectorText(queryVector);
|
|
30361
30410
|
const pushdownFilter = buildSQLitePushdownFilter(input.filter);
|
|
@@ -30405,7 +30454,7 @@ var createSQLiteRAGStore = (options = {}) => {
|
|
|
30405
30454
|
source: entry.chunk.source,
|
|
30406
30455
|
title: entry.chunk.title
|
|
30407
30456
|
})).sort((left, right) => right.score - left.score);
|
|
30408
|
-
if (mapped.length >=
|
|
30457
|
+
if (mapped.length >= fillTarget.targetResults) {
|
|
30409
30458
|
break;
|
|
30410
30459
|
}
|
|
30411
30460
|
const nextSearchK = planNativeCandidateSearchBackfillK({
|
|
@@ -30416,8 +30465,8 @@ var createSQLiteRAGStore = (options = {}) => {
|
|
|
30416
30465
|
maxBackfills
|
|
30417
30466
|
});
|
|
30418
30467
|
if (nextSearchK <= currentSearchK) {
|
|
30419
|
-
backfillLimitReached = typeof maxBackfills === "number" && backfillCount >= maxBackfills && mapped.length <
|
|
30420
|
-
candidateBudgetExhausted = mapped.length <
|
|
30468
|
+
backfillLimitReached = typeof maxBackfills === "number" && backfillCount >= maxBackfills && mapped.length < fillTarget.targetResults;
|
|
30469
|
+
candidateBudgetExhausted = mapped.length < fillTarget.targetResults;
|
|
30421
30470
|
break;
|
|
30422
30471
|
}
|
|
30423
30472
|
currentSearchK = nextSearchK;
|
|
@@ -30436,6 +30485,7 @@ var createSQLiteRAGStore = (options = {}) => {
|
|
|
30436
30485
|
candidateLimitUsed: candidateLimit,
|
|
30437
30486
|
maxBackfillsUsed: maxBackfills,
|
|
30438
30487
|
minResultsUsed: minResults,
|
|
30488
|
+
fillPolicyUsed: fillTarget.fillPolicy,
|
|
30439
30489
|
queryMultiplierUsed: queryMultiplier,
|
|
30440
30490
|
queryMode: "native_vec0",
|
|
30441
30491
|
returnedCount: Math.min(mapped.length, input.topK),
|
|
@@ -32607,5 +32657,5 @@ export {
|
|
|
32607
32657
|
addRAGEvaluationSuiteCase
|
|
32608
32658
|
};
|
|
32609
32659
|
|
|
32610
|
-
//# debugId=
|
|
32660
|
+
//# debugId=690A2FC8A2432BC964756E2164756E21
|
|
32611
32661
|
//# sourceMappingURL=index.js.map
|