@retrivora-ai/rag-engine 0.1.4 → 0.1.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.
- package/dist/DocumentChunker-BEyzadsv.d.mts +93 -0
- package/dist/DocumentChunker-BEyzadsv.d.ts +93 -0
- package/dist/{LLMFactory-XC55FTD2.mjs → LLMFactory-JFOY2V4X.mjs} +2 -1
- package/dist/{PineconeProvider-NJ675H7U.mjs → PineconeProvider-ZRAFNFEC.mjs} +1 -1
- package/dist/{PostgreSQLProvider-ISNMD3BE.mjs → PostgreSQLProvider-ZNXA67IM.mjs} +1 -1
- package/dist/{QdrantProvider-LJWOIGES.mjs → QdrantProvider-NYGHAA7C.mjs} +1 -1
- package/dist/{Pipeline-Bo6CUCox.d.mts → RagConfig-hBGXJmSx.d.mts} +23 -93
- package/dist/{Pipeline-Bo6CUCox.d.ts → RagConfig-hBGXJmSx.d.ts} +23 -93
- package/dist/{chunk-6FODXNUF.mjs → chunk-5K23H7JL.mjs} +27 -1
- package/dist/chunk-HSBXE2WV.mjs +1758 -0
- package/dist/{chunk-S5DRHETN.mjs → chunk-IUTAZ7QR.mjs} +31 -2
- package/dist/{chunk-GD3QJFNN.mjs → chunk-JI6VD5TJ.mjs} +4 -41
- package/dist/chunk-UKDXCXW7.mjs +49 -0
- package/dist/{chunk-AALIF3AL.mjs → chunk-ZM6TYIDH.mjs} +3 -3
- package/dist/handlers/index.d.mts +3 -44
- package/dist/handlers/index.d.ts +3 -44
- package/dist/handlers/index.js +1322 -57
- package/dist/handlers/index.mjs +3 -3
- package/dist/index-Bx182KKn.d.ts +64 -0
- package/dist/index-Ck2pt7-8.d.mts +64 -0
- 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 +188 -11
- package/dist/server.d.ts +188 -11
- package/dist/server.js +1322 -57
- package/dist/server.mjs +10 -11
- package/package.json +20 -2
- package/src/config/serverConfig.ts +3 -0
- package/src/core/BatchProcessor.ts +347 -0
- package/src/core/ConfigValidator.ts +560 -0
- package/src/core/Pipeline.ts +91 -49
- package/src/core/ProviderHealthCheck.ts +565 -0
- package/src/core/VectorPlugin.ts +51 -9
- package/src/handlers/index.ts +2 -2
- package/src/index.ts +1 -7
- package/src/providers/vectordb/BaseVectorProvider.ts +1 -1
- package/src/providers/vectordb/MilvusProvider.ts +1 -1
- package/src/providers/vectordb/MongoDBProvider.ts +1 -1
- package/src/providers/vectordb/PineconeProvider.ts +4 -4
- package/src/providers/vectordb/PostgreSQLProvider.ts +35 -3
- package/src/providers/vectordb/QdrantProvider.ts +32 -2
- package/src/rag/DocumentChunker.ts +2 -2
- package/src/server.ts +1 -1
- package/src/types/index.ts +13 -2
- package/dist/DocumentChunker-BQ5kQD7B.d.ts +0 -155
- package/dist/DocumentChunker-D9-fObJp.d.mts +0 -155
- package/dist/chunk-AIAB2IEE.mjs +0 -394
- package/dist/chunk-FGGSVVSY.mjs +0 -162
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-HSBXE2WV.mjs";
|
|
7
|
+
import "../chunk-JI6VD5TJ.mjs";
|
|
8
|
+
import "../chunk-UKDXCXW7.mjs";
|
|
9
9
|
import "../chunk-I4E63NIC.mjs";
|
|
10
10
|
export {
|
|
11
11
|
createChatHandler,
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { a as RagConfig, C as ChatResponse } from './RagConfig-hBGXJmSx.js';
|
|
2
|
+
import { NextRequest, NextResponse } from 'next/server';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* ProviderHealthCheck.ts — Pre-flight validation for vector DB and LLM providers.
|
|
6
|
+
*
|
|
7
|
+
* Performs connectivity tests, credential validation, and capability checks
|
|
8
|
+
* before initializing providers.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
interface HealthCheckResult {
|
|
12
|
+
healthy: boolean;
|
|
13
|
+
provider: string;
|
|
14
|
+
version?: string;
|
|
15
|
+
capabilities?: Record<string, unknown>;
|
|
16
|
+
error?: string;
|
|
17
|
+
timestamp: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* createChatHandler — factory that returns a Next.js App Router POST handler
|
|
22
|
+
*/
|
|
23
|
+
declare function createChatHandler(config?: Partial<RagConfig>): (req: NextRequest) => Promise<NextResponse<{
|
|
24
|
+
error: string;
|
|
25
|
+
}> | NextResponse<ChatResponse>>;
|
|
26
|
+
/**
|
|
27
|
+
* createIngestHandler — factory for the document ingestion endpoint.
|
|
28
|
+
*/
|
|
29
|
+
declare function createIngestHandler(config?: Partial<RagConfig>): (req: NextRequest) => Promise<NextResponse<{
|
|
30
|
+
error: string;
|
|
31
|
+
}> | NextResponse<{
|
|
32
|
+
results: {
|
|
33
|
+
docId: string | number;
|
|
34
|
+
chunksIngested: number;
|
|
35
|
+
}[];
|
|
36
|
+
}>>;
|
|
37
|
+
/**
|
|
38
|
+
* createHealthHandler — factory for the health-check endpoint.
|
|
39
|
+
*/
|
|
40
|
+
declare function createHealthHandler(config?: Partial<RagConfig>): () => Promise<NextResponse<{
|
|
41
|
+
timestamp: string;
|
|
42
|
+
vectorDb: HealthCheckResult;
|
|
43
|
+
llm: HealthCheckResult;
|
|
44
|
+
embedding?: HealthCheckResult;
|
|
45
|
+
allHealthy: boolean;
|
|
46
|
+
status: string;
|
|
47
|
+
}> | NextResponse<{
|
|
48
|
+
status: string;
|
|
49
|
+
error: string;
|
|
50
|
+
}>>;
|
|
51
|
+
/**
|
|
52
|
+
* createUploadHandler — factory for the file upload ingestion endpoint.
|
|
53
|
+
*/
|
|
54
|
+
declare function createUploadHandler(config?: Partial<RagConfig>): (req: NextRequest) => Promise<NextResponse<{
|
|
55
|
+
error: string;
|
|
56
|
+
}> | NextResponse<{
|
|
57
|
+
message: string;
|
|
58
|
+
results: {
|
|
59
|
+
docId: string | number;
|
|
60
|
+
chunksIngested: number;
|
|
61
|
+
}[];
|
|
62
|
+
}>>;
|
|
63
|
+
|
|
64
|
+
export { type HealthCheckResult as H, createHealthHandler as a, createIngestHandler as b, createChatHandler as c, createUploadHandler as d };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { a as RagConfig, C as ChatResponse } from './RagConfig-hBGXJmSx.mjs';
|
|
2
|
+
import { NextRequest, NextResponse } from 'next/server';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* ProviderHealthCheck.ts — Pre-flight validation for vector DB and LLM providers.
|
|
6
|
+
*
|
|
7
|
+
* Performs connectivity tests, credential validation, and capability checks
|
|
8
|
+
* before initializing providers.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
interface HealthCheckResult {
|
|
12
|
+
healthy: boolean;
|
|
13
|
+
provider: string;
|
|
14
|
+
version?: string;
|
|
15
|
+
capabilities?: Record<string, unknown>;
|
|
16
|
+
error?: string;
|
|
17
|
+
timestamp: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* createChatHandler — factory that returns a Next.js App Router POST handler
|
|
22
|
+
*/
|
|
23
|
+
declare function createChatHandler(config?: Partial<RagConfig>): (req: NextRequest) => Promise<NextResponse<{
|
|
24
|
+
error: string;
|
|
25
|
+
}> | NextResponse<ChatResponse>>;
|
|
26
|
+
/**
|
|
27
|
+
* createIngestHandler — factory for the document ingestion endpoint.
|
|
28
|
+
*/
|
|
29
|
+
declare function createIngestHandler(config?: Partial<RagConfig>): (req: NextRequest) => Promise<NextResponse<{
|
|
30
|
+
error: string;
|
|
31
|
+
}> | NextResponse<{
|
|
32
|
+
results: {
|
|
33
|
+
docId: string | number;
|
|
34
|
+
chunksIngested: number;
|
|
35
|
+
}[];
|
|
36
|
+
}>>;
|
|
37
|
+
/**
|
|
38
|
+
* createHealthHandler — factory for the health-check endpoint.
|
|
39
|
+
*/
|
|
40
|
+
declare function createHealthHandler(config?: Partial<RagConfig>): () => Promise<NextResponse<{
|
|
41
|
+
timestamp: string;
|
|
42
|
+
vectorDb: HealthCheckResult;
|
|
43
|
+
llm: HealthCheckResult;
|
|
44
|
+
embedding?: HealthCheckResult;
|
|
45
|
+
allHealthy: boolean;
|
|
46
|
+
status: string;
|
|
47
|
+
}> | NextResponse<{
|
|
48
|
+
status: string;
|
|
49
|
+
error: string;
|
|
50
|
+
}>>;
|
|
51
|
+
/**
|
|
52
|
+
* createUploadHandler — factory for the file upload ingestion endpoint.
|
|
53
|
+
*/
|
|
54
|
+
declare function createUploadHandler(config?: Partial<RagConfig>): (req: NextRequest) => Promise<NextResponse<{
|
|
55
|
+
error: string;
|
|
56
|
+
}> | NextResponse<{
|
|
57
|
+
message: string;
|
|
58
|
+
results: {
|
|
59
|
+
docId: string | number;
|
|
60
|
+
chunksIngested: number;
|
|
61
|
+
}[];
|
|
62
|
+
}>>;
|
|
63
|
+
|
|
64
|
+
export { type HealthCheckResult as H, createHealthHandler as a, createIngestHandler as b, createChatHandler as c, createUploadHandler as d };
|
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-BEyzadsv.mjs';
|
|
4
|
+
export { a as ChatOptions, b as Chunk, c as ChunkOptions, E as EmbedOptions, I as ILLMProvider } from './DocumentChunker-BEyzadsv.mjs';
|
|
5
|
+
import { V as VectorMatch, U as UIConfig } from './RagConfig-hBGXJmSx.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-hBGXJmSx.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-BEyzadsv.js';
|
|
4
|
+
export { a as ChatOptions, b as Chunk, c as ChunkOptions, E as EmbedOptions, I as ILLMProvider } from './DocumentChunker-BEyzadsv.js';
|
|
5
|
+
import { V as VectorMatch, U as UIConfig } from './RagConfig-hBGXJmSx.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-hBGXJmSx.js';
|
|
6
7
|
|
|
7
8
|
interface ChatWidgetProps {
|
|
8
9
|
/** Position of the floating button. Defaults to bottom-right. */
|