@retrivora-ai/rag-engine 0.1.4 → 0.1.5
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/DocumentChunker-cfaMidtA.d.mts +93 -0
- package/dist/DocumentChunker-cfaMidtA.d.ts +93 -0
- package/dist/{LLMFactory-XC55FTD2.mjs → LLMFactory-JFOY2V4X.mjs} +2 -1
- package/dist/{Pipeline-Bo6CUCox.d.ts → RagConfig-DG_0f8ka.d.mts} +23 -93
- package/dist/{Pipeline-Bo6CUCox.d.mts → RagConfig-DG_0f8ka.d.ts} +23 -93
- package/dist/{chunk-AIAB2IEE.mjs → chunk-BP4U4TT5.mjs} +158 -4
- package/dist/{chunk-GD3QJFNN.mjs → chunk-JI6VD5TJ.mjs} +4 -41
- package/dist/chunk-UKDXCXW7.mjs +49 -0
- package/dist/handlers/index.d.mts +1 -1
- package/dist/handlers/index.d.ts +1 -1
- package/dist/handlers/index.mjs +3 -3
- package/dist/index.d.mts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +19 -1646
- package/dist/index.mjs +1 -11
- package/dist/server.d.mts +135 -5
- package/dist/server.d.ts +135 -5
- package/dist/server.mjs +7 -8
- package/package.json +19 -2
- package/src/core/Pipeline.ts +2 -10
- package/src/core/VectorPlugin.ts +2 -1
- package/src/index.ts +1 -7
- package/src/server.ts +1 -1
- package/src/types/index.ts +11 -0
- package/dist/DocumentChunker-BQ5kQD7B.d.ts +0 -155
- package/dist/DocumentChunker-D9-fObJp.d.mts +0 -155
- package/dist/chunk-FGGSVVSY.mjs +0 -162
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__spreadValues
|
|
3
|
+
} from "./chunk-I4E63NIC.mjs";
|
|
4
|
+
|
|
5
|
+
// src/utils/templateUtils.ts
|
|
6
|
+
function isRecord(value) {
|
|
7
|
+
return typeof value === "object" && value !== null;
|
|
8
|
+
}
|
|
9
|
+
function resolvePath(obj, path) {
|
|
10
|
+
if (!path || !obj) return void 0;
|
|
11
|
+
return path.replace(/\[(\w+)\]/g, ".$1").replace(/^\./, "").split(".").reduce((current, segment) => {
|
|
12
|
+
if (!isRecord(current) && !Array.isArray(current)) {
|
|
13
|
+
return void 0;
|
|
14
|
+
}
|
|
15
|
+
return current[segment];
|
|
16
|
+
}, obj);
|
|
17
|
+
}
|
|
18
|
+
function buildPayload(template, vars) {
|
|
19
|
+
let raw = template;
|
|
20
|
+
for (const [key, val] of Object.entries(vars)) {
|
|
21
|
+
const stringifiedVal = val === void 0 ? "null" : JSON.stringify(val);
|
|
22
|
+
raw = raw.replace(new RegExp(`"\\{\\{${key}\\}\\}"`, "g"), stringifiedVal);
|
|
23
|
+
raw = raw.replace(new RegExp(`\\{\\{${key}\\}\\}`, "g"), stringifiedVal);
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
return JSON.parse(raw);
|
|
27
|
+
} catch (err) {
|
|
28
|
+
throw new Error(`Failed to parse payload template: ${err.message}
|
|
29
|
+
Raw payload: ${raw}`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function mergeDefined(base, override) {
|
|
33
|
+
const merged = __spreadValues({}, base || {});
|
|
34
|
+
if (!override) {
|
|
35
|
+
return merged;
|
|
36
|
+
}
|
|
37
|
+
for (const [key, value] of Object.entries(override)) {
|
|
38
|
+
if (value !== void 0 && value !== null && value !== "") {
|
|
39
|
+
merged[key] = value;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return merged;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export {
|
|
46
|
+
resolvePath,
|
|
47
|
+
buildPayload,
|
|
48
|
+
mergeDefined
|
|
49
|
+
};
|
package/dist/handlers/index.d.ts
CHANGED
package/dist/handlers/index.mjs
CHANGED
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
createHealthHandler,
|
|
4
4
|
createIngestHandler,
|
|
5
5
|
createUploadHandler
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-BP4U4TT5.mjs";
|
|
7
|
+
import "../chunk-JI6VD5TJ.mjs";
|
|
8
|
+
import "../chunk-UKDXCXW7.mjs";
|
|
9
9
|
import "../chunk-I4E63NIC.mjs";
|
|
10
10
|
export {
|
|
11
11
|
createChatHandler,
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export { C as Chunk, a as ChunkOptions, b as ConfigResolver, P as ProviderRegistry, V as VectorPlugin } from './DocumentChunker-D9-fObJp.mjs';
|
|
2
|
-
import { C as ChatMessage, V as VectorMatch, U as UIConfig } from './Pipeline-Bo6CUCox.mjs';
|
|
3
|
-
export { a as ChatOptions, b as ChatResponse, E as EmbedOptions, c as EmbeddingConfig, I as ILLMProvider, d as IngestDocument, L as LLMConfig, P as Pipeline, R as RAGConfig, e as RagConfig, f as UpsertDocument, g as VectorDBConfig } from './Pipeline-Bo6CUCox.mjs';
|
|
4
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
2
|
import React$1, { ReactNode } from 'react';
|
|
3
|
+
import { C as ChatMessage } from './DocumentChunker-cfaMidtA.mjs';
|
|
4
|
+
export { a as ChatOptions, b as Chunk, c as ChunkOptions, E as EmbedOptions, I as ILLMProvider } from './DocumentChunker-cfaMidtA.mjs';
|
|
5
|
+
import { V as VectorMatch, U as UIConfig } from './RagConfig-DG_0f8ka.mjs';
|
|
6
|
+
export { C as ChatResponse, E as EmbeddingConfig, I as IngestDocument, L as LLMConfig, R as RAGConfig, a as RagConfig, b as UpsertDocument, c as VectorDBConfig } from './RagConfig-DG_0f8ka.mjs';
|
|
6
7
|
|
|
7
8
|
interface ChatWidgetProps {
|
|
8
9
|
/** Position of the floating button. Defaults to bottom-right. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export { C as Chunk, a as ChunkOptions, b as ConfigResolver, P as ProviderRegistry, V as VectorPlugin } from './DocumentChunker-BQ5kQD7B.js';
|
|
2
|
-
import { C as ChatMessage, V as VectorMatch, U as UIConfig } from './Pipeline-Bo6CUCox.js';
|
|
3
|
-
export { a as ChatOptions, b as ChatResponse, E as EmbedOptions, c as EmbeddingConfig, I as ILLMProvider, d as IngestDocument, L as LLMConfig, P as Pipeline, R as RAGConfig, e as RagConfig, f as UpsertDocument, g as VectorDBConfig } from './Pipeline-Bo6CUCox.js';
|
|
4
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
2
|
import React$1, { ReactNode } from 'react';
|
|
3
|
+
import { C as ChatMessage } from './DocumentChunker-cfaMidtA.js';
|
|
4
|
+
export { a as ChatOptions, b as Chunk, c as ChunkOptions, E as EmbedOptions, I as ILLMProvider } from './DocumentChunker-cfaMidtA.js';
|
|
5
|
+
import { V as VectorMatch, U as UIConfig } from './RagConfig-DG_0f8ka.js';
|
|
6
|
+
export { C as ChatResponse, E as EmbeddingConfig, I as IngestDocument, L as LLMConfig, R as RAGConfig, a as RagConfig, b as UpsertDocument, c as VectorDBConfig } from './RagConfig-DG_0f8ka.js';
|
|
6
7
|
|
|
7
8
|
interface ChatWidgetProps {
|
|
8
9
|
/** Position of the floating button. Defaults to bottom-right. */
|