@absolutejs/absolute 0.19.0-beta.540 → 0.19.0-beta.542

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/index.js CHANGED
@@ -5956,6 +5956,83 @@ var buildRAGRerankerComparisonCardPresentations = (comparison) => {
5956
5956
  traceSummaryRows: buildRAGComparisonTraceSummaryRows(entry)
5957
5957
  }));
5958
5958
  };
5959
+ var buildRAGGroundingProviderCardPresentations = (entries) => entries.map((entry) => ({
5960
+ headline: [
5961
+ entry.label,
5962
+ `passing ${formatEvaluationPassingRate(entry.response.passingRate)}`,
5963
+ `citation f1 ${entry.response.summary.averageCitationF1.toFixed(3)}`,
5964
+ `resolved ${formatEvaluationPassingRate(entry.response.summary.averageResolvedCitationRate)}`,
5965
+ `latency ${entry.elapsedMs.toFixed(1)}ms`
5966
+ ].join(" \xB7 "),
5967
+ id: entry.providerKey,
5968
+ label: entry.label
5969
+ }));
5970
+ var buildRAGGroundingProviderOverviewPresentation = (input) => {
5971
+ const resolveLabel = (key) => input.entries.find((entry) => entry.providerKey === key)?.label ?? key ?? "n/a";
5972
+ const winnerLabel = resolveLabel(input.summary.bestByPassingRate);
5973
+ const winnerEntry = input.entries.find((entry) => entry.providerKey === input.summary.bestByPassingRate);
5974
+ return {
5975
+ rows: [
5976
+ {
5977
+ label: "Best passing rate",
5978
+ value: resolveLabel(input.summary.bestByPassingRate)
5979
+ },
5980
+ {
5981
+ label: "Best citation F1",
5982
+ value: resolveLabel(input.summary.bestByAverageCitationF1)
5983
+ },
5984
+ {
5985
+ label: "Best resolved citations",
5986
+ value: resolveLabel(input.summary.bestByResolvedCitationRate)
5987
+ },
5988
+ {
5989
+ label: "Fastest",
5990
+ value: resolveLabel(input.summary.fastest)
5991
+ }
5992
+ ],
5993
+ winnerLabel,
5994
+ winnerSummary: winnerEntry ? `passing ${formatEvaluationPassingRate(winnerEntry.response.passingRate)} \xB7 citation f1 ${winnerEntry.response.summary.averageCitationF1.toFixed(3)} \xB7 resolved ${formatEvaluationPassingRate(winnerEntry.response.summary.averageResolvedCitationRate)}` : "Stored workflow evaluation"
5995
+ };
5996
+ };
5997
+ var buildRAGGroundingProviderCaseComparisonPresentations = (comparisons) => comparisons.map((comparison) => {
5998
+ const resolveLabel = (key) => comparison.entries.find((entry) => entry.providerKey === key)?.label ?? key ?? "n/a";
5999
+ return {
6000
+ caseId: comparison.caseId,
6001
+ label: comparison.label,
6002
+ rows: [
6003
+ {
6004
+ label: "Best grounded",
6005
+ value: resolveLabel(comparison.summary.bestByStatus)
6006
+ },
6007
+ {
6008
+ label: "Best citation F1",
6009
+ value: resolveLabel(comparison.summary.bestByCitationF1)
6010
+ },
6011
+ {
6012
+ label: "Best resolved citations",
6013
+ value: resolveLabel(comparison.summary.bestByResolvedCitationRate)
6014
+ },
6015
+ ...comparison.entries.map((entry) => ({
6016
+ label: entry.label,
6017
+ value: [
6018
+ entry.status.toUpperCase(),
6019
+ `coverage ${entry.coverage}`,
6020
+ `f1 ${entry.citationF1.toFixed(3)}`,
6021
+ `resolved ${formatEvaluationPassingRate(entry.resolvedCitationRate)}`,
6022
+ `matched ${entry.matchedIds.join(", ") || "none"}`,
6023
+ `missing ${entry.missingIds.join(", ") || "none"}`,
6024
+ `extra ${entry.extraIds.join(", ") || "none"}`,
6025
+ `answer ${entry.answerExcerpt || "n/a"}`
6026
+ ].join(" \xB7 ")
6027
+ }))
6028
+ ],
6029
+ summary: [
6030
+ `Best grounded: ${resolveLabel(comparison.summary.bestByStatus)}`,
6031
+ `Best citation F1: ${resolveLabel(comparison.summary.bestByCitationF1)}`,
6032
+ `Best resolved citations: ${resolveLabel(comparison.summary.bestByResolvedCitationRate)}`
6033
+ ].join(" \xB7 ")
6034
+ };
6035
+ });
5959
6036
  var buildRAGEvaluationHistoryRows = (history) => {
5960
6037
  if (!history?.latestRun) {
5961
6038
  return [
@@ -11977,6 +12054,9 @@ export {
11977
12054
  buildRAGRerankerComparisonCardPresentations,
11978
12055
  buildRAGLexicalHaystack,
11979
12056
  buildRAGGroundingReferences,
12057
+ buildRAGGroundingProviderOverviewPresentation,
12058
+ buildRAGGroundingProviderCaseComparisonPresentations,
12059
+ buildRAGGroundingProviderCardPresentations,
11980
12060
  buildRAGGroundedAnswer,
11981
12061
  buildRAGEvaluationRunDiff,
11982
12062
  buildRAGEvaluationResponse,
@@ -12005,5 +12085,5 @@ export {
12005
12085
  aiChat
12006
12086
  };
12007
12087
 
12008
- //# debugId=2339030EC0DDC6EA64756E2164756E21
12088
+ //# debugId=BE389F9A171F073C64756E2164756E21
12009
12089
  //# sourceMappingURL=index.js.map