@retrivora-ai/rag-engine 2.4.8 → 2.5.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.d.mts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as ChatWidgetProps, a as ChatWindowProps, D as DocumentUploadProps, M as MessageBubbleProps, S as SourceCardProps, b as ConfigProviderProps, c as ClientConfig, P as ProductCardProps, d as ProductCarouselProps, e as ChatViewportSize, R as RemoteConfig } from './BatchProcessor-BZhwvT6o.mjs';
3
- export { A as AuthenticationException, B as BatchOptions, f as BatchProcessor, g as BatchResult, h as ChartType, i as Chunk, j as ChunkOptions, k as CircuitBreaker, l as CircuitBreakerOptions, m as ConfigFetcher, n as ConfigurationException, o as DecisionContext, E as EmbeddingFailedException, I as IRenderRule, p as IRendererStrategy, q as IntentCategory, L as LicenseTierConfig, r as LicenseValidationError, s as LicenseValidationRequest, t as LicenseValidationResponse, u as LicenseValidator, v as ProviderCredentials, w as ProviderNotFoundException, x as RateLimitException, y as RemoteEmbeddingConfig, z as RemoteLLMConfig, F as RemoteVectorConfig, G as RenderDecision, H as RenderType, J as RetrievalException, K as Retrivora, N as RetrivoraError, O as RetrivoraErrorCode, Q as SDKVersionUnsupportedError, T as SDK_VERSION, U as isTransientError } from './BatchProcessor-BZhwvT6o.mjs';
4
- import { O as ObservabilityTrace, P as Product, U as UITransformationResponse, a as UseRagChatOptions, b as UseRagChatReturn, c as ProjectChatSettings } from './ILLMProvider-BYQd0Nys.mjs';
5
- export { A as AuthMode, C as ChatMessage, d as ChatOptions, e as ChatResponse, E as EmbedOptions, f as EmbeddingConfig, g as EmbeddingProvider, I as ILLMProvider, h as IngestDocument, L as LLMConfig, i as LLMProvider, j as LatencyBreakdown, k as ProjectAiSettings, l as ProjectAuthSettings, m as ProjectBrandingSettings, n as ProjectTelemetrySettings, o as ProjectWidgetSettings, R as RAGConfig, p as RagConfig, q as RagMessage, r as RetrievalConfig, s as RetrievedChunk, T as ThemeMode, t as TokenUsage, u as UIConfig, v as UniversalRagConfig, w as UpsertDocument, V as VectorDBConfig, x as VectorDBProvider, y as VectorMatch, W as WidgetPosition, z as WorkflowConfig, B as createDefaultProjectSettings, D as normalizeProjectSettings, F as projectSettingsToUiConfig } from './ILLMProvider-BYQd0Nys.mjs';
2
+ import { C as ChatWidgetProps, a as ChatWindowProps, D as DocumentUploadProps, M as MessageBubbleProps, S as SourceCardProps, b as ConfigProviderProps, c as ClientConfig, P as ProductCardProps, d as ProductCarouselProps, e as ChatViewportSize, R as RemoteConfig } from './BatchProcessor-OVOIlNfK.mjs';
3
+ export { A as AuthenticationException, B as BatchOptions, f as BatchProcessor, g as BatchResult, h as ChartType, i as Chunk, j as ChunkOptions, k as CircuitBreaker, l as CircuitBreakerOptions, m as ConfigFetcher, n as ConfigurationException, o as DecisionContext, E as EmbeddingFailedException, I as IRenderRule, p as IRendererStrategy, q as IntentCategory, L as LicenseTierConfig, r as LicenseValidationError, s as LicenseValidationRequest, t as LicenseValidationResponse, u as LicenseValidator, v as ProviderCredentials, w as ProviderNotFoundException, x as RateLimitException, y as RemoteEmbeddingConfig, z as RemoteLLMConfig, F as RemoteVectorConfig, G as RenderDecision, H as RenderType, J as RetrievalException, K as Retrivora, N as RetrivoraError, O as RetrivoraErrorCode, Q as SDKVersionUnsupportedError, T as SDK_VERSION, U as isTransientError } from './BatchProcessor-OVOIlNfK.mjs';
4
+ import { O as ObservabilityTrace, P as Product, U as UITransformationResponse, a as UseRagChatOptions, b as UseRagChatReturn, c as ProjectChatSettings } from './ILLMProvider-BynaFBpy.mjs';
5
+ export { A as AuthMode, C as ChatMessage, d as ChatOptions, e as ChatResponse, E as EmbedOptions, f as EmbeddingConfig, g as EmbeddingProvider, I as ILLMProvider, h as IngestDocument, L as LLMConfig, i as LLMProvider, j as LatencyBreakdown, k as ProjectAiSettings, l as ProjectAuthSettings, m as ProjectBrandingSettings, n as ProjectTelemetrySettings, o as ProjectWidgetSettings, R as RAGConfig, p as RagConfig, q as RagMessage, r as RetrievalConfig, s as RetrievedChunk, T as ThemeMode, t as TokenUsage, u as UIConfig, v as UniversalRagConfig, w as UpsertDocument, V as VectorDBConfig, x as VectorDBProvider, y as VectorMatch, W as WidgetPosition, z as WorkflowConfig, B as createDefaultProjectSettings, D as normalizeProjectSettings, F as projectSettingsToUiConfig } from './ILLMProvider-BynaFBpy.mjs';
6
6
  import React from 'react';
7
7
 
8
8
  /**
@@ -166,4 +166,36 @@ declare function useProjectSettings(projectId: string, options?: UseProjectSetti
166
166
  */
167
167
  declare function addSynonyms(customSynonyms: Record<string, string[]>): void;
168
168
 
169
- export { ChatWidget, ChatWidgetProps, ChatWindow, ChatWindowProps, ClientConfig, CodeViewer, ConfigProvider, DocumentUpload, DocumentUploadProps, MessageBubble, MessageBubbleProps, ObservabilityPanel, ObservabilityTrace, ProductCard, ProductCardProps, ProductCarousel, ProductCarouselProps, ProjectChatSettings, RemoteConfig, SourceCard, SourceCardProps, type UIBlock, UIBlockRenderer, UIDispatcher, type UseProjectSettingsOptions, type UseProjectSettingsReturn, UseRagChatOptions, UseRagChatReturn, VisualizationRenderer, addSynonyms, useConfig, useProjectSettings, useRagChat };
169
+ interface RetrivoraInitOptions {
170
+ projectId: string;
171
+ licenseKey: string;
172
+ apiBase?: string;
173
+ primaryColor?: string;
174
+ secondaryColor?: string;
175
+ theme?: string;
176
+ }
177
+ declare class RetrivoraBrowserClient {
178
+ projectId: string;
179
+ licenseKey: string;
180
+ apiBase: string;
181
+ primaryColor?: string;
182
+ secondaryColor?: string;
183
+ theme?: string;
184
+ constructor(options?: RetrivoraInitOptions);
185
+ init(options: RetrivoraInitOptions): void;
186
+ chat(message: string, options?: {
187
+ history?: any[];
188
+ namespace?: string;
189
+ }): Promise<{
190
+ reply: any;
191
+ sources: any;
192
+ trace: any;
193
+ ui_transformation: any;
194
+ }>;
195
+ upload(file: File): Promise<any>;
196
+ suggest(query: string): Promise<any>;
197
+ private ensureInitialized;
198
+ }
199
+ declare const retrivora: RetrivoraBrowserClient;
200
+
201
+ export { ChatWidget, ChatWidgetProps, ChatWindow, ChatWindowProps, ClientConfig, CodeViewer, ConfigProvider, DocumentUpload, DocumentUploadProps, MessageBubble, MessageBubbleProps, ObservabilityPanel, ObservabilityTrace, ProductCard, ProductCardProps, ProductCarousel, ProductCarouselProps, ProjectChatSettings, RemoteConfig, type RetrivoraInitOptions, SourceCard, SourceCardProps, type UIBlock, UIBlockRenderer, UIDispatcher, type UseProjectSettingsOptions, type UseProjectSettingsReturn, UseRagChatOptions, UseRagChatReturn, VisualizationRenderer, addSynonyms, retrivora, useConfig, useProjectSettings, useRagChat };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as ChatWidgetProps, a as ChatWindowProps, D as DocumentUploadProps, M as MessageBubbleProps, S as SourceCardProps, b as ConfigProviderProps, c as ClientConfig, P as ProductCardProps, d as ProductCarouselProps, e as ChatViewportSize, R as RemoteConfig } from './BatchProcessor-DlAkfGbv.js';
3
- export { A as AuthenticationException, B as BatchOptions, f as BatchProcessor, g as BatchResult, h as ChartType, i as Chunk, j as ChunkOptions, k as CircuitBreaker, l as CircuitBreakerOptions, m as ConfigFetcher, n as ConfigurationException, o as DecisionContext, E as EmbeddingFailedException, I as IRenderRule, p as IRendererStrategy, q as IntentCategory, L as LicenseTierConfig, r as LicenseValidationError, s as LicenseValidationRequest, t as LicenseValidationResponse, u as LicenseValidator, v as ProviderCredentials, w as ProviderNotFoundException, x as RateLimitException, y as RemoteEmbeddingConfig, z as RemoteLLMConfig, F as RemoteVectorConfig, G as RenderDecision, H as RenderType, J as RetrievalException, K as Retrivora, N as RetrivoraError, O as RetrivoraErrorCode, Q as SDKVersionUnsupportedError, T as SDK_VERSION, U as isTransientError } from './BatchProcessor-DlAkfGbv.js';
4
- import { O as ObservabilityTrace, P as Product, U as UITransformationResponse, a as UseRagChatOptions, b as UseRagChatReturn, c as ProjectChatSettings } from './ILLMProvider-BYQd0Nys.js';
5
- export { A as AuthMode, C as ChatMessage, d as ChatOptions, e as ChatResponse, E as EmbedOptions, f as EmbeddingConfig, g as EmbeddingProvider, I as ILLMProvider, h as IngestDocument, L as LLMConfig, i as LLMProvider, j as LatencyBreakdown, k as ProjectAiSettings, l as ProjectAuthSettings, m as ProjectBrandingSettings, n as ProjectTelemetrySettings, o as ProjectWidgetSettings, R as RAGConfig, p as RagConfig, q as RagMessage, r as RetrievalConfig, s as RetrievedChunk, T as ThemeMode, t as TokenUsage, u as UIConfig, v as UniversalRagConfig, w as UpsertDocument, V as VectorDBConfig, x as VectorDBProvider, y as VectorMatch, W as WidgetPosition, z as WorkflowConfig, B as createDefaultProjectSettings, D as normalizeProjectSettings, F as projectSettingsToUiConfig } from './ILLMProvider-BYQd0Nys.js';
2
+ import { C as ChatWidgetProps, a as ChatWindowProps, D as DocumentUploadProps, M as MessageBubbleProps, S as SourceCardProps, b as ConfigProviderProps, c as ClientConfig, P as ProductCardProps, d as ProductCarouselProps, e as ChatViewportSize, R as RemoteConfig } from './BatchProcessor-B8OLSahY.js';
3
+ export { A as AuthenticationException, B as BatchOptions, f as BatchProcessor, g as BatchResult, h as ChartType, i as Chunk, j as ChunkOptions, k as CircuitBreaker, l as CircuitBreakerOptions, m as ConfigFetcher, n as ConfigurationException, o as DecisionContext, E as EmbeddingFailedException, I as IRenderRule, p as IRendererStrategy, q as IntentCategory, L as LicenseTierConfig, r as LicenseValidationError, s as LicenseValidationRequest, t as LicenseValidationResponse, u as LicenseValidator, v as ProviderCredentials, w as ProviderNotFoundException, x as RateLimitException, y as RemoteEmbeddingConfig, z as RemoteLLMConfig, F as RemoteVectorConfig, G as RenderDecision, H as RenderType, J as RetrievalException, K as Retrivora, N as RetrivoraError, O as RetrivoraErrorCode, Q as SDKVersionUnsupportedError, T as SDK_VERSION, U as isTransientError } from './BatchProcessor-B8OLSahY.js';
4
+ import { O as ObservabilityTrace, P as Product, U as UITransformationResponse, a as UseRagChatOptions, b as UseRagChatReturn, c as ProjectChatSettings } from './ILLMProvider-BynaFBpy.js';
5
+ export { A as AuthMode, C as ChatMessage, d as ChatOptions, e as ChatResponse, E as EmbedOptions, f as EmbeddingConfig, g as EmbeddingProvider, I as ILLMProvider, h as IngestDocument, L as LLMConfig, i as LLMProvider, j as LatencyBreakdown, k as ProjectAiSettings, l as ProjectAuthSettings, m as ProjectBrandingSettings, n as ProjectTelemetrySettings, o as ProjectWidgetSettings, R as RAGConfig, p as RagConfig, q as RagMessage, r as RetrievalConfig, s as RetrievedChunk, T as ThemeMode, t as TokenUsage, u as UIConfig, v as UniversalRagConfig, w as UpsertDocument, V as VectorDBConfig, x as VectorDBProvider, y as VectorMatch, W as WidgetPosition, z as WorkflowConfig, B as createDefaultProjectSettings, D as normalizeProjectSettings, F as projectSettingsToUiConfig } from './ILLMProvider-BynaFBpy.js';
6
6
  import React from 'react';
7
7
 
8
8
  /**
@@ -166,4 +166,36 @@ declare function useProjectSettings(projectId: string, options?: UseProjectSetti
166
166
  */
167
167
  declare function addSynonyms(customSynonyms: Record<string, string[]>): void;
168
168
 
169
- export { ChatWidget, ChatWidgetProps, ChatWindow, ChatWindowProps, ClientConfig, CodeViewer, ConfigProvider, DocumentUpload, DocumentUploadProps, MessageBubble, MessageBubbleProps, ObservabilityPanel, ObservabilityTrace, ProductCard, ProductCardProps, ProductCarousel, ProductCarouselProps, ProjectChatSettings, RemoteConfig, SourceCard, SourceCardProps, type UIBlock, UIBlockRenderer, UIDispatcher, type UseProjectSettingsOptions, type UseProjectSettingsReturn, UseRagChatOptions, UseRagChatReturn, VisualizationRenderer, addSynonyms, useConfig, useProjectSettings, useRagChat };
169
+ interface RetrivoraInitOptions {
170
+ projectId: string;
171
+ licenseKey: string;
172
+ apiBase?: string;
173
+ primaryColor?: string;
174
+ secondaryColor?: string;
175
+ theme?: string;
176
+ }
177
+ declare class RetrivoraBrowserClient {
178
+ projectId: string;
179
+ licenseKey: string;
180
+ apiBase: string;
181
+ primaryColor?: string;
182
+ secondaryColor?: string;
183
+ theme?: string;
184
+ constructor(options?: RetrivoraInitOptions);
185
+ init(options: RetrivoraInitOptions): void;
186
+ chat(message: string, options?: {
187
+ history?: any[];
188
+ namespace?: string;
189
+ }): Promise<{
190
+ reply: any;
191
+ sources: any;
192
+ trace: any;
193
+ ui_transformation: any;
194
+ }>;
195
+ upload(file: File): Promise<any>;
196
+ suggest(query: string): Promise<any>;
197
+ private ensureInitialized;
198
+ }
199
+ declare const retrivora: RetrivoraBrowserClient;
200
+
201
+ export { ChatWidget, ChatWidgetProps, ChatWindow, ChatWindowProps, ClientConfig, CodeViewer, ConfigProvider, DocumentUpload, DocumentUploadProps, MessageBubble, MessageBubbleProps, ObservabilityPanel, ObservabilityTrace, ProductCard, ProductCardProps, ProductCarousel, ProductCarouselProps, ProjectChatSettings, RemoteConfig, type RetrivoraInitOptions, SourceCard, SourceCardProps, type UIBlock, UIBlockRenderer, UIDispatcher, type UseProjectSettingsOptions, type UseProjectSettingsReturn, UseRagChatOptions, UseRagChatReturn, VisualizationRenderer, addSynonyms, retrivora, useConfig, useProjectSettings, useRagChat };
package/dist/index.js CHANGED
@@ -92,6 +92,7 @@ __export(index_exports, {
92
92
  isTransientError: () => isTransientError,
93
93
  normalizeProjectSettings: () => normalizeProjectSettings,
94
94
  projectSettingsToUiConfig: () => projectSettingsToUiConfig,
95
+ retrivora: () => retrivora,
95
96
  useConfig: () => useConfig,
96
97
  useProjectSettings: () => useProjectSettings,
97
98
  useRagChat: () => useRagChat
@@ -356,7 +357,7 @@ function projectSettingsToUiConfig(settings) {
356
357
  // package.json
357
358
  var package_default = {
358
359
  name: "@retrivora-ai/rag-engine",
359
- version: "2.4.8",
360
+ version: "2.5.0",
360
361
  description: "Retrivora AI is a plug-and-play AI engine for RAG chat experiences \u2014 generic vector DB + LLM provider, embeddable or standalone.",
361
362
  author: "Abhinav Alkuchi",
362
363
  license: "UNLICENSED",
@@ -5824,6 +5825,98 @@ ${errorMessages}`
5824
5825
  return { results, errors, totalProcessed, totalFailed };
5825
5826
  }
5826
5827
  };
5828
+
5829
+ // src/core/RetrivoraBrowserClient.ts
5830
+ var RetrivoraBrowserClient = class {
5831
+ constructor(options) {
5832
+ this.projectId = "";
5833
+ this.licenseKey = "";
5834
+ this.apiBase = "https://www.retrivora.com/api";
5835
+ if (options) {
5836
+ this.init(options);
5837
+ }
5838
+ }
5839
+ init(options) {
5840
+ this.projectId = options.projectId;
5841
+ this.licenseKey = options.licenseKey;
5842
+ this.primaryColor = options.primaryColor;
5843
+ this.secondaryColor = options.secondaryColor;
5844
+ this.theme = options.theme;
5845
+ if (options.apiBase) {
5846
+ this.apiBase = options.apiBase;
5847
+ } else if (typeof window !== "undefined") {
5848
+ this.apiBase = `${window.location.origin}/api`;
5849
+ }
5850
+ }
5851
+ async chat(message, options) {
5852
+ var _a, _b, _c;
5853
+ this.ensureInitialized();
5854
+ const res = await fetch(`${this.apiBase}/v1/chat/completions`, {
5855
+ method: "POST",
5856
+ headers: {
5857
+ "Content-Type": "application/json",
5858
+ "Authorization": `Bearer ${this.licenseKey}`,
5859
+ "X-Project-Id": this.projectId
5860
+ },
5861
+ body: JSON.stringify({
5862
+ messages: [
5863
+ ...(options == null ? void 0 : options.history) || [],
5864
+ { role: "user", content: message }
5865
+ ],
5866
+ model: "llama-3.1-8b-instant",
5867
+ stream: false
5868
+ })
5869
+ });
5870
+ if (!res.ok) {
5871
+ const errData = await res.json().catch(() => ({}));
5872
+ throw new Error(errData.error || `Chat completions failed with status: ${res.status}`);
5873
+ }
5874
+ const data = await res.json();
5875
+ return {
5876
+ reply: ((_c = (_b = (_a = data.choices) == null ? void 0 : _a[0]) == null ? void 0 : _b.message) == null ? void 0 : _c.content) || "",
5877
+ sources: data.sources || [],
5878
+ trace: data.trace || null,
5879
+ ui_transformation: data.ui_transformation || null
5880
+ };
5881
+ }
5882
+ async upload(file) {
5883
+ this.ensureInitialized();
5884
+ const formData = new FormData();
5885
+ formData.append("file", file);
5886
+ formData.append("projectId", this.projectId);
5887
+ const res = await fetch(`${this.apiBase}/upload`, {
5888
+ method: "POST",
5889
+ headers: {
5890
+ "Authorization": `Bearer ${this.licenseKey}`
5891
+ },
5892
+ body: formData
5893
+ });
5894
+ if (!res.ok) {
5895
+ const errData = await res.json().catch(() => ({}));
5896
+ throw new Error(errData.error || `Upload failed with status: ${res.status}`);
5897
+ }
5898
+ return res.json();
5899
+ }
5900
+ async suggest(query) {
5901
+ this.ensureInitialized();
5902
+ const res = await fetch(`${this.apiBase}/suggestions?q=${encodeURIComponent(query)}&projectId=${this.projectId}`, {
5903
+ headers: {
5904
+ "Authorization": `Bearer ${this.licenseKey}`
5905
+ }
5906
+ });
5907
+ if (!res.ok) {
5908
+ const errData = await res.json().catch(() => ({}));
5909
+ throw new Error(errData.error || `Suggestions fetch failed with status: ${res.status}`);
5910
+ }
5911
+ return res.json();
5912
+ }
5913
+ ensureInitialized() {
5914
+ if (!this.projectId || !this.licenseKey) {
5915
+ throw new Error("[Retrivora SDK] Client not initialized. Run retrivora.init({ projectId, licenseKey }) first.");
5916
+ }
5917
+ }
5918
+ };
5919
+ var retrivora = new RetrivoraBrowserClient();
5827
5920
  // Annotate the CommonJS export names for ESM import in node:
5828
5921
  0 && (module.exports = {
5829
5922
  AuthenticationException,
@@ -5858,6 +5951,7 @@ ${errorMessages}`
5858
5951
  isTransientError,
5859
5952
  normalizeProjectSettings,
5860
5953
  projectSettingsToUiConfig,
5954
+ retrivora,
5861
5955
  useConfig,
5862
5956
  useProjectSettings,
5863
5957
  useRagChat
package/dist/index.mjs CHANGED
@@ -312,7 +312,7 @@ function projectSettingsToUiConfig(settings) {
312
312
  // package.json
313
313
  var package_default = {
314
314
  name: "@retrivora-ai/rag-engine",
315
- version: "2.4.8",
315
+ version: "2.5.0",
316
316
  description: "Retrivora AI is a plug-and-play AI engine for RAG chat experiences \u2014 generic vector DB + LLM provider, embeddable or standalone.",
317
317
  author: "Abhinav Alkuchi",
318
318
  license: "UNLICENSED",
@@ -5826,6 +5826,98 @@ ${errorMessages}`
5826
5826
  return { results, errors, totalProcessed, totalFailed };
5827
5827
  }
5828
5828
  };
5829
+
5830
+ // src/core/RetrivoraBrowserClient.ts
5831
+ var RetrivoraBrowserClient = class {
5832
+ constructor(options) {
5833
+ this.projectId = "";
5834
+ this.licenseKey = "";
5835
+ this.apiBase = "https://www.retrivora.com/api";
5836
+ if (options) {
5837
+ this.init(options);
5838
+ }
5839
+ }
5840
+ init(options) {
5841
+ this.projectId = options.projectId;
5842
+ this.licenseKey = options.licenseKey;
5843
+ this.primaryColor = options.primaryColor;
5844
+ this.secondaryColor = options.secondaryColor;
5845
+ this.theme = options.theme;
5846
+ if (options.apiBase) {
5847
+ this.apiBase = options.apiBase;
5848
+ } else if (typeof window !== "undefined") {
5849
+ this.apiBase = `${window.location.origin}/api`;
5850
+ }
5851
+ }
5852
+ async chat(message, options) {
5853
+ var _a, _b, _c;
5854
+ this.ensureInitialized();
5855
+ const res = await fetch(`${this.apiBase}/v1/chat/completions`, {
5856
+ method: "POST",
5857
+ headers: {
5858
+ "Content-Type": "application/json",
5859
+ "Authorization": `Bearer ${this.licenseKey}`,
5860
+ "X-Project-Id": this.projectId
5861
+ },
5862
+ body: JSON.stringify({
5863
+ messages: [
5864
+ ...(options == null ? void 0 : options.history) || [],
5865
+ { role: "user", content: message }
5866
+ ],
5867
+ model: "llama-3.1-8b-instant",
5868
+ stream: false
5869
+ })
5870
+ });
5871
+ if (!res.ok) {
5872
+ const errData = await res.json().catch(() => ({}));
5873
+ throw new Error(errData.error || `Chat completions failed with status: ${res.status}`);
5874
+ }
5875
+ const data = await res.json();
5876
+ return {
5877
+ reply: ((_c = (_b = (_a = data.choices) == null ? void 0 : _a[0]) == null ? void 0 : _b.message) == null ? void 0 : _c.content) || "",
5878
+ sources: data.sources || [],
5879
+ trace: data.trace || null,
5880
+ ui_transformation: data.ui_transformation || null
5881
+ };
5882
+ }
5883
+ async upload(file) {
5884
+ this.ensureInitialized();
5885
+ const formData = new FormData();
5886
+ formData.append("file", file);
5887
+ formData.append("projectId", this.projectId);
5888
+ const res = await fetch(`${this.apiBase}/upload`, {
5889
+ method: "POST",
5890
+ headers: {
5891
+ "Authorization": `Bearer ${this.licenseKey}`
5892
+ },
5893
+ body: formData
5894
+ });
5895
+ if (!res.ok) {
5896
+ const errData = await res.json().catch(() => ({}));
5897
+ throw new Error(errData.error || `Upload failed with status: ${res.status}`);
5898
+ }
5899
+ return res.json();
5900
+ }
5901
+ async suggest(query) {
5902
+ this.ensureInitialized();
5903
+ const res = await fetch(`${this.apiBase}/suggestions?q=${encodeURIComponent(query)}&projectId=${this.projectId}`, {
5904
+ headers: {
5905
+ "Authorization": `Bearer ${this.licenseKey}`
5906
+ }
5907
+ });
5908
+ if (!res.ok) {
5909
+ const errData = await res.json().catch(() => ({}));
5910
+ throw new Error(errData.error || `Suggestions fetch failed with status: ${res.status}`);
5911
+ }
5912
+ return res.json();
5913
+ }
5914
+ ensureInitialized() {
5915
+ if (!this.projectId || !this.licenseKey) {
5916
+ throw new Error("[Retrivora SDK] Client not initialized. Run retrivora.init({ projectId, licenseKey }) first.");
5917
+ }
5918
+ }
5919
+ };
5920
+ var retrivora = new RetrivoraBrowserClient();
5829
5921
  export {
5830
5922
  AuthenticationException,
5831
5923
  BatchProcessor,
@@ -5859,6 +5951,7 @@ export {
5859
5951
  isTransientError,
5860
5952
  normalizeProjectSettings,
5861
5953
  projectSettingsToUiConfig,
5954
+ retrivora,
5862
5955
  useConfig,
5863
5956
  useProjectSettings,
5864
5957
  useRagChat
package/dist/server.d.mts CHANGED
@@ -1,9 +1,9 @@
1
- import { V as VectorDBConfig, L as LLMConfig, f as EmbeddingConfig, p as RagConfig, v as UniversalRagConfig, w as UpsertDocument, y as VectorMatch, G as GraphDBConfig, H as GraphNode, J as Edge, K as GraphSearchResult, I as ILLMProvider, x as VectorDBProvider, i as LLMProvider, g as EmbeddingProvider, R as RAGConfig, u as UIConfig, U as UITransformationResponse, C as ChatMessage, d as ChatOptions, E as EmbedOptions, h as IngestDocument, e as ChatResponse } from './ILLMProvider-BYQd0Nys.mjs';
2
- export { A as AuthMode, M as BarChartData, N as CarouselProduct, Q as IRetriever, j as LatencyBreakdown, S as LineChartDataPoint, X as MessageRole, Y as MetricCardData, O as ObservabilityTrace, Z as PieChartData, P as Product, k as ProjectAiSettings, l as ProjectAuthSettings, m as ProjectBrandingSettings, c as ProjectChatSettings, n as ProjectTelemetrySettings, o as ProjectWidgetSettings, q as RagMessage, r as RetrievalConfig, _ as RetrievalResult, s as RetrievedChunk, $ as RetrivoraChunkMetadata, a0 as RetrivoraIngestedDocument, a1 as ScatterPlotDataPoint, a2 as SuggestionsResponse, a3 as TableData, T as ThemeMode, t as TokenUsage, a as UseRagChatOptions, b as UseRagChatReturn, a4 as VisualizationType, W as WidgetPosition, z as WorkflowConfig, B as createDefaultProjectSettings, D as normalizeProjectSettings, F as projectSettingsToUiConfig } from './ILLMProvider-BYQd0Nys.mjs';
3
- import { o as DecisionContext, q as IntentCategory, I as IRenderRule, G as RenderDecision, p as IRendererStrategy } from './BatchProcessor-BZhwvT6o.mjs';
4
- export { V as ArchitectureCardProps, A as AuthenticationException, B as BatchOptions, f as BatchProcessor, g as BatchResult, h as ChartType, e as ChatViewportSize, C as ChatWidgetProps, a as ChatWindowProps, i as Chunk, j as ChunkOptions, c as ClientConfig, m as ConfigFetcher, b as ConfigProviderProps, n as ConfigurationException, W as DocumentChunker, D as DocumentUploadProps, E as EmbeddingFailedException, X as LicenseConfigResolver, L as LicenseTierConfig, r as LicenseValidationError, s as LicenseValidationRequest, t as LicenseValidationResponse, u as LicenseValidator, M as MessageBubbleProps, Y as Pipeline, Z as PipelineStep, P as ProductCardProps, d as ProductCarouselProps, v as ProviderCredentials, w as ProviderNotFoundException, _ as ProviderPill, x as RateLimitException, R as RemoteConfig, y as RemoteEmbeddingConfig, z as RemoteLLMConfig, F as RemoteVectorConfig, $ as RenderSectionDecision, H as RenderType, J as RetrievalException, K as Retrivora, N as RetrivoraError, O as RetrivoraErrorCode, Q as SDKVersionUnsupportedError, T as SDK_VERSION, a0 as Snippet, S as SourceCardProps, a1 as wrapError } from './BatchProcessor-BZhwvT6o.mjs';
5
- import { H as HealthCheckResult, I as IProviderValidator, a as IProviderHealthChecker } from './index-BTLsJ0da.mjs';
6
- export { C as ConfigValidator, b as HandlerOptions, V as ValidationError, c as VectorPlugin, d as createChatHandler, e as createFeedbackHandler, f as createHealthHandler, g as createHistoryHandler, h as createIngestHandler, i as createRagHandler, j as createSessionsHandler, k as createStreamHandler, l as createUploadHandler, s as sseErrorFrame, m as sseFrame, n as sseMetaFrame, o as sseTextFrame } from './index-BTLsJ0da.mjs';
1
+ import { V as VectorDBConfig, L as LLMConfig, f as EmbeddingConfig, p as RagConfig, v as UniversalRagConfig, w as UpsertDocument, y as VectorMatch, G as GraphDBConfig, H as GraphNode, J as Edge, K as GraphSearchResult, I as ILLMProvider, x as VectorDBProvider, i as LLMProvider, g as EmbeddingProvider, R as RAGConfig, u as UIConfig, U as UITransformationResponse, C as ChatMessage, d as ChatOptions, E as EmbedOptions, h as IngestDocument, e as ChatResponse } from './ILLMProvider-BynaFBpy.mjs';
2
+ export { A as AuthMode, M as BarChartData, N as CarouselProduct, Q as IRetriever, j as LatencyBreakdown, S as LineChartDataPoint, X as MessageRole, Y as MetricCardData, O as ObservabilityTrace, Z as PieChartData, P as Product, k as ProjectAiSettings, l as ProjectAuthSettings, m as ProjectBrandingSettings, c as ProjectChatSettings, n as ProjectTelemetrySettings, o as ProjectWidgetSettings, q as RagMessage, r as RetrievalConfig, _ as RetrievalResult, s as RetrievedChunk, $ as RetrivoraChunkMetadata, a0 as RetrivoraIngestedDocument, a1 as ScatterPlotDataPoint, a2 as SuggestionsResponse, a3 as TableData, T as ThemeMode, t as TokenUsage, a as UseRagChatOptions, b as UseRagChatReturn, a4 as VisualizationType, W as WidgetPosition, z as WorkflowConfig, B as createDefaultProjectSettings, D as normalizeProjectSettings, F as projectSettingsToUiConfig } from './ILLMProvider-BynaFBpy.mjs';
3
+ import { o as DecisionContext, q as IntentCategory, I as IRenderRule, G as RenderDecision, p as IRendererStrategy } from './BatchProcessor-OVOIlNfK.mjs';
4
+ export { V as ArchitectureCardProps, A as AuthenticationException, B as BatchOptions, f as BatchProcessor, g as BatchResult, h as ChartType, e as ChatViewportSize, C as ChatWidgetProps, a as ChatWindowProps, i as Chunk, j as ChunkOptions, c as ClientConfig, m as ConfigFetcher, b as ConfigProviderProps, n as ConfigurationException, W as DocumentChunker, D as DocumentUploadProps, E as EmbeddingFailedException, X as LicenseConfigResolver, L as LicenseTierConfig, r as LicenseValidationError, s as LicenseValidationRequest, t as LicenseValidationResponse, u as LicenseValidator, M as MessageBubbleProps, Y as Pipeline, Z as PipelineStep, P as ProductCardProps, d as ProductCarouselProps, v as ProviderCredentials, w as ProviderNotFoundException, _ as ProviderPill, x as RateLimitException, R as RemoteConfig, y as RemoteEmbeddingConfig, z as RemoteLLMConfig, F as RemoteVectorConfig, $ as RenderSectionDecision, H as RenderType, J as RetrievalException, K as Retrivora, N as RetrivoraError, O as RetrivoraErrorCode, Q as SDKVersionUnsupportedError, T as SDK_VERSION, a0 as Snippet, S as SourceCardProps, a1 as wrapError } from './BatchProcessor-OVOIlNfK.mjs';
5
+ import { H as HealthCheckResult, I as IProviderValidator, a as IProviderHealthChecker } from './index-D2mY1CrY.mjs';
6
+ export { C as ConfigValidator, b as HandlerOptions, V as ValidationError, c as VectorPlugin, d as createChatHandler, e as createFeedbackHandler, f as createHealthHandler, g as createHistoryHandler, h as createIngestHandler, i as createRagHandler, j as createSessionsHandler, k as createStreamHandler, l as createUploadHandler, s as sseErrorFrame, m as sseFrame, n as sseMetaFrame, o as sseTextFrame } from './index-D2mY1CrY.mjs';
7
7
  import 'react';
8
8
  import 'next/server';
9
9
 
@@ -807,6 +807,7 @@ declare class MongoDBProvider extends BaseVectorProvider {
807
807
  private embeddingKey;
808
808
  private contentKey;
809
809
  private metadataKey;
810
+ private initialized;
810
811
  constructor(config: VectorDBConfig);
811
812
  static getValidator(): IProviderValidator;
812
813
  static getHealthChecker(): IProviderHealthChecker;
@@ -838,7 +839,7 @@ declare class MilvusProvider extends BaseVectorProvider {
838
839
  upsert(doc: UpsertDocument, namespace?: string): Promise<void>;
839
840
  batchUpsert(docs: UpsertDocument[], namespace?: string): Promise<void>;
840
841
  query(vector: number[], topK: number, namespace?: string, _filter?: Record<string, unknown>): Promise<VectorMatch[]>;
841
- delete(id: string | number, _namespace?: string): Promise<void>;
842
+ delete(id: string | number, namespace?: string): Promise<void>;
842
843
  deleteNamespace(namespace: string): Promise<void>;
843
844
  ping(): Promise<boolean>;
844
845
  disconnect(): Promise<void>;
@@ -925,8 +926,7 @@ declare class RedisProvider extends BaseVectorProvider {
925
926
  delete(id: string, namespace?: string): Promise<void>;
926
927
  deleteNamespace(namespace: string): Promise<void>;
927
928
  /**
928
- * Check reachability via a PING command.
929
- * Returns false on connection failure so health checks surface real problems.
929
+ * Check reachability of the Upstash Vector API.
930
930
  */
931
931
  ping(): Promise<boolean>;
932
932
  disconnect(): Promise<void>;
package/dist/server.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { V as VectorDBConfig, L as LLMConfig, f as EmbeddingConfig, p as RagConfig, v as UniversalRagConfig, w as UpsertDocument, y as VectorMatch, G as GraphDBConfig, H as GraphNode, J as Edge, K as GraphSearchResult, I as ILLMProvider, x as VectorDBProvider, i as LLMProvider, g as EmbeddingProvider, R as RAGConfig, u as UIConfig, U as UITransformationResponse, C as ChatMessage, d as ChatOptions, E as EmbedOptions, h as IngestDocument, e as ChatResponse } from './ILLMProvider-BYQd0Nys.js';
2
- export { A as AuthMode, M as BarChartData, N as CarouselProduct, Q as IRetriever, j as LatencyBreakdown, S as LineChartDataPoint, X as MessageRole, Y as MetricCardData, O as ObservabilityTrace, Z as PieChartData, P as Product, k as ProjectAiSettings, l as ProjectAuthSettings, m as ProjectBrandingSettings, c as ProjectChatSettings, n as ProjectTelemetrySettings, o as ProjectWidgetSettings, q as RagMessage, r as RetrievalConfig, _ as RetrievalResult, s as RetrievedChunk, $ as RetrivoraChunkMetadata, a0 as RetrivoraIngestedDocument, a1 as ScatterPlotDataPoint, a2 as SuggestionsResponse, a3 as TableData, T as ThemeMode, t as TokenUsage, a as UseRagChatOptions, b as UseRagChatReturn, a4 as VisualizationType, W as WidgetPosition, z as WorkflowConfig, B as createDefaultProjectSettings, D as normalizeProjectSettings, F as projectSettingsToUiConfig } from './ILLMProvider-BYQd0Nys.js';
3
- import { o as DecisionContext, q as IntentCategory, I as IRenderRule, G as RenderDecision, p as IRendererStrategy } from './BatchProcessor-DlAkfGbv.js';
4
- export { V as ArchitectureCardProps, A as AuthenticationException, B as BatchOptions, f as BatchProcessor, g as BatchResult, h as ChartType, e as ChatViewportSize, C as ChatWidgetProps, a as ChatWindowProps, i as Chunk, j as ChunkOptions, c as ClientConfig, m as ConfigFetcher, b as ConfigProviderProps, n as ConfigurationException, W as DocumentChunker, D as DocumentUploadProps, E as EmbeddingFailedException, X as LicenseConfigResolver, L as LicenseTierConfig, r as LicenseValidationError, s as LicenseValidationRequest, t as LicenseValidationResponse, u as LicenseValidator, M as MessageBubbleProps, Y as Pipeline, Z as PipelineStep, P as ProductCardProps, d as ProductCarouselProps, v as ProviderCredentials, w as ProviderNotFoundException, _ as ProviderPill, x as RateLimitException, R as RemoteConfig, y as RemoteEmbeddingConfig, z as RemoteLLMConfig, F as RemoteVectorConfig, $ as RenderSectionDecision, H as RenderType, J as RetrievalException, K as Retrivora, N as RetrivoraError, O as RetrivoraErrorCode, Q as SDKVersionUnsupportedError, T as SDK_VERSION, a0 as Snippet, S as SourceCardProps, a1 as wrapError } from './BatchProcessor-DlAkfGbv.js';
5
- import { H as HealthCheckResult, I as IProviderValidator, a as IProviderHealthChecker } from './index-DtDY4Dwa.js';
6
- export { C as ConfigValidator, b as HandlerOptions, V as ValidationError, c as VectorPlugin, d as createChatHandler, e as createFeedbackHandler, f as createHealthHandler, g as createHistoryHandler, h as createIngestHandler, i as createRagHandler, j as createSessionsHandler, k as createStreamHandler, l as createUploadHandler, s as sseErrorFrame, m as sseFrame, n as sseMetaFrame, o as sseTextFrame } from './index-DtDY4Dwa.js';
1
+ import { V as VectorDBConfig, L as LLMConfig, f as EmbeddingConfig, p as RagConfig, v as UniversalRagConfig, w as UpsertDocument, y as VectorMatch, G as GraphDBConfig, H as GraphNode, J as Edge, K as GraphSearchResult, I as ILLMProvider, x as VectorDBProvider, i as LLMProvider, g as EmbeddingProvider, R as RAGConfig, u as UIConfig, U as UITransformationResponse, C as ChatMessage, d as ChatOptions, E as EmbedOptions, h as IngestDocument, e as ChatResponse } from './ILLMProvider-BynaFBpy.js';
2
+ export { A as AuthMode, M as BarChartData, N as CarouselProduct, Q as IRetriever, j as LatencyBreakdown, S as LineChartDataPoint, X as MessageRole, Y as MetricCardData, O as ObservabilityTrace, Z as PieChartData, P as Product, k as ProjectAiSettings, l as ProjectAuthSettings, m as ProjectBrandingSettings, c as ProjectChatSettings, n as ProjectTelemetrySettings, o as ProjectWidgetSettings, q as RagMessage, r as RetrievalConfig, _ as RetrievalResult, s as RetrievedChunk, $ as RetrivoraChunkMetadata, a0 as RetrivoraIngestedDocument, a1 as ScatterPlotDataPoint, a2 as SuggestionsResponse, a3 as TableData, T as ThemeMode, t as TokenUsage, a as UseRagChatOptions, b as UseRagChatReturn, a4 as VisualizationType, W as WidgetPosition, z as WorkflowConfig, B as createDefaultProjectSettings, D as normalizeProjectSettings, F as projectSettingsToUiConfig } from './ILLMProvider-BynaFBpy.js';
3
+ import { o as DecisionContext, q as IntentCategory, I as IRenderRule, G as RenderDecision, p as IRendererStrategy } from './BatchProcessor-B8OLSahY.js';
4
+ export { V as ArchitectureCardProps, A as AuthenticationException, B as BatchOptions, f as BatchProcessor, g as BatchResult, h as ChartType, e as ChatViewportSize, C as ChatWidgetProps, a as ChatWindowProps, i as Chunk, j as ChunkOptions, c as ClientConfig, m as ConfigFetcher, b as ConfigProviderProps, n as ConfigurationException, W as DocumentChunker, D as DocumentUploadProps, E as EmbeddingFailedException, X as LicenseConfigResolver, L as LicenseTierConfig, r as LicenseValidationError, s as LicenseValidationRequest, t as LicenseValidationResponse, u as LicenseValidator, M as MessageBubbleProps, Y as Pipeline, Z as PipelineStep, P as ProductCardProps, d as ProductCarouselProps, v as ProviderCredentials, w as ProviderNotFoundException, _ as ProviderPill, x as RateLimitException, R as RemoteConfig, y as RemoteEmbeddingConfig, z as RemoteLLMConfig, F as RemoteVectorConfig, $ as RenderSectionDecision, H as RenderType, J as RetrievalException, K as Retrivora, N as RetrivoraError, O as RetrivoraErrorCode, Q as SDKVersionUnsupportedError, T as SDK_VERSION, a0 as Snippet, S as SourceCardProps, a1 as wrapError } from './BatchProcessor-B8OLSahY.js';
5
+ import { H as HealthCheckResult, I as IProviderValidator, a as IProviderHealthChecker } from './index-BC635WW-.js';
6
+ export { C as ConfigValidator, b as HandlerOptions, V as ValidationError, c as VectorPlugin, d as createChatHandler, e as createFeedbackHandler, f as createHealthHandler, g as createHistoryHandler, h as createIngestHandler, i as createRagHandler, j as createSessionsHandler, k as createStreamHandler, l as createUploadHandler, s as sseErrorFrame, m as sseFrame, n as sseMetaFrame, o as sseTextFrame } from './index-BC635WW-.js';
7
7
  import 'react';
8
8
  import 'next/server';
9
9
 
@@ -807,6 +807,7 @@ declare class MongoDBProvider extends BaseVectorProvider {
807
807
  private embeddingKey;
808
808
  private contentKey;
809
809
  private metadataKey;
810
+ private initialized;
810
811
  constructor(config: VectorDBConfig);
811
812
  static getValidator(): IProviderValidator;
812
813
  static getHealthChecker(): IProviderHealthChecker;
@@ -838,7 +839,7 @@ declare class MilvusProvider extends BaseVectorProvider {
838
839
  upsert(doc: UpsertDocument, namespace?: string): Promise<void>;
839
840
  batchUpsert(docs: UpsertDocument[], namespace?: string): Promise<void>;
840
841
  query(vector: number[], topK: number, namespace?: string, _filter?: Record<string, unknown>): Promise<VectorMatch[]>;
841
- delete(id: string | number, _namespace?: string): Promise<void>;
842
+ delete(id: string | number, namespace?: string): Promise<void>;
842
843
  deleteNamespace(namespace: string): Promise<void>;
843
844
  ping(): Promise<boolean>;
844
845
  disconnect(): Promise<void>;
@@ -925,8 +926,7 @@ declare class RedisProvider extends BaseVectorProvider {
925
926
  delete(id: string, namespace?: string): Promise<void>;
926
927
  deleteNamespace(namespace: string): Promise<void>;
927
928
  /**
928
- * Check reachability via a PING command.
929
- * Returns false on connection failure so health checks surface real problems.
929
+ * Check reachability of the Upstash Vector API.
930
930
  */
931
931
  ping(): Promise<boolean>;
932
932
  disconnect(): Promise<void>;