@retrivora-ai/rag-engine 1.8.4 → 1.8.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.
@@ -353,10 +353,12 @@ var init_MultiTablePostgresProvider = __esm({
353
353
  embedding VECTOR(${this.dimensions})
354
354
  )
355
355
  `);
356
+ const metric = this.config.distanceMetric || "cosine";
357
+ const indexOps = metric === "euclidean" ? "vector_l2_ops" : metric === "dotproduct" ? "vector_ip_ops" : "vector_cosine_ops";
356
358
  await client.query(`
357
359
  CREATE INDEX IF NOT EXISTS ${this.uploadTable}_embedding_idx
358
360
  ON ${this.uploadTable}
359
- USING hnsw (embedding vector_cosine_ops)
361
+ USING hnsw (embedding ${indexOps})
360
362
  `);
361
363
  const res = await client.query(`
362
364
  SELECT table_name
@@ -418,10 +420,12 @@ var init_MultiTablePostgresProvider = __esm({
418
420
  )
419
421
  `;
420
422
  await client.query(createTableSql);
423
+ const metric = this.config.distanceMetric || "cosine";
424
+ const indexOps = metric === "euclidean" ? "vector_l2_ops" : metric === "dotproduct" ? "vector_ip_ops" : "vector_cosine_ops";
421
425
  await client.query(`
422
426
  CREATE INDEX IF NOT EXISTS "${tableName}_embedding_idx"
423
427
  ON "${tableName}"
424
- USING hnsw (embedding vector_cosine_ops)
428
+ USING hnsw (embedding ${indexOps})
425
429
  `);
426
430
  if (!this.tables.includes(tableName)) {
427
431
  this.tables.push(tableName);
@@ -503,6 +507,8 @@ var init_MultiTablePostgresProvider = __esm({
503
507
  try {
504
508
  let sqlQuery = "";
505
509
  let params = [];
510
+ const metric = this.config.distanceMetric || "cosine";
511
+ const scoreExpr = metric === "euclidean" ? `1 / (1 + (embedding <-> $1::vector))` : metric === "dotproduct" ? `(embedding <#> $1::vector) * -1` : `1 - (embedding <=> $1::vector)`;
506
512
  if (queryText) {
507
513
  const hasEntityHints = entityHints.length > 0;
508
514
  const exactNameScoreExpr = hasEntityHints ? `+ (
@@ -515,9 +521,9 @@ var init_MultiTablePostgresProvider = __esm({
515
521
  ) * 3.0` : "";
516
522
  sqlQuery = `
517
523
  SELECT *,
518
- (1 - (embedding <=> $1::vector)) AS vector_score,
524
+ (${scoreExpr}) AS vector_score,
519
525
  COALESCE(ts_rank(to_tsvector('english', (to_jsonb(t) - 'embedding')::text), to_tsquery('english', $2)), 0) AS keyword_score,
520
- ((1 - (embedding <=> $1::vector)) + (COALESCE(ts_rank(to_tsvector('english', (to_jsonb(t) - 'embedding')::text), to_tsquery('english', $2)), 0) * 2.0) ${exactNameScoreExpr}) AS hybrid_score
526
+ ((${scoreExpr}) + (COALESCE(ts_rank(to_tsvector('english', (to_jsonb(t) - 'embedding')::text), to_tsquery('english', $2)), 0) * 2.0) ${exactNameScoreExpr}) AS hybrid_score
521
527
  FROM "${table}" t
522
528
  ORDER BY hybrid_score DESC
523
529
  LIMIT 50
@@ -526,7 +532,7 @@ var init_MultiTablePostgresProvider = __esm({
526
532
  } else {
527
533
  sqlQuery = `
528
534
  SELECT *,
529
- (1 - (embedding <=> $1::vector)) AS hybrid_score
535
+ (${scoreExpr}) AS hybrid_score
530
536
  FROM "${table}" t
531
537
  ORDER BY hybrid_score DESC
532
538
  LIMIT 50
@@ -1000,11 +1006,13 @@ var init_QdrantProvider = __esm({
1000
1006
  if (axios4.isAxiosError(err) && ((_a = err.response) == null ? void 0 : _a.status) === 404) {
1001
1007
  const opts = this.config.options;
1002
1008
  const dimensionsForCreate = opts.dimensions || 1536;
1009
+ const metric = this.config.distanceMetric || "cosine";
1010
+ const distance = metric === "euclidean" ? "Euclid" : metric === "dotproduct" ? "Dot" : "Cosine";
1003
1011
  console.log(`[QdrantProvider] \u23F3 Creating collection "${this.indexName}" (dimensions: ${dimensionsForCreate})...`);
1004
1012
  await this.http.put(`/collections/${this.indexName}`, {
1005
1013
  vectors: {
1006
1014
  size: dimensionsForCreate,
1007
- distance: "Cosine"
1015
+ distance
1008
1016
  }
1009
1017
  });
1010
1018
  console.log(`[QdrantProvider] \u2705 Created collection "${this.indexName}"`);
@@ -1182,9 +1190,12 @@ var init_ChromaDBProvider = __esm({
1182
1190
  console.log(`[ChromaDBProvider] \u2705 Collection "${this.indexName}" found (id: ${this.collectionId})`);
1183
1191
  } catch (err) {
1184
1192
  if (axios5.isAxiosError(err) && ((_a = err.response) == null ? void 0 : _a.status) === 404) {
1193
+ const metric = this.config.distanceMetric || "cosine";
1194
+ const space = metric === "euclidean" ? "l2" : metric === "dotproduct" ? "ip" : "cosine";
1185
1195
  console.log(`[ChromaDBProvider] \u23F3 Collection "${this.indexName}" not found. Creating...`);
1186
1196
  const { data } = await this.http.post("/api/v1/collections", {
1187
- name: this.indexName
1197
+ name: this.indexName,
1198
+ metadata: { "hnsw:space": space }
1188
1199
  });
1189
1200
  this.collectionId = data.id;
1190
1201
  console.log(`[ChromaDBProvider] \u2705 Created collection "${this.indexName}" (id: ${this.collectionId})`);
@@ -4128,18 +4139,20 @@ var UITransformer = class {
4128
4139
  }
4129
4140
  const isStockRequest = this.isStockQuery(userQuery);
4130
4141
  const filteredData = isStockRequest ? retrievedData.filter((item) => this.determineStockStatus(item)) : retrievedData;
4131
- const categories = this.detectCategories(filteredData);
4142
+ const groupByField = this.determineGroupByField(userQuery, filteredData);
4143
+ const categories = this.detectCategories(filteredData, groupByField);
4132
4144
  const hasProducts = filteredData.some((item) => this.isProductData(item));
4133
4145
  const isTimeSeries = filteredData.some((item) => this.isTimeSeriesData(item));
4134
4146
  const isTrendQuery = this.isTrendQuery(userQuery);
4135
4147
  if (isTrendQuery && isTimeSeries) {
4136
4148
  return this.transformToLineChart(filteredData);
4137
4149
  }
4138
- if (hasProducts && !this.shouldShowCategoryChart(userQuery, categories)) {
4150
+ const explicitChartRequest = this.isExplicitChartQuery(userQuery);
4151
+ if (hasProducts && !explicitChartRequest && !this.shouldShowCategoryChart(userQuery)) {
4139
4152
  return this.transformToProductCarousel(filteredData, config, trainedSchema);
4140
4153
  }
4141
- if (categories.length > 1 && this.shouldShowCategoryChart(userQuery, categories)) {
4142
- return this.transformToPieChart(filteredData);
4154
+ if (explicitChartRequest || categories.length > 1 && this.shouldShowCategoryChart(userQuery)) {
4155
+ return this.transformToPieChart(filteredData, groupByField);
4143
4156
  }
4144
4157
  if (hasProducts) {
4145
4158
  return this.transformToProductCarousel(filteredData, config, trainedSchema);
@@ -4164,11 +4177,12 @@ var UITransformer = class {
4164
4177
  /**
4165
4178
  * Transform data to pie chart format
4166
4179
  */
4167
- static transformToPieChart(data) {
4168
- const categories = this.detectCategories(data);
4169
- const categoryData = this.aggregateByCategory(data, categories);
4180
+ static transformToPieChart(data, groupByField) {
4181
+ let categories = this.detectCategories(data, groupByField);
4182
+ if (categories.length === 0) categories = ["All Data"];
4183
+ const categoryData = this.aggregateByCategory(data, categories, groupByField);
4170
4184
  const pieData = Object.entries(categoryData).map(([label, count]) => {
4171
- const { inStockCount, outOfStockCount } = this.calculateStockCounts(label, data);
4185
+ const { inStockCount, outOfStockCount } = this.calculateStockCounts(label, data, groupByField);
4172
4186
  return {
4173
4187
  label,
4174
4188
  value: count,
@@ -4178,7 +4192,7 @@ var UITransformer = class {
4178
4192
  });
4179
4193
  return {
4180
4194
  type: "pie_chart",
4181
- title: "Distribution by Category",
4195
+ title: `Distribution by ${groupByField.charAt(0).toUpperCase() + groupByField.slice(1)}`,
4182
4196
  description: `Showing breakdown across ${categories.length} categories`,
4183
4197
  data: pieData
4184
4198
  };
@@ -4401,10 +4415,11 @@ var UITransformer = class {
4401
4415
  });
4402
4416
  return hasTimeKeyword || hasValidDateValue;
4403
4417
  }
4404
- static shouldShowCategoryChart(query, categories) {
4405
- if (categories.length < 2) {
4406
- return false;
4407
- }
4418
+ static isExplicitChartQuery(query) {
4419
+ const normalized = query.toLowerCase();
4420
+ return normalized.includes("pie chart") || normalized.includes("piechart") || normalized.includes("bar chart") || normalized.includes("barchart") || normalized.includes("radar chart");
4421
+ }
4422
+ static shouldShowCategoryChart(query) {
4408
4423
  const normalized = query.toLowerCase();
4409
4424
  const chartKeywords = [
4410
4425
  "distribution",
@@ -4417,7 +4432,11 @@ var UITransformer = class {
4417
4432
  "segmentation",
4418
4433
  "split",
4419
4434
  "category breakdown",
4420
- "category distribution"
4435
+ "category distribution",
4436
+ "pie chart",
4437
+ "piechart",
4438
+ "bar chart",
4439
+ "barchart"
4421
4440
  ];
4422
4441
  return chartKeywords.some((keyword) => normalized.includes(keyword));
4423
4442
  }
@@ -4493,44 +4512,67 @@ var UITransformer = class {
4493
4512
  return null;
4494
4513
  }
4495
4514
  /**
4496
- * Helper: Detect categories in data
4515
+ * Helper: Dynamically determine what field to group by based on user query
4516
+ */
4517
+ static determineGroupByField(query, data) {
4518
+ const normalized = query.toLowerCase();
4519
+ const match = normalized.match(/(?:by|across|per|based on)\s+([a-zA-Z]+)/i);
4520
+ let targetField = "category";
4521
+ if (match && match[1]) {
4522
+ let field = match[1].toLowerCase();
4523
+ if (field.endsWith("ies")) field = field.replace(/ies$/, "y");
4524
+ else if (field.endsWith("s") && field !== "status") field = field.slice(0, -1);
4525
+ const stopWords = ["the", "all", "different", "various", "some", "these", "those"];
4526
+ if (!stopWords.includes(field)) {
4527
+ targetField = field;
4528
+ }
4529
+ }
4530
+ const hasTargetField = data.some((d) => d.metadata && d.metadata[targetField] !== void 0);
4531
+ if (!hasTargetField && targetField === "category") {
4532
+ if (data.some((d) => d.metadata && d.metadata["type"] !== void 0)) return "type";
4533
+ if (data.some((d) => d.metadata && d.metadata["brand"] !== void 0)) return "brand";
4534
+ }
4535
+ return targetField;
4536
+ }
4537
+ /**
4538
+ * Helper: Detect grouping values dynamically
4497
4539
  */
4498
- static detectCategories(data) {
4540
+ static detectCategories(data, groupByField) {
4499
4541
  const categories = /* @__PURE__ */ new Set();
4500
4542
  data.forEach((item) => {
4501
4543
  const meta = item.metadata || {};
4502
- if (meta.category) {
4503
- categories.add(String(meta.category));
4504
- }
4505
- if (meta.type) {
4506
- categories.add(String(meta.type));
4507
- }
4508
- if (meta.tag) {
4509
- const tags = Array.isArray(meta.tag) ? meta.tag : [meta.tag];
4510
- tags.forEach((t) => categories.add(String(t)));
4511
- }
4512
- const contentCategories = Array.from(new Set(
4513
- Array.from(item.content.matchAll(/^\s*([^:\n]+):\s*(?:•|\*|-)*/gm)).map((match) => match[1].trim()).filter(Boolean)
4514
- ));
4515
- contentCategories.forEach((category) => categories.add(category));
4516
- const categoryMatch = item.content.match(/(?:Category|Type|Class):\s*([^\n]+)/i);
4517
- if (categoryMatch) {
4518
- categories.add(categoryMatch[1].trim());
4544
+ if (meta[groupByField] !== void 0) {
4545
+ const val = meta[groupByField];
4546
+ if (Array.isArray(val)) val.forEach((v) => categories.add(String(v)));
4547
+ else categories.add(String(val));
4548
+ } else if (groupByField === "category") {
4549
+ if (meta.type) categories.add(String(meta.type));
4550
+ if (meta.tag) {
4551
+ const tags = Array.isArray(meta.tag) ? meta.tag : [meta.tag];
4552
+ tags.forEach((t) => categories.add(String(t)));
4553
+ }
4554
+ const categoryMatch = item.content.match(/(?:Category|Type|Class):\s*([^\n]+)/i);
4555
+ if (categoryMatch) categories.add(categoryMatch[1].trim());
4519
4556
  }
4520
4557
  });
4521
4558
  return Array.from(categories);
4522
4559
  }
4523
4560
  /**
4524
- * Helper: Aggregate data by category
4561
+ * Helper: Aggregate data dynamically
4525
4562
  */
4526
- static aggregateByCategory(data, categories) {
4563
+ static aggregateByCategory(data, categories, groupByField) {
4527
4564
  const result = {};
4528
4565
  categories.forEach((cat) => {
4529
4566
  result[cat] = 0;
4530
4567
  });
4531
4568
  data.forEach((item) => {
4532
4569
  const meta = item.metadata || {};
4533
- const itemCategory = meta.category || meta.type || "Other";
4570
+ let itemCategory = "Other";
4571
+ if (meta[groupByField] !== void 0) {
4572
+ itemCategory = String(meta[groupByField]);
4573
+ } else if (groupByField === "category" && meta.type) {
4574
+ itemCategory = String(meta.type);
4575
+ }
4534
4576
  if (Object.prototype.hasOwnProperty.call(result, itemCategory)) {
4535
4577
  result[itemCategory]++;
4536
4578
  } else {
@@ -4580,14 +4622,19 @@ var UITransformer = class {
4580
4622
  });
4581
4623
  }
4582
4624
  /**
4583
- * Helper: Calculate stock counts by category
4625
+ * Helper: Calculate stock counts dynamically
4584
4626
  */
4585
- static calculateStockCounts(category, data) {
4627
+ static calculateStockCounts(category, data, groupByField) {
4586
4628
  let inStock = 0;
4587
4629
  let outOfStock = 0;
4588
4630
  data.forEach((d) => {
4589
4631
  const meta = d.metadata || {};
4590
- const itemCategory = meta.category || meta.type || "Other";
4632
+ let itemCategory = "Other";
4633
+ if (meta[groupByField] !== void 0) {
4634
+ itemCategory = String(meta[groupByField]);
4635
+ } else if (groupByField === "category" && meta.type) {
4636
+ itemCategory = String(meta.type);
4637
+ }
4591
4638
  if (itemCategory === category) {
4592
4639
  if (this.determineStockStatus(d)) {
4593
4640
  inStock++;
@@ -4712,12 +4759,13 @@ DATA SHAPE per type:
4712
4759
  - text: { "content": "<prose answer>" }
4713
4760
 
4714
4761
  DECISION RULES (follow strictly):
4715
- 1. bar_chart \u2192 comparing quantities across categories (e.g. sales by region, price by product). Use this when there is only ONE value per category.
4716
- 2. line_chart \u2192 trends or changes over time (dates, months, years, sequential events)
4717
- 3. pie_chart \u2192 proportional breakdown or percentage distribution
4718
- 4. radar_chart \u2192 comparing 2 or more products across MULTIPLE attributes (e.g. comparing features, ratings, or characteristics of 2 specific products). If the user asks to "compare" products and the data contains multiple dimensions or ratings for them, you MUST use this.
4719
- 5. table \u2192 multi-field structured records where each item has \u2265 3 attributes
4720
- 6. text \u2192 conversational or free-form answers where no chart adds value
4762
+ 1. IF the user explicitly asks for a "pie chart", "bar chart", or "table", you MUST output that exact type. Do not deviate from their request.
4763
+ 2. bar_chart \u2192 comparing quantities across categories (e.g. sales by region, price by product). Use this when there is only ONE value per category.
4764
+ 3. line_chart \u2192 trends or changes over time (dates, months, years, sequential events)
4765
+ 4. pie_chart \u2192 proportional breakdown or percentage distribution
4766
+ 5. radar_chart \u2192 comparing 2 or more products across MULTIPLE attributes.
4767
+ 6. table \u2192 multi-field structured records where each item has \u2265 3 attributes
4768
+ 7. text \u2192 conversational or free-form answers where no chart adds value
4721
4769
 
4722
4770
  IMPORTANT:
4723
4771
  - Aggregate numeric values from the raw data \u2014 do not pass raw object arrays as data.
@@ -1,4 +1,4 @@
1
- import { k as RagConfig, I as ILLMProvider, C as ChatMessage, d as ChatResponse, g as IngestDocument } from './ILLMProvider-BOJFz3Na.js';
1
+ import { k as RagConfig, I as ILLMProvider, C as ChatMessage, d as ChatResponse, g as IngestDocument } from './ILLMProvider-CbUtvWAW.js';
2
2
  import { NextRequest, NextResponse } from 'next/server';
3
3
 
4
4
  interface ValidationError {
@@ -1,4 +1,4 @@
1
- import { k as RagConfig, I as ILLMProvider, C as ChatMessage, d as ChatResponse, g as IngestDocument } from './ILLMProvider-BOJFz3Na.mjs';
1
+ import { k as RagConfig, I as ILLMProvider, C as ChatMessage, d as ChatResponse, g as IngestDocument } from './ILLMProvider-CbUtvWAW.mjs';
2
2
  import { NextRequest, NextResponse } from 'next/server';
3
3
 
4
4
  interface ValidationError {
package/dist/index.css CHANGED
@@ -93,6 +93,7 @@
93
93
  --radius-xl: 0.75rem;
94
94
  --radius-2xl: 1rem;
95
95
  --radius-3xl: 1.5rem;
96
+ --drop-shadow-2xl: 0 25px 25px rgb(0 0 0 / 0.15);
96
97
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
97
98
  --animate-spin: spin 1s linear infinite;
98
99
  --animate-ping: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
@@ -107,6 +108,8 @@
107
108
  --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
108
109
  --default-font-family: var(--font-sans);
109
110
  --default-mono-font-family: var(--font-mono);
111
+ --animate-shapeshift: shapeshift 5s ease-in-out infinite forwards;
112
+ --animate-gradientMove: gradientMove 3.5s ease-in-out infinite alternate;
110
113
  }
111
114
  }
112
115
  @layer base {
@@ -357,6 +360,9 @@
357
360
  .left-6 {
358
361
  left: calc(var(--spacing) * 6);
359
362
  }
363
+ .isolate {
364
+ isolation: isolate;
365
+ }
360
366
  .z-0 {
361
367
  z-index: 0;
362
368
  }
@@ -600,6 +606,9 @@
600
606
  .h-40 {
601
607
  height: calc(var(--spacing) * 40);
602
608
  }
609
+ .h-\[400\%\] {
610
+ height: 400%;
611
+ }
603
612
  .h-\[600px\] {
604
613
  height: 600px;
605
614
  }
@@ -699,6 +708,9 @@
699
708
  .w-40 {
700
709
  width: calc(var(--spacing) * 40);
701
710
  }
711
+ .w-\[400\%\] {
712
+ width: 400%;
713
+ }
702
714
  .w-\[500px\] {
703
715
  width: 500px;
704
716
  }
@@ -1686,6 +1698,11 @@
1686
1698
  --tw-blur: blur(var(--blur-lg));
1687
1699
  filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
1688
1700
  }
1701
+ .drop-shadow-2xl {
1702
+ --tw-drop-shadow-size: drop-shadow(0 25px 25px var(--tw-drop-shadow-color, rgb(0 0 0 / 0.15)));
1703
+ --tw-drop-shadow: drop-shadow(var(--drop-shadow-2xl));
1704
+ filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
1705
+ }
1689
1706
  .filter {
1690
1707
  filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
1691
1708
  }
@@ -1704,6 +1721,11 @@
1704
1721
  -webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
1705
1722
  backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
1706
1723
  }
1724
+ .transition {
1725
+ transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events;
1726
+ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
1727
+ transition-duration: var(--tw-duration, var(--default-transition-duration));
1728
+ }
1707
1729
  .transition-all {
1708
1730
  transition-property: all;
1709
1731
  transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
@@ -1781,6 +1803,27 @@
1781
1803
  }
1782
1804
  }
1783
1805
  }
1806
+ .group-hover\:animate-gradientMove {
1807
+ &:is(:where(.group):hover *) {
1808
+ @media (hover: hover) {
1809
+ animation: var(--animate-gradientMove);
1810
+ }
1811
+ }
1812
+ }
1813
+ .group-hover\:animate-shapeshift {
1814
+ &:is(:where(.group):hover *) {
1815
+ @media (hover: hover) {
1816
+ animation: var(--animate-shapeshift);
1817
+ }
1818
+ }
1819
+ }
1820
+ .group-hover\:rounded-none {
1821
+ &:is(:where(.group):hover *) {
1822
+ @media (hover: hover) {
1823
+ border-radius: 0;
1824
+ }
1825
+ }
1826
+ }
1784
1827
  .group-hover\:border-slate-500 {
1785
1828
  &:is(:where(.group):hover *) {
1786
1829
  @media (hover: hover) {
@@ -2791,6 +2834,86 @@
2791
2834
  }
2792
2835
  }
2793
2836
  }
2837
+ @layer base {
2838
+ :root {
2839
+ --star: shape(
2840
+ evenodd from 50% 24.787%,
2841
+ curve by 7.143% 18.016% with 0% 0% / 2.9725% 13.814%,
2842
+ curve by 17.882% 7.197% with 4.171% 4.2025% / 17.882% 7.197%,
2843
+ curve by -17.882% 8.6765% with 0% 0% / -13.711% 4.474%,
2844
+ curve by -7.143% 16.5365% with -4.1705% 4.202% / -7.143% 16.5365%,
2845
+ curve by -8.6115% -16.5365% with 0% 0% / -4.441% -12.3345%,
2846
+ curve by -16.4135% -8.6765% with -4.171% -4.2025% / -16.4135% -8.6765%,
2847
+ curve by 16.4135% -7.197% with 0% 0% / 12.2425% -2.9945%,
2848
+ curve by 8.6115% -18.016% with 4.1705% -4.202% / 8.6115% -18.016%,
2849
+ close
2850
+ );
2851
+ --flower: shape(
2852
+ evenodd from 17.9665% 82.0335%,
2853
+ curve by -12.349% -32.0335% with -13.239% -5.129% / -18.021% -15.402%,
2854
+ curve by -0.0275% -22.203% with -3.1825% -9.331% / -3.074% -16.6605%,
2855
+ curve by 12.3765% -9.8305% with 2.3835% -4.3365% / 6.565% -7.579%,
2856
+ curve by 32.0335% -12.349% with 5.129% -13.239% / 15.402% -18.021%,
2857
+ curve by 20.4535% -0.8665% with 8.3805% -2.858% / 15.1465% -3.062%,
2858
+ curve by 11.58% 13.2155% with 5.225% 2.161% / 9.0355% 6.6475%,
2859
+ curve by 12.349% 32.0335% with 13.239% 5.129% / 18.021% 15.402%,
2860
+ curve by 0.5715% 21.1275% with 2.9805% 8.7395% / 3.0745% 15.723%,
2861
+ curve by -12.9205% 10.906% with -2.26% 4.88% / -6.638% 8.472%,
2862
+ curve by -32.0335% 12.349% with -5.129% 13.239% / -15.402% 18.021%,
2863
+ curve by -21.1215% 0.5745% with -8.736% 2.9795% / -15.718% 3.0745%,
2864
+ curve by -10.912% -12.9235% with -4.883% -2.2595% / -8.477% -6.6385%,
2865
+ close
2866
+ );
2867
+ --hexagon: shape(
2868
+ evenodd from 6.47% 67.001%,
2869
+ curve by 0% -34.002% with -1.1735% -7.7% / -1.1735% -26.302%,
2870
+ curve by 7.0415% -12.1965% with 0.7075% -4.641% / 3.3765% -9.2635%,
2871
+ curve by 29.447% -17.001% with 6.0815% -4.8665% / 22.192% -14.1675%,
2872
+ curve by 14.083% 0% with 4.3725% -1.708% / 9.7105% -1.708%,
2873
+ curve by 29.447% 17.001% with 7.255% 2.8335% / 23.3655% 12.1345%,
2874
+ curve by 7.0415% 12.1965% with 3.665% 2.933% / 6.334% 7.5555%,
2875
+ curve by 0% 34.002% with 1.1735% 7.7% / 1.1735% 26.302%,
2876
+ curve by -7.0415% 12.1965% with -0.7075% 4.641% / -3.3765% 9.2635%,
2877
+ curve by -29.447% 17.001% with -6.0815% 4.8665% / -22.192% 14.1675%,
2878
+ curve by -14.083% 0% with -4.3725% 1.708% / -9.7105% 1.708%,
2879
+ curve by -29.447% -17.001% with -7.255% -2.8335% / -23.3655% -12.1345%,
2880
+ curve by -7.0415% -12.1965% with -3.665% -2.933% / -6.334% -7.5555%,
2881
+ close
2882
+ );
2883
+ --cylinder: shape(
2884
+ evenodd from 10.5845% 59.7305%,
2885
+ curve by 0% -19.461% with -0.113% -1.7525% / -0.11% -18.14%,
2886
+ curve by 10.098% -26.213% with 0.837% -10.0375% / 3.821% -19.2625%,
2887
+ curve by 29.3175% -13.0215% with 7.2175% -7.992% / 17.682% -13.0215%,
2888
+ curve by 19.5845% 5.185% with 7.1265% 0% / 13.8135% 1.887%,
2889
+ curve by 9.8595% 7.9775% with 3.7065% 2.1185% / 7.035% 4.8195%,
2890
+ curve by 9.9715% 26.072% with 6.2015% 6.933% / 9.4345% 16.082%,
2891
+ curve by 0% 19.461% with 0.074% 1.384% / 0.0745% 17.7715%,
2892
+ curve by -13.0065% 29.1155% with -0.511% 11.5345% / -5.021% 21.933%,
2893
+ curve by -26.409% 10.119% with -6.991% 6.288% / -16.254% 10.119%,
2894
+ curve by -20.945% -5.9995% with -7.6935% 0% / -14.8755% -2.199%,
2895
+ curve by -8.713% -7.404% with -3.255% -2.0385% / -6.1905% -4.537%,
2896
+ curve by -9.7575% -25.831% with -6.074% -6.9035% / -9.1205% -15.963%,
2897
+ close
2898
+ );
2899
+ --circle: shape(
2900
+ evenodd from 13.482% 79.505%,
2901
+ curve by -7.1945% -12.47% with -1.4985% -1.8575% / -6.328% -10.225%,
2902
+ curve by 0.0985% -33.8965% with -4.1645% -10.7945% / -4.1685% -23.0235%,
2903
+ curve by 6.9955% -12.101% with 1.72% -4.3825% / 4.0845% -8.458%,
2904
+ curve by 30.125% -17.119% with 7.339% -9.1825% / 18.4775% -15.5135%,
2905
+ curve by 13.4165% 0.095% with 4.432% -0.6105% / 8.9505% -0.5855%,
2906
+ curve by 29.364% 16.9% with 11.6215% 1.77% / 22.102% 7.9015%,
2907
+ curve by 7.176% 12.4145% with 3.002% 3.7195% / 5.453% 7.968%,
2908
+ curve by -0.0475% 33.8925% with 4.168% 10.756% / 4.2305% 22.942%,
2909
+ curve by -7.1135% 12.2825% with -1.74% 4.4535% / -4.1455% 8.592%,
2910
+ curve by -29.404% 16.9075% with -7.202% 8.954% / -18.019% 15.137%,
2911
+ curve by -14.19% -0.018% with -4.6635% 0.7255% / -9.4575% 0.7205%,
2912
+ curve by -29.226% -16.8875% with -11.573% -1.8065% / -21.9955% -7.9235%,
2913
+ close
2914
+ );
2915
+ }
2916
+ }
2794
2917
  @property --tw-translate-x {
2795
2918
  syntax: "*";
2796
2919
  inherits: false;
@@ -3091,6 +3214,33 @@
3091
3214
  animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
3092
3215
  }
3093
3216
  }
3217
+ @keyframes shapeshift {
3218
+ 0% {
3219
+ clip-path: var(--circle);
3220
+ rotate: 0turn;
3221
+ }
3222
+ 25% {
3223
+ clip-path: var(--flower);
3224
+ }
3225
+ 50% {
3226
+ clip-path: var(--cylinder);
3227
+ }
3228
+ 75% {
3229
+ clip-path: var(--hexagon);
3230
+ }
3231
+ 100% {
3232
+ clip-path: var(--circle);
3233
+ rotate: 1turn;
3234
+ }
3235
+ }
3236
+ @keyframes gradientMove {
3237
+ 0% {
3238
+ translate: 0 0;
3239
+ }
3240
+ 100% {
3241
+ translate: -75% -75%;
3242
+ }
3243
+ }
3094
3244
  @layer properties {
3095
3245
  @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
3096
3246
  *, ::before, ::after, ::backdrop {
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { CSSProperties, MouseEvent, ReactNode } from 'react';
3
- import { P as Product, U as UIConfig, R as RagMessage, V as VectorMatch, O as ObservabilityTrace, a as UseRagChatOptions, b as UseRagChatReturn } from './ILLMProvider-BOJFz3Na.mjs';
4
- export { C as ChatMessage, c as ChatOptions, d as ChatResponse, E as EmbedOptions, e as EmbeddingConfig, f as EmbeddingProvider, I as ILLMProvider, g as IngestDocument, L as LLMConfig, h as LLMProvider, i as LatencyBreakdown, j as RAGConfig, k as RagConfig, l as RetrievedChunk, T as TokenUsage, m as UpsertDocument, n as VectorDBConfig, o as VectorDBProvider } from './ILLMProvider-BOJFz3Na.mjs';
3
+ import { P as Product, U as UIConfig, R as RagMessage, V as VectorMatch, O as ObservabilityTrace, a as UseRagChatOptions, b as UseRagChatReturn } from './ILLMProvider-CbUtvWAW.mjs';
4
+ export { C as ChatMessage, c as ChatOptions, d as ChatResponse, E as EmbedOptions, e as EmbeddingConfig, f as EmbeddingProvider, I as ILLMProvider, g as IngestDocument, L as LLMConfig, h as LLMProvider, i as LatencyBreakdown, j as RAGConfig, k as RagConfig, l as RetrievedChunk, T as TokenUsage, m as UpsertDocument, n as VectorDBConfig, o as VectorDBProvider } from './ILLMProvider-CbUtvWAW.mjs';
5
5
  export { C as Chunk, a as ChunkOptions } from './DocumentChunker-Dh9TvmGG.mjs';
6
6
 
7
7
  type ChatViewportSize = 'compact' | 'medium' | 'large';
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { CSSProperties, MouseEvent, ReactNode } from 'react';
3
- import { P as Product, U as UIConfig, R as RagMessage, V as VectorMatch, O as ObservabilityTrace, a as UseRagChatOptions, b as UseRagChatReturn } from './ILLMProvider-BOJFz3Na.js';
4
- export { C as ChatMessage, c as ChatOptions, d as ChatResponse, E as EmbedOptions, e as EmbeddingConfig, f as EmbeddingProvider, I as ILLMProvider, g as IngestDocument, L as LLMConfig, h as LLMProvider, i as LatencyBreakdown, j as RAGConfig, k as RagConfig, l as RetrievedChunk, T as TokenUsage, m as UpsertDocument, n as VectorDBConfig, o as VectorDBProvider } from './ILLMProvider-BOJFz3Na.js';
3
+ import { P as Product, U as UIConfig, R as RagMessage, V as VectorMatch, O as ObservabilityTrace, a as UseRagChatOptions, b as UseRagChatReturn } from './ILLMProvider-CbUtvWAW.js';
4
+ export { C as ChatMessage, c as ChatOptions, d as ChatResponse, E as EmbedOptions, e as EmbeddingConfig, f as EmbeddingProvider, I as ILLMProvider, g as IngestDocument, L as LLMConfig, h as LLMProvider, i as LatencyBreakdown, j as RAGConfig, k as RagConfig, l as RetrievedChunk, T as TokenUsage, m as UpsertDocument, n as VectorDBConfig, o as VectorDBProvider } from './ILLMProvider-CbUtvWAW.js';
5
5
  export { C as Chunk, a as ChunkOptions } from './DocumentChunker-Dh9TvmGG.js';
6
6
 
7
7
  type ChatViewportSize = 'compact' | 'medium' | 'large';
package/dist/index.js CHANGED
@@ -2975,21 +2975,35 @@ function ChatWidget({ position = "bottom-right", onAddToCart }) {
2975
2975
  "button",
2976
2976
  {
2977
2977
  onClick: isOpen ? () => setIsOpen(false) : handleOpen,
2978
- className: `fixed z-[9999] w-14 h-14 shadow-2xl flex items-center justify-center transition-all duration-300 cursor-pointer hover:scale-110 active:scale-95 ${ui.borderRadius === "full" ? "rounded-full" : "rounded-2xl"} ${positionClass}`,
2979
- style: { background: `linear-gradient(135deg, ${ui.primaryColor}, ${ui.accentColor})` },
2978
+ className: `group fixed z-[9999] w-14 h-14 drop-shadow-2xl flex items-center justify-center transition-all duration-300 cursor-pointer hover:scale-110 active:scale-95 ${positionClass}`,
2980
2979
  "aria-label": "Open chat",
2981
2980
  children: [
2981
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2982
+ "div",
2983
+ {
2984
+ className: `absolute inset-0 transition-all duration-300 overflow-hidden ${ui.borderRadius === "full" ? "rounded-full" : "rounded-2xl"} group-hover:rounded-none group-hover:animate-shapeshift`,
2985
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2986
+ "div",
2987
+ {
2988
+ className: "absolute top-0 left-0 w-[400%] h-[400%] transition-transform duration-300 group-hover:animate-gradientMove",
2989
+ style: {
2990
+ background: `linear-gradient(135deg, ${ui.primaryColor}, ${ui.accentColor}, ${ui.primaryColor}, ${ui.accentColor})`
2991
+ }
2992
+ }
2993
+ )
2994
+ }
2995
+ ),
2982
2996
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2983
2997
  "span",
2984
2998
  {
2985
- className: "absolute inset-0 rounded-full animate-ping opacity-20",
2999
+ className: "absolute inset-0 rounded-full animate-ping opacity-20 pointer-events-none",
2986
3000
  style: { background: ui.primaryColor }
2987
3001
  }
2988
3002
  ),
2989
3003
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2990
3004
  "span",
2991
3005
  {
2992
- className: `transition-transform duration-300 ${isOpen ? "rotate-90 scale-90" : "rotate-0 scale-100"}`,
3006
+ className: `relative z-10 transition-transform duration-300 ${isOpen ? "rotate-90 scale-90" : "rotate-0 scale-100"}`,
2993
3007
  children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react8.X, { className: "w-6 h-6 text-white" }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react8.MessageSquare, { className: "w-6 h-6 text-white" })
2994
3008
  }
2995
3009
  ),
package/dist/index.mjs CHANGED
@@ -2990,21 +2990,35 @@ function ChatWidget({ position = "bottom-right", onAddToCart }) {
2990
2990
  "button",
2991
2991
  {
2992
2992
  onClick: isOpen ? () => setIsOpen(false) : handleOpen,
2993
- className: `fixed z-[9999] w-14 h-14 shadow-2xl flex items-center justify-center transition-all duration-300 cursor-pointer hover:scale-110 active:scale-95 ${ui.borderRadius === "full" ? "rounded-full" : "rounded-2xl"} ${positionClass}`,
2994
- style: { background: `linear-gradient(135deg, ${ui.primaryColor}, ${ui.accentColor})` },
2993
+ className: `group fixed z-[9999] w-14 h-14 drop-shadow-2xl flex items-center justify-center transition-all duration-300 cursor-pointer hover:scale-110 active:scale-95 ${positionClass}`,
2995
2994
  "aria-label": "Open chat",
2996
2995
  children: [
2996
+ /* @__PURE__ */ jsx14(
2997
+ "div",
2998
+ {
2999
+ className: `absolute inset-0 transition-all duration-300 overflow-hidden ${ui.borderRadius === "full" ? "rounded-full" : "rounded-2xl"} group-hover:rounded-none group-hover:animate-shapeshift`,
3000
+ children: /* @__PURE__ */ jsx14(
3001
+ "div",
3002
+ {
3003
+ className: "absolute top-0 left-0 w-[400%] h-[400%] transition-transform duration-300 group-hover:animate-gradientMove",
3004
+ style: {
3005
+ background: `linear-gradient(135deg, ${ui.primaryColor}, ${ui.accentColor}, ${ui.primaryColor}, ${ui.accentColor})`
3006
+ }
3007
+ }
3008
+ )
3009
+ }
3010
+ ),
2997
3011
  /* @__PURE__ */ jsx14(
2998
3012
  "span",
2999
3013
  {
3000
- className: "absolute inset-0 rounded-full animate-ping opacity-20",
3014
+ className: "absolute inset-0 rounded-full animate-ping opacity-20 pointer-events-none",
3001
3015
  style: { background: ui.primaryColor }
3002
3016
  }
3003
3017
  ),
3004
3018
  /* @__PURE__ */ jsx14(
3005
3019
  "span",
3006
3020
  {
3007
- className: `transition-transform duration-300 ${isOpen ? "rotate-90 scale-90" : "rotate-0 scale-100"}`,
3021
+ className: `relative z-10 transition-transform duration-300 ${isOpen ? "rotate-90 scale-90" : "rotate-0 scale-100"}`,
3008
3022
  children: isOpen ? /* @__PURE__ */ jsx14(X3, { className: "w-6 h-6 text-white" }) : /* @__PURE__ */ jsx14(MessageSquare, { className: "w-6 h-6 text-white" })
3009
3023
  }
3010
3024
  ),
package/dist/server.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { n as VectorDBConfig, L as LLMConfig, e as EmbeddingConfig, k as RagConfig, I as ILLMProvider, g as IngestDocument, C as ChatMessage, d as ChatResponse, p as RetrievalResult, m as UpsertDocument, V as VectorMatch, G as GraphDBConfig, q as GraphNode, r as Edge, s as GraphSearchResult, o as VectorDBProvider, h as LLMProvider, f as EmbeddingProvider, j as RAGConfig, U as UIConfig, c as ChatOptions, E as EmbedOptions } from './ILLMProvider-BOJFz3Na.mjs';
1
+ import { n as VectorDBConfig, L as LLMConfig, e as EmbeddingConfig, k as RagConfig, I as ILLMProvider, g as IngestDocument, C as ChatMessage, d as ChatResponse, p as RetrievalResult, m as UpsertDocument, V as VectorMatch, G as GraphDBConfig, q as GraphNode, r as Edge, s as GraphSearchResult, o as VectorDBProvider, h as LLMProvider, f as EmbeddingProvider, j as RAGConfig, U as UIConfig, c as ChatOptions, E as EmbedOptions } from './ILLMProvider-CbUtvWAW.mjs';
2
2
  export { C as Chunk, a as ChunkOptions, D as DocumentChunker } from './DocumentChunker-Dh9TvmGG.mjs';
3
- import { H as HealthCheckResult, I as IProviderValidator, a as IProviderHealthChecker } from './index-D3V9Et2M.mjs';
4
- export { C as ConfigValidator, V as ValidationError, b as VectorPlugin, c as createChatHandler, d as createHealthHandler, e as createIngestHandler, f as createStreamHandler, g as createUploadHandler, s as sseErrorFrame, h as sseFrame, i as sseMetaFrame, j as sseTextFrame } from './index-D3V9Et2M.mjs';
3
+ import { H as HealthCheckResult, I as IProviderValidator, a as IProviderHealthChecker } from './index-c_y_5qdw.mjs';
4
+ export { C as ConfigValidator, V as ValidationError, b as VectorPlugin, c as createChatHandler, d as createHealthHandler, e as createIngestHandler, f as createStreamHandler, g as createUploadHandler, s as sseErrorFrame, h as sseFrame, i as sseMetaFrame, j as sseTextFrame } from './index-c_y_5qdw.mjs';
5
5
  import 'next/server';
6
6
 
7
7
  /**