@retrivora-ai/rag-engine 1.3.4 → 1.3.6

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.
@@ -1705,6 +1705,8 @@ When presenting structured data, statistics, or comparisons, decide if it is bes
1705
1705
  3. dataKeys MUST exactly match the property names in the data objects.
1706
1706
  4. data objects MUST be FLAT (no nested objects or arrays).
1707
1707
  5. DO NOT output naked JSON; it MUST be wrapped in \`\`\`chart ... \`\`\`.
1708
+ 6. The UI HAS a built-in charting engine. NEVER provide Python, Plotly, or Matplotlib code.
1709
+ 7. NEVER apologize or claim you cannot render charts. Simply use the \`\`\`chart\`\`\` block.
1708
1710
  \`\`\`chart
1709
1711
  {
1710
1712
  "type": "bar" | "line" | "pie",
@@ -2268,6 +2270,8 @@ When presenting structured data, statistics, or comparisons, decide if it is bes
2268
2270
  3. dataKeys MUST exactly match the property names in the data objects.
2269
2271
  4. data objects MUST be FLAT (no nested objects or arrays).
2270
2272
  5. DO NOT output naked JSON; it MUST be wrapped in \`\`\`chart ... \`\`\`.
2273
+ 6. The UI HAS a built-in charting engine. NEVER provide Python, Plotly, or Matplotlib code.
2274
+ 7. NEVER apologize or claim you cannot render charts. Simply use the \`\`\`chart\`\`\` block.
2271
2275
  \`\`\`chart
2272
2276
  {
2273
2277
  "type": "bar" | "line" | "pie",
@@ -3274,6 +3274,8 @@ When presenting structured data, statistics, or comparisons, decide if it is bes
3274
3274
  3. dataKeys MUST exactly match the property names in the data objects.
3275
3275
  4. data objects MUST be FLAT (no nested objects or arrays).
3276
3276
  5. DO NOT output naked JSON; it MUST be wrapped in \`\`\`chart ... \`\`\`.
3277
+ 6. The UI HAS a built-in charting engine. NEVER provide Python, Plotly, or Matplotlib code.
3278
+ 7. NEVER apologize or claim you cannot render charts. Simply use the \`\`\`chart\`\`\` block.
3277
3279
  \`\`\`chart
3278
3280
  {
3279
3281
  "type": "bar" | "line" | "pie",
@@ -3831,6 +3833,8 @@ When presenting structured data, statistics, or comparisons, decide if it is bes
3831
3833
  3. dataKeys MUST exactly match the property names in the data objects.
3832
3834
  4. data objects MUST be FLAT (no nested objects or arrays).
3833
3835
  5. DO NOT output naked JSON; it MUST be wrapped in \`\`\`chart ... \`\`\`.
3836
+ 6. The UI HAS a built-in charting engine. NEVER provide Python, Plotly, or Matplotlib code.
3837
+ 7. NEVER apologize or claim you cannot render charts. Simply use the \`\`\`chart\`\`\` block.
3834
3838
  \`\`\`chart
3835
3839
  {
3836
3840
  "type": "bar" | "line" | "pie",
@@ -9,7 +9,7 @@ import {
9
9
  sseFrame,
10
10
  sseMetaFrame,
11
11
  sseTextFrame
12
- } from "../chunk-FQ7OYZLF.mjs";
12
+ } from "../chunk-NVXFI7HX.mjs";
13
13
  import "../chunk-YLTMFW4M.mjs";
14
14
  import "../chunk-X4TOT24V.mjs";
15
15
  export {
package/dist/index.js CHANGED
@@ -381,8 +381,9 @@ function resolveImage(data) {
381
381
  }
382
382
  return void 0;
383
383
  }
384
- function ChartBlock({ rawContent, primaryColor, accentColor }) {
384
+ function ChartBlock({ rawContent, primaryColor, accentColor, isStreaming }) {
385
385
  const result = import_react5.default.useMemo(() => {
386
+ if (isStreaming) return { loading: true };
386
387
  if (!rawContent || rawContent === "undefined") return { error: "Empty chart config." };
387
388
  try {
388
389
  const sanitized = sanitizeJson(rawContent);
@@ -393,7 +394,10 @@ function ChartBlock({ rawContent, primaryColor, accentColor }) {
393
394
  console.error("[ChartBlock] Parsing failed.\nError:", err, "\nSanitized:\n", sanitized);
394
395
  return { error: String(err) };
395
396
  }
396
- }, [rawContent]);
397
+ }, [rawContent, isStreaming]);
398
+ if ("loading" in result) {
399
+ return /* @__PURE__ */ import_react5.default.createElement("div", { className: "my-4 p-8 bg-slate-50 dark:bg-white/5 rounded-xl border border-dashed border-slate-300 dark:border-white/10 flex flex-col items-center justify-center gap-3 select-none" }, /* @__PURE__ */ import_react5.default.createElement("div", { className: "w-6 h-6 border-2 border-indigo-500 border-t-transparent rounded-full animate-spin" }), /* @__PURE__ */ import_react5.default.createElement("p", { className: "text-xs text-slate-500 font-medium animate-pulse" }, "Preparing data visualization..."));
400
+ }
397
401
  if ("error" in result) {
398
402
  return /* @__PURE__ */ import_react5.default.createElement("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 rounded-lg text-sm border border-red-100 dark:border-red-900/30" }, /* @__PURE__ */ import_react5.default.createElement("p", { className: "font-medium mb-1" }, "Failed to render chart"), /* @__PURE__ */ import_react5.default.createElement("p", { className: "opacity-70 text-xs" }, "The generated configuration is invalid. Check the console for details."));
399
403
  }
@@ -524,14 +528,15 @@ function MessageBubble({
524
528
  {
525
529
  rawContent: String(children != null ? children : "").trim(),
526
530
  primaryColor,
527
- accentColor
531
+ accentColor,
532
+ isStreaming
528
533
  }
529
534
  );
530
535
  }
531
536
  return /* @__PURE__ */ import_react5.default.createElement("code", __spreadValues({ className }, props), typeof children === "string" || typeof children === "number" ? children : JSON.stringify(children));
532
537
  }
533
538
  }),
534
- [primaryColor, accentColor]
539
+ [primaryColor, accentColor, isStreaming]
535
540
  );
536
541
  return /* @__PURE__ */ import_react5.default.createElement("div", { className: `flex gap-3 ${isUser ? "flex-row-reverse" : "flex-row"} items-start` }, /* @__PURE__ */ import_react5.default.createElement(
537
542
  "div",
package/dist/index.mjs CHANGED
@@ -344,8 +344,9 @@ function resolveImage(data) {
344
344
  }
345
345
  return void 0;
346
346
  }
347
- function ChartBlock({ rawContent, primaryColor, accentColor }) {
347
+ function ChartBlock({ rawContent, primaryColor, accentColor, isStreaming }) {
348
348
  const result = React5.useMemo(() => {
349
+ if (isStreaming) return { loading: true };
349
350
  if (!rawContent || rawContent === "undefined") return { error: "Empty chart config." };
350
351
  try {
351
352
  const sanitized = sanitizeJson(rawContent);
@@ -356,7 +357,10 @@ function ChartBlock({ rawContent, primaryColor, accentColor }) {
356
357
  console.error("[ChartBlock] Parsing failed.\nError:", err, "\nSanitized:\n", sanitized);
357
358
  return { error: String(err) };
358
359
  }
359
- }, [rawContent]);
360
+ }, [rawContent, isStreaming]);
361
+ if ("loading" in result) {
362
+ return /* @__PURE__ */ React5.createElement("div", { className: "my-4 p-8 bg-slate-50 dark:bg-white/5 rounded-xl border border-dashed border-slate-300 dark:border-white/10 flex flex-col items-center justify-center gap-3 select-none" }, /* @__PURE__ */ React5.createElement("div", { className: "w-6 h-6 border-2 border-indigo-500 border-t-transparent rounded-full animate-spin" }), /* @__PURE__ */ React5.createElement("p", { className: "text-xs text-slate-500 font-medium animate-pulse" }, "Preparing data visualization..."));
363
+ }
360
364
  if ("error" in result) {
361
365
  return /* @__PURE__ */ React5.createElement("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 rounded-lg text-sm border border-red-100 dark:border-red-900/30" }, /* @__PURE__ */ React5.createElement("p", { className: "font-medium mb-1" }, "Failed to render chart"), /* @__PURE__ */ React5.createElement("p", { className: "opacity-70 text-xs" }, "The generated configuration is invalid. Check the console for details."));
362
366
  }
@@ -487,14 +491,15 @@ function MessageBubble({
487
491
  {
488
492
  rawContent: String(children != null ? children : "").trim(),
489
493
  primaryColor,
490
- accentColor
494
+ accentColor,
495
+ isStreaming
491
496
  }
492
497
  );
493
498
  }
494
499
  return /* @__PURE__ */ React5.createElement("code", __spreadValues({ className }, props), typeof children === "string" || typeof children === "number" ? children : JSON.stringify(children));
495
500
  }
496
501
  }),
497
- [primaryColor, accentColor]
502
+ [primaryColor, accentColor, isStreaming]
498
503
  );
499
504
  return /* @__PURE__ */ React5.createElement("div", { className: `flex gap-3 ${isUser ? "flex-row-reverse" : "flex-row"} items-start` }, /* @__PURE__ */ React5.createElement(
500
505
  "div",
package/dist/server.js CHANGED
@@ -3359,6 +3359,8 @@ When presenting structured data, statistics, or comparisons, decide if it is bes
3359
3359
  3. dataKeys MUST exactly match the property names in the data objects.
3360
3360
  4. data objects MUST be FLAT (no nested objects or arrays).
3361
3361
  5. DO NOT output naked JSON; it MUST be wrapped in \`\`\`chart ... \`\`\`.
3362
+ 6. The UI HAS a built-in charting engine. NEVER provide Python, Plotly, or Matplotlib code.
3363
+ 7. NEVER apologize or claim you cannot render charts. Simply use the \`\`\`chart\`\`\` block.
3362
3364
  \`\`\`chart
3363
3365
  {
3364
3366
  "type": "bar" | "line" | "pie",
@@ -3922,6 +3924,8 @@ When presenting structured data, statistics, or comparisons, decide if it is bes
3922
3924
  3. dataKeys MUST exactly match the property names in the data objects.
3923
3925
  4. data objects MUST be FLAT (no nested objects or arrays).
3924
3926
  5. DO NOT output naked JSON; it MUST be wrapped in \`\`\`chart ... \`\`\`.
3927
+ 6. The UI HAS a built-in charting engine. NEVER provide Python, Plotly, or Matplotlib code.
3928
+ 7. NEVER apologize or claim you cannot render charts. Simply use the \`\`\`chart\`\`\` block.
3925
3929
  \`\`\`chart
3926
3930
  {
3927
3931
  "type": "bar" | "line" | "pie",
package/dist/server.mjs CHANGED
@@ -39,7 +39,7 @@ import {
39
39
  sseFrame,
40
40
  sseMetaFrame,
41
41
  sseTextFrame
42
- } from "./chunk-FQ7OYZLF.mjs";
42
+ } from "./chunk-NVXFI7HX.mjs";
43
43
  import "./chunk-YLTMFW4M.mjs";
44
44
  import {
45
45
  PineconeProvider
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@retrivora-ai/rag-engine",
3
- "version": "1.3.4",
3
+ "version": "1.3.6",
4
4
  "description": "Retrivora AI is a plug-and-play AI engine for RAG chat experiences — generic vector DB + LLM provider, embeddable or standalone.",
5
5
  "author": "Abhinav Alkuchi",
6
6
  "license": "MIT",
@@ -110,10 +110,12 @@ interface ChartBlockProps {
110
110
  rawContent: string;
111
111
  primaryColor: string;
112
112
  accentColor: string;
113
+ isStreaming?: boolean;
113
114
  }
114
115
 
115
- function ChartBlock({ rawContent, primaryColor, accentColor }: ChartBlockProps) {
116
- const result = React.useMemo<{ config: ChartConfig } | { error: string }>(() => {
116
+ function ChartBlock({ rawContent, primaryColor, accentColor, isStreaming }: ChartBlockProps) {
117
+ const result = React.useMemo<{ config: ChartConfig } | { error: string } | { loading: boolean }>(() => {
118
+ if (isStreaming) return { loading: true };
117
119
  if (!rawContent || rawContent === 'undefined') return { error: 'Empty chart config.' };
118
120
  try {
119
121
  const sanitized = sanitizeJson(rawContent);
@@ -124,7 +126,16 @@ function ChartBlock({ rawContent, primaryColor, accentColor }: ChartBlockProps)
124
126
  console.error('[ChartBlock] Parsing failed.\nError:', err, '\nSanitized:\n', sanitized);
125
127
  return { error: String(err) };
126
128
  }
127
- }, [rawContent]);
129
+ }, [rawContent, isStreaming]);
130
+
131
+ if ('loading' in result) {
132
+ return (
133
+ <div className="my-4 p-8 bg-slate-50 dark:bg-white/5 rounded-xl border border-dashed border-slate-300 dark:border-white/10 flex flex-col items-center justify-center gap-3 select-none">
134
+ <div className="w-6 h-6 border-2 border-indigo-500 border-t-transparent rounded-full animate-spin" />
135
+ <p className="text-xs text-slate-500 font-medium animate-pulse">Preparing data visualization...</p>
136
+ </div>
137
+ );
138
+ }
128
139
 
129
140
  if ('error' in result) {
130
141
  return (
@@ -269,6 +280,7 @@ export function MessageBubble({
269
280
  rawContent={String(children ?? '').trim()}
270
281
  primaryColor={primaryColor}
271
282
  accentColor={accentColor}
283
+ isStreaming={isStreaming}
272
284
  />
273
285
  );
274
286
  }
@@ -282,7 +294,7 @@ export function MessageBubble({
282
294
  );
283
295
  },
284
296
  }),
285
- [primaryColor, accentColor],
297
+ [primaryColor, accentColor, isStreaming],
286
298
  );
287
299
 
288
300
  // ── Render ─────────────────────────────────────────────────────────────────
@@ -59,6 +59,8 @@ export class LangChainAgent {
59
59
  3. dataKeys MUST exactly match the property names in the data objects.
60
60
  4. data objects MUST be FLAT (no nested objects or arrays).
61
61
  5. DO NOT output naked JSON; it MUST be wrapped in \`\`\`chart ... \`\`\`.
62
+ 6. The UI HAS a built-in charting engine. NEVER provide Python, Plotly, or Matplotlib code.
63
+ 7. NEVER apologize or claim you cannot render charts. Simply use the \`\`\`chart\`\`\` block.
62
64
  \`\`\`chart
63
65
  {
64
66
  "type": "bar" | "line" | "pie",
@@ -109,6 +109,8 @@ export class Pipeline {
109
109
  3. dataKeys MUST exactly match the property names in the data objects.
110
110
  4. data objects MUST be FLAT (no nested objects or arrays).
111
111
  5. DO NOT output naked JSON; it MUST be wrapped in \`\`\`chart ... \`\`\`.
112
+ 6. The UI HAS a built-in charting engine. NEVER provide Python, Plotly, or Matplotlib code.
113
+ 7. NEVER apologize or claim you cannot render charts. Simply use the \`\`\`chart\`\`\` block.
112
114
  \`\`\`chart
113
115
  {
114
116
  "type": "bar" | "line" | "pie",