@retrivora-ai/rag-engine 1.2.3 → 1.2.4

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.
@@ -1698,7 +1698,8 @@ Sources Used: ${JSON.stringify(
1698
1698
 
1699
1699
  When presenting structured data, statistics, or comparisons, decide if it is best presented as a table or a chart.
1700
1700
  - For tables: use standard Markdown tables.
1701
- - For charts (bar, line, pie): Output a JSON code block with language 'chart' matching this schema:
1701
+ - For charts (bar, line, pie): Output a JSON code block with language 'chart'.
1702
+ - CRITICAL: Use ONLY valid JSON (double quotes, no trailing commas).
1702
1703
  \`\`\`chart
1703
1704
  {
1704
1705
  "type": "bar" | "line" | "pie",
@@ -2255,7 +2256,8 @@ var Pipeline = class {
2255
2256
 
2256
2257
  When presenting structured data, statistics, or comparisons, decide if it is best presented as a table or a chart.
2257
2258
  - For tables: use standard Markdown tables.
2258
- - For charts (bar, line, pie): Output a JSON code block with language 'chart' matching this schema:
2259
+ - For charts (bar, line, pie): Output a JSON code block with language 'chart'.
2260
+ - CRITICAL: Use ONLY valid JSON (double quotes, no trailing commas).
2259
2261
  \`\`\`chart
2260
2262
  {
2261
2263
  "type": "bar" | "line" | "pie",
@@ -3267,7 +3267,8 @@ Sources Used: ${JSON.stringify(
3267
3267
 
3268
3268
  When presenting structured data, statistics, or comparisons, decide if it is best presented as a table or a chart.
3269
3269
  - For tables: use standard Markdown tables.
3270
- - For charts (bar, line, pie): Output a JSON code block with language 'chart' matching this schema:
3270
+ - For charts (bar, line, pie): Output a JSON code block with language 'chart'.
3271
+ - CRITICAL: Use ONLY valid JSON (double quotes, no trailing commas).
3271
3272
  \`\`\`chart
3272
3273
  {
3273
3274
  "type": "bar" | "line" | "pie",
@@ -3818,7 +3819,8 @@ var Pipeline = class {
3818
3819
 
3819
3820
  When presenting structured data, statistics, or comparisons, decide if it is best presented as a table or a chart.
3820
3821
  - For tables: use standard Markdown tables.
3821
- - For charts (bar, line, pie): Output a JSON code block with language 'chart' matching this schema:
3822
+ - For charts (bar, line, pie): Output a JSON code block with language 'chart'.
3823
+ - CRITICAL: Use ONLY valid JSON (double quotes, no trailing commas).
3822
3824
  \`\`\`chart
3823
3825
  {
3824
3826
  "type": "bar" | "line" | "pie",
@@ -9,7 +9,7 @@ import {
9
9
  sseFrame,
10
10
  sseMetaFrame,
11
11
  sseTextFrame
12
- } from "../chunk-WGPNEAK3.mjs";
12
+ } from "../chunk-X4TMJV23.mjs";
13
13
  import "../chunk-YLTMFW4M.mjs";
14
14
  import "../chunk-X4TOT24V.mjs";
15
15
  export {
package/dist/index.js CHANGED
@@ -402,8 +402,9 @@ function MessageBubble({
402
402
  const match = /language-(\w+)/.exec(className || "");
403
403
  const isChart = match && match[1] === "chart";
404
404
  if (!inline && isChart) {
405
+ const rawContent = String(children).trim();
405
406
  try {
406
- const config = JSON.parse(String(children).replace(/\n$/, ""));
407
+ const config = JSON.parse(rawContent);
407
408
  return /* @__PURE__ */ import_react5.default.createElement("div", { className: "my-4 p-4 bg-white dark:bg-slate-900 rounded-xl border border-slate-200 dark:border-white/10 shadow-sm" }, /* @__PURE__ */ import_react5.default.createElement(
408
409
  DynamicChart,
409
410
  {
@@ -412,8 +413,9 @@ function MessageBubble({
412
413
  accentColor
413
414
  }
414
415
  ));
415
- } catch (e) {
416
- 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" }, "Failed to render chart: Invalid configuration.");
416
+ } catch (err) {
417
+ console.error("[MessageBubble] Chart parsing failed:", err, "\nRaw content:", rawContent);
418
+ 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 console for details."));
417
419
  }
418
420
  }
419
421
  return /* @__PURE__ */ import_react5.default.createElement("code", __spreadValues({ className }, props), children);
package/dist/index.mjs CHANGED
@@ -365,8 +365,9 @@ function MessageBubble({
365
365
  const match = /language-(\w+)/.exec(className || "");
366
366
  const isChart = match && match[1] === "chart";
367
367
  if (!inline && isChart) {
368
+ const rawContent = String(children).trim();
368
369
  try {
369
- const config = JSON.parse(String(children).replace(/\n$/, ""));
370
+ const config = JSON.parse(rawContent);
370
371
  return /* @__PURE__ */ React5.createElement("div", { className: "my-4 p-4 bg-white dark:bg-slate-900 rounded-xl border border-slate-200 dark:border-white/10 shadow-sm" }, /* @__PURE__ */ React5.createElement(
371
372
  DynamicChart,
372
373
  {
@@ -375,8 +376,9 @@ function MessageBubble({
375
376
  accentColor
376
377
  }
377
378
  ));
378
- } catch (e) {
379
- 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" }, "Failed to render chart: Invalid configuration.");
379
+ } catch (err) {
380
+ console.error("[MessageBubble] Chart parsing failed:", err, "\nRaw content:", rawContent);
381
+ 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 console for details."));
380
382
  }
381
383
  }
382
384
  return /* @__PURE__ */ React5.createElement("code", __spreadValues({ className }, props), children);
package/dist/server.js CHANGED
@@ -3352,7 +3352,8 @@ Sources Used: ${JSON.stringify(
3352
3352
 
3353
3353
  When presenting structured data, statistics, or comparisons, decide if it is best presented as a table or a chart.
3354
3354
  - For tables: use standard Markdown tables.
3355
- - For charts (bar, line, pie): Output a JSON code block with language 'chart' matching this schema:
3355
+ - For charts (bar, line, pie): Output a JSON code block with language 'chart'.
3356
+ - CRITICAL: Use ONLY valid JSON (double quotes, no trailing commas).
3356
3357
  \`\`\`chart
3357
3358
  {
3358
3359
  "type": "bar" | "line" | "pie",
@@ -3909,7 +3910,8 @@ var Pipeline = class {
3909
3910
 
3910
3911
  When presenting structured data, statistics, or comparisons, decide if it is best presented as a table or a chart.
3911
3912
  - For tables: use standard Markdown tables.
3912
- - For charts (bar, line, pie): Output a JSON code block with language 'chart' matching this schema:
3913
+ - For charts (bar, line, pie): Output a JSON code block with language 'chart'.
3914
+ - CRITICAL: Use ONLY valid JSON (double quotes, no trailing commas).
3913
3915
  \`\`\`chart
3914
3916
  {
3915
3917
  "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-WGPNEAK3.mjs";
42
+ } from "./chunk-X4TMJV23.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.2.3",
3
+ "version": "1.2.4",
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",
@@ -178,8 +178,10 @@ export function MessageBubble({
178
178
  const isChart = match && match[1] === 'chart';
179
179
 
180
180
  if (!inline && isChart) {
181
+ const rawContent = String(children).trim();
181
182
  try {
182
- const config = JSON.parse(String(children).replace(/\n$/, '')) as ChartConfig;
183
+ // Attempt to parse the JSON
184
+ const config = JSON.parse(rawContent) as ChartConfig;
183
185
  return (
184
186
  <div className="my-4 p-4 bg-white dark:bg-slate-900 rounded-xl border border-slate-200 dark:border-white/10 shadow-sm">
185
187
  <DynamicChart
@@ -189,10 +191,12 @@ export function MessageBubble({
189
191
  />
190
192
  </div>
191
193
  );
192
- } catch {
194
+ } catch (err) {
195
+ console.error('[MessageBubble] Chart parsing failed:', err, '\nRaw content:', rawContent);
193
196
  return (
194
- <div className="p-4 bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 rounded-lg text-sm">
195
- Failed to render chart: Invalid configuration.
197
+ <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">
198
+ <p className="font-medium mb-1">Failed to render chart</p>
199
+ <p className="opacity-70 text-xs">The generated configuration is invalid. Check console for details.</p>
196
200
  </div>
197
201
  );
198
202
  }
@@ -52,7 +52,8 @@ export class LangChainAgent {
52
52
 
53
53
  const chartInstruction = `\n\nWhen presenting structured data, statistics, or comparisons, decide if it is best presented as a table or a chart.
54
54
  - For tables: use standard Markdown tables.
55
- - For charts (bar, line, pie): Output a JSON code block with language 'chart' matching this schema:
55
+ - For charts (bar, line, pie): Output a JSON code block with language 'chart'.
56
+ - CRITICAL: Use ONLY valid JSON (double quotes, no trailing commas).
56
57
  \`\`\`chart
57
58
  {
58
59
  "type": "bar" | "line" | "pie",
@@ -102,7 +102,8 @@ export class Pipeline {
102
102
  // Augment system prompt with Chart/Table instructions if not already present
103
103
  const chartInstruction = `\n\nWhen presenting structured data, statistics, or comparisons, decide if it is best presented as a table or a chart.
104
104
  - For tables: use standard Markdown tables.
105
- - For charts (bar, line, pie): Output a JSON code block with language 'chart' matching this schema:
105
+ - For charts (bar, line, pie): Output a JSON code block with language 'chart'.
106
+ - CRITICAL: Use ONLY valid JSON (double quotes, no trailing commas).
106
107
  \`\`\`chart
107
108
  {
108
109
  "type": "bar" | "line" | "pie",