@absolutejs/absolute 0.19.0-beta.524 → 0.19.0-beta.526

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.
Files changed (53) hide show
  1. package/dist/ai/client/index.js +83 -6
  2. package/dist/ai/client/index.js.map +3 -3
  3. package/dist/ai/index.js +82 -5
  4. package/dist/ai/index.js.map +3 -3
  5. package/dist/ai-client/angular/ai/index.js +880 -862
  6. package/dist/ai-client/react/ai/index.js +24 -24
  7. package/dist/ai-client/vue/ai/index.js +21 -21
  8. package/dist/angular/ai/index.js +873 -855
  9. package/dist/angular/ai/index.js.map +7 -6
  10. package/dist/angular/index.js +2 -2
  11. package/dist/angular/index.js.map +1 -1
  12. package/dist/angular/server.js +2 -2
  13. package/dist/angular/server.js.map +1 -1
  14. package/dist/build.js +2 -2
  15. package/dist/build.js.map +1 -1
  16. package/dist/index.js +2 -2
  17. package/dist/index.js.map +1 -1
  18. package/dist/react/ai/index.js +103 -26
  19. package/dist/react/ai/index.js.map +7 -7
  20. package/dist/src/ai/client/createRAGStream.d.ts +2 -0
  21. package/dist/src/ai/client/createRAGWorkflow.d.ts +3 -0
  22. package/dist/src/ai/client/index.d.ts +8 -7
  23. package/dist/src/ai/index.d.ts +5 -4
  24. package/dist/src/ai/rag/index.d.ts +2 -2
  25. package/dist/src/angular/ai/ai-rag-stream.service.d.ts +1 -1
  26. package/dist/src/angular/ai/ai-rag-workflow.service.d.ts +33 -0
  27. package/dist/src/angular/ai/index.d.ts +2 -1
  28. package/dist/src/react/ai/index.d.ts +6 -3
  29. package/dist/src/react/ai/useRAG.d.ts +3 -2
  30. package/dist/src/svelte/ai/createRAG.d.ts +5 -4
  31. package/dist/src/svelte/ai/createRAGStream.d.ts +1 -1
  32. package/dist/src/svelte/ai/createRAGStreamProgress.d.ts +1 -1
  33. package/dist/src/svelte/ai/createRAGWorkflow.d.ts +1 -1
  34. package/dist/src/svelte/ai/index.d.ts +4 -2
  35. package/dist/src/vue/ai/index.d.ts +5 -3
  36. package/dist/src/vue/ai/useRAG.d.ts +5 -4
  37. package/dist/src/vue/ai/useRAGStream.d.ts +1 -1
  38. package/dist/src/vue/ai/useRAGStreamProgress.d.ts +1 -1
  39. package/dist/src/vue/ai/useRAGWorkflow.d.ts +1 -1
  40. package/dist/svelte/ai/index.js +100 -23
  41. package/dist/svelte/ai/index.js.map +6 -6
  42. package/dist/types/ai.d.ts +11 -0
  43. package/dist/vue/ai/index.js +100 -23
  44. package/dist/vue/ai/index.js.map +7 -7
  45. package/package.json +7 -7
  46. package/dist/src/ai/client/createRAGTransport.d.ts +0 -2
  47. package/dist/src/angular/ai/ai-rag-transport.service.d.ts +0 -1
  48. package/dist/src/react/ai/useRAGTransport.d.ts +0 -2
  49. package/dist/src/react/ai/useRAGTransportProgress.d.ts +0 -2
  50. package/dist/src/svelte/ai/createRAGTransport.d.ts +0 -2
  51. package/dist/src/svelte/ai/createRAGTransportProgress.d.ts +0 -2
  52. package/dist/src/vue/ai/useRAGTransport.d.ts +0 -2
  53. package/dist/src/vue/ai/useRAGTransportProgress.d.ts +0 -2
@@ -1003,6 +1003,17 @@ export type RAGAnswerGroundingCaseDifficultyHistory = {
1003
1003
  latestRun?: RAGAnswerGroundingCaseDifficultyRun;
1004
1004
  previousRun?: RAGAnswerGroundingCaseDifficultyRun;
1005
1005
  diff?: RAGAnswerGroundingCaseDifficultyRunDiff;
1006
+ trends: {
1007
+ hardestCaseIds: string[];
1008
+ easiestCaseIds: string[];
1009
+ mostOftenHarderCaseIds: string[];
1010
+ mostOftenEasierCaseIds: string[];
1011
+ movementCounts: Record<string, {
1012
+ harder: number;
1013
+ easier: number;
1014
+ unchanged: number;
1015
+ }>;
1016
+ };
1006
1017
  };
1007
1018
  export type RAGAnswerGroundingEvaluationCaseDiff = {
1008
1019
  caseId: string;
@@ -1088,7 +1088,7 @@ var useRAGChunkPreview = (path) => {
1088
1088
  };
1089
1089
  };
1090
1090
  // src/vue/ai/useRAG.ts
1091
- import { computed as computed7 } from "vue";
1091
+ import { computed as computed8 } from "vue";
1092
1092
 
1093
1093
  // src/vue/ai/useRAGCitations.ts
1094
1094
  import { computed } from "vue";
@@ -1819,6 +1819,82 @@ var buildGroundingDifficultyDiffEntry = (current, previous) => ({
1819
1819
  previousRank: previous?.rank,
1820
1820
  query: current.query
1821
1821
  });
1822
+ var buildRAGAnswerGroundingCaseDifficultyTrends = ({
1823
+ runs
1824
+ }) => {
1825
+ const movementCounts = new Map;
1826
+ for (let index = 0;index < runs.length - 1; index += 1) {
1827
+ const current = runs[index];
1828
+ const previous = runs[index + 1];
1829
+ if (!current || !previous) {
1830
+ continue;
1831
+ }
1832
+ const diff = buildRAGAnswerGroundingCaseDifficultyRunDiff({
1833
+ current,
1834
+ previous
1835
+ });
1836
+ for (const entry of diff.harderCases) {
1837
+ const currentCounts = movementCounts.get(entry.caseId) ?? {
1838
+ easier: 0,
1839
+ harder: 0,
1840
+ label: entry.label,
1841
+ unchanged: 0
1842
+ };
1843
+ currentCounts.harder += 1;
1844
+ currentCounts.label ??= entry.label;
1845
+ movementCounts.set(entry.caseId, currentCounts);
1846
+ }
1847
+ for (const entry of diff.easierCases) {
1848
+ const currentCounts = movementCounts.get(entry.caseId) ?? {
1849
+ easier: 0,
1850
+ harder: 0,
1851
+ label: entry.label,
1852
+ unchanged: 0
1853
+ };
1854
+ currentCounts.easier += 1;
1855
+ currentCounts.label ??= entry.label;
1856
+ movementCounts.set(entry.caseId, currentCounts);
1857
+ }
1858
+ for (const entry of diff.unchangedCases) {
1859
+ const currentCounts = movementCounts.get(entry.caseId) ?? {
1860
+ easier: 0,
1861
+ harder: 0,
1862
+ label: entry.label,
1863
+ unchanged: 0
1864
+ };
1865
+ currentCounts.unchanged += 1;
1866
+ currentCounts.label ??= entry.label;
1867
+ movementCounts.set(entry.caseId, currentCounts);
1868
+ }
1869
+ }
1870
+ const movementEntries = [...movementCounts.entries()];
1871
+ const mostOftenHarderCaseIds = movementEntries.filter(([, counts]) => counts.harder > 0).sort((left, right) => {
1872
+ if (right[1].harder !== left[1].harder) {
1873
+ return right[1].harder - left[1].harder;
1874
+ }
1875
+ return left[0].localeCompare(right[0]);
1876
+ }).map(([caseId]) => caseId);
1877
+ const mostOftenEasierCaseIds = movementEntries.filter(([, counts]) => counts.easier > 0).sort((left, right) => {
1878
+ if (right[1].easier !== left[1].easier) {
1879
+ return right[1].easier - left[1].easier;
1880
+ }
1881
+ return left[0].localeCompare(right[0]);
1882
+ }).map(([caseId]) => caseId);
1883
+ return {
1884
+ easiestCaseIds: runs[runs.length - 1]?.entries.map((entry) => entry.caseId).reverse() ?? [],
1885
+ hardestCaseIds: runs[0]?.entries.map((entry) => entry.caseId) ?? [],
1886
+ mostOftenEasierCaseIds,
1887
+ mostOftenHarderCaseIds,
1888
+ movementCounts: Object.fromEntries(movementEntries.map(([caseId, counts]) => [
1889
+ caseId,
1890
+ {
1891
+ easier: counts.easier,
1892
+ harder: counts.harder,
1893
+ unchanged: counts.unchanged
1894
+ }
1895
+ ]))
1896
+ };
1897
+ };
1822
1898
  var buildRAGAnswerGroundingCaseDifficultyRunDiff = ({
1823
1899
  current,
1824
1900
  previous
@@ -2157,7 +2233,8 @@ var loadRAGAnswerGroundingCaseDifficultyHistory = async ({
2157
2233
  previousRun,
2158
2234
  runs,
2159
2235
  suiteId: suite.id,
2160
- suiteLabel: suite.label ?? suite.id
2236
+ suiteLabel: suite.label ?? suite.id,
2237
+ trends: buildRAGAnswerGroundingCaseDifficultyTrends({ runs })
2161
2238
  };
2162
2239
  };
2163
2240
  var persistRAGEvaluationSuiteRun = async ({
@@ -3072,6 +3149,9 @@ var useRAGStatus = (path, autoLoad = true) => {
3072
3149
  };
3073
3150
  };
3074
3151
 
3152
+ // src/vue/ai/useRAGWorkflow.ts
3153
+ import { computed as computed7 } from "vue";
3154
+
3075
3155
  // src/vue/ai/useRAGStream.ts
3076
3156
  import { computed as computed6 } from "vue";
3077
3157
 
@@ -3133,6 +3213,17 @@ var useRAGStream = (path, conversationId) => {
3133
3213
  workflow
3134
3214
  };
3135
3215
  };
3216
+
3217
+ // src/vue/ai/useRAGWorkflow.ts
3218
+ var useRAGWorkflow = (path, conversationId) => {
3219
+ const stream = useRAGStream(path, conversationId);
3220
+ const state = computed7(() => stream.workflow.value);
3221
+ return {
3222
+ ...stream,
3223
+ state
3224
+ };
3225
+ };
3226
+
3136
3227
  // src/vue/ai/useRAG.ts
3137
3228
  var useRAG = (path, options = {}) => {
3138
3229
  const search = useRAGSearch(path);
@@ -3143,14 +3234,10 @@ var useRAG = (path, options = {}) => {
3143
3234
  const chunkPreview = useRAGChunkPreview(path);
3144
3235
  const evaluate = useRAGEvaluate(path);
3145
3236
  const index = useRAGIndexAdmin(path);
3146
- const transport = useRAGStream(options.transportPath ?? path, options.conversationId);
3147
- const workflow = {
3148
- ...transport,
3149
- state: computed7(() => transport.workflow.value)
3150
- };
3151
- const sources = useRAGSources(transport.messages);
3237
+ const workflow = useRAGWorkflow(options.streamPath ?? path, options.conversationId);
3238
+ const sources = useRAGSources(workflow.messages);
3152
3239
  const citations = useRAGCitations(sources.sources);
3153
- const grounding = useRAGGrounding(computed7(() => transport.latestAssistantMessage.value?.content ?? ""), sources.sources);
3240
+ const grounding = useRAGGrounding(computed8(() => workflow.latestAssistantMessage.value?.content ?? ""), sources.sources);
3154
3241
  return {
3155
3242
  chunkPreview,
3156
3243
  citations,
@@ -3163,24 +3250,14 @@ var useRAG = (path, options = {}) => {
3163
3250
  search,
3164
3251
  sources,
3165
3252
  status,
3166
- transport,
3253
+ stream: workflow,
3167
3254
  workflow
3168
3255
  };
3169
3256
  };
3170
- // src/vue/ai/useRAGWorkflow.ts
3171
- import { computed as computed8 } from "vue";
3172
- var useRAGWorkflow = (path, conversationId) => {
3173
- const transport = useRAGStream(path, conversationId);
3174
- const state = computed8(() => transport.workflow.value);
3175
- return {
3176
- ...transport,
3177
- state
3178
- };
3179
- };
3180
3257
  export {
3181
3258
  useRAGWorkflow,
3182
- useRAGStreamProgress as useRAGTransportProgress,
3183
- useRAGStream as useRAGTransport,
3259
+ useRAGStreamProgress,
3260
+ useRAGStream,
3184
3261
  useRAGStatus,
3185
3262
  useRAGSources,
3186
3263
  useRAGSearch,
@@ -3197,5 +3274,5 @@ export {
3197
3274
  AIStreamKey
3198
3275
  };
3199
3276
 
3200
- //# debugId=C3E8EFD0B7AD1FB864756E2164756E21
3277
+ //# debugId=3DD3557C9D6FE70C64756E2164756E21
3201
3278
  //# sourceMappingURL=index.js.map