@absolutejs/absolute 0.19.0-beta.508 → 0.19.0-beta.509
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 +15 -3
- package/dist/ai/index.js.map +3 -3
- package/dist/angular/index.js +2 -2
- package/dist/angular/index.js.map +1 -1
- package/dist/angular/server.js +2 -2
- package/dist/angular/server.js.map +1 -1
- package/dist/build.js +2 -2
- package/dist/build.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/ai/index.js
CHANGED
|
@@ -2715,6 +2715,17 @@ var detectDomains = (tokens) => {
|
|
|
2715
2715
|
return [...domains];
|
|
2716
2716
|
};
|
|
2717
2717
|
var uniqueQueryStrings = (values) => Array.from(new Set(values.map((value) => value.trim()).filter((value) => value.length > 0)));
|
|
2718
|
+
var hasExplicitTimestamp = (query) => /\b\d{1,2}:\d{2}\b/.test(query) || /\b\d{1,2}:\d{2}\s*(?:to|-)\s*\d{1,2}:\d{2}\b/i.test(query);
|
|
2719
|
+
var hasNamedSourcePhrase = (query) => /\bnamed\s+[a-z0-9]/i.test(query) || /\btitled\s+[a-z0-9]/i.test(query);
|
|
2720
|
+
var shouldPreservePrimaryQuery = (query, domains) => {
|
|
2721
|
+
if (hasExplicitTimestamp(query) && (domains.includes("audio") || domains.includes("video"))) {
|
|
2722
|
+
return true;
|
|
2723
|
+
}
|
|
2724
|
+
if (hasNamedSourcePhrase(query) && domains.includes("spreadsheet")) {
|
|
2725
|
+
return true;
|
|
2726
|
+
}
|
|
2727
|
+
return false;
|
|
2728
|
+
};
|
|
2718
2729
|
var createHeuristicRAGQueryTransform = (options = {}) => createRAGQueryTransform({
|
|
2719
2730
|
defaultModel: options.defaultModel ?? "absolute-heuristic-query-transform",
|
|
2720
2731
|
providerName: options.providerName ?? "absolute_heuristic",
|
|
@@ -2758,9 +2769,10 @@ var createHeuristicRAGQueryTransform = (options = {}) => createRAGQueryTransform
|
|
|
2758
2769
|
if (mediaTimestampVariant.length > 0) {
|
|
2759
2770
|
variants.push(mediaTimestampVariant);
|
|
2760
2771
|
}
|
|
2772
|
+
const preservePrimaryQuery = shouldPreservePrimaryQuery(query, domains);
|
|
2761
2773
|
return {
|
|
2762
|
-
query: rewrittenQuery,
|
|
2763
|
-
variants: uniqueQueryStrings(variants)
|
|
2774
|
+
query: preservePrimaryQuery ? query : rewrittenQuery,
|
|
2775
|
+
variants: uniqueQueryStrings(preservePrimaryQuery ? [rewrittenQuery, ...variants] : variants)
|
|
2764
2776
|
};
|
|
2765
2777
|
}
|
|
2766
2778
|
});
|
|
@@ -10265,5 +10277,5 @@ export {
|
|
|
10265
10277
|
aiChat
|
|
10266
10278
|
};
|
|
10267
10279
|
|
|
10268
|
-
//# debugId=
|
|
10280
|
+
//# debugId=E4C202F91B1AEC6364756E2164756E21
|
|
10269
10281
|
//# sourceMappingURL=index.js.map
|