@retrivora-ai/rag-engine 1.2.9 → 1.3.0

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/index.js CHANGED
@@ -409,7 +409,10 @@ function MessageBubble({
409
409
  const match = /language-(\w+)/.exec(className || "");
410
410
  const isChart = match && match[1] === "chart";
411
411
  if (!inline && isChart) {
412
- const rawContent = String(children).trim();
412
+ const rawContent = String(children || "").trim();
413
+ if (!rawContent || rawContent === "undefined") {
414
+ return null;
415
+ }
413
416
  const sanitizeJson = (json) => {
414
417
  return json.replace(/:\s*(\d+(\.\d+)?)\s*([\+\-\*\/])\s*(\d+(\.\d+)?)/g, (_, n1, __, op, n2) => {
415
418
  const v1 = parseFloat(n1);
package/dist/index.mjs CHANGED
@@ -372,7 +372,10 @@ function MessageBubble({
372
372
  const match = /language-(\w+)/.exec(className || "");
373
373
  const isChart = match && match[1] === "chart";
374
374
  if (!inline && isChart) {
375
- const rawContent = String(children).trim();
375
+ const rawContent = String(children || "").trim();
376
+ if (!rawContent || rawContent === "undefined") {
377
+ return null;
378
+ }
376
379
  const sanitizeJson = (json) => {
377
380
  return json.replace(/:\s*(\d+(\.\d+)?)\s*([\+\-\*\/])\s*(\d+(\.\d+)?)/g, (_, n1, __, op, n2) => {
378
381
  const v1 = parseFloat(n1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@retrivora-ai/rag-engine",
3
- "version": "1.2.9",
3
+ "version": "1.3.0",
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,7 +178,11 @@ 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
+ const rawContent = String(children || '').trim();
182
+
183
+ if (!rawContent || rawContent === 'undefined') {
184
+ return null;
185
+ }
182
186
 
183
187
  // Sanitization helper to handle LLM quirks
184
188
  const sanitizeJson = (json: string) => {