@catalogicus-international/n8n-nodes-light-rag 0.3.0 → 0.4.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/README.md +27 -7
- package/dist/nodes/LightRag/LightRag.node.js +73 -0
- package/dist/nodes/LightRag/LightRag.node.js.map +1 -1
- package/dist/nodes/LightRag/streamingQuery.d.ts +22 -0
- package/dist/nodes/LightRag/streamingQuery.js +192 -0
- package/dist/nodes/LightRag/streamingQuery.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
# @catalogicus-international/n8n-nodes-light-rag
|
|
2
2
|
|
|
3
3
|
An n8n community package that exposes a LightRAG API server to regular workflows and
|
|
4
|
-
AI Agents. Current release: `0.
|
|
4
|
+
AI Agents. Current release: `0.4.0`.
|
|
5
5
|
|
|
6
|
-
Release `0.
|
|
7
|
-
|
|
8
|
-
retrieval-only through `POST /query/data`: LightRAG
|
|
9
|
-
connected AI agent writes the final answer.
|
|
10
|
-
operations and response behavior.
|
|
6
|
+
Release `0.4.0` adds opt-in LightRAG query progress, source excerpts, and answer
|
|
7
|
+
streaming for n8n Chat while preserving the regular workflow node's default buffered
|
|
8
|
+
behavior. `LightRAG Tool` remains retrieval-only through `POST /query/data`: LightRAG
|
|
9
|
+
retrieves text chunks and the connected AI agent writes the final answer.
|
|
11
10
|
|
|
12
11
|
## Nodes
|
|
13
12
|
|
|
@@ -36,6 +35,27 @@ You can replace the Request Body expression with a manually configured object or
|
|
|
36
35
|
individual fields from previous nodes. Responses are emitted through the normal Main
|
|
37
36
|
output and retain n8n item pairing.
|
|
38
37
|
|
|
38
|
+
#### Stream Query progress to n8n Chat
|
|
39
|
+
|
|
40
|
+
Enable `Stream Progress to Chat` on the `Query` operation to remove the silent wait in
|
|
41
|
+
an n8n chat workflow. The Chat Trigger must use `Streaming response`, and the LightRAG
|
|
42
|
+
server must support `POST /query/stream`, `include_progress`, and
|
|
43
|
+
`include_chunk_content`.
|
|
44
|
+
|
|
45
|
+
The node immediately displays a request-start message, then translates LightRAG's live
|
|
46
|
+
retrieval stages into short Russian status messages. Once retrieval completes, it shows
|
|
47
|
+
up to three unique source file names with one excerpt of at most 240 characters each.
|
|
48
|
+
Only the file basename is shown; internal directory paths remain hidden. The streamed
|
|
49
|
+
LightRAG answer follows under an `Ответ` heading. These messages remain together in the
|
|
50
|
+
final Markdown chat response.
|
|
51
|
+
|
|
52
|
+
In this mode the node forces `stream`, `include_progress`, `include_references`, and
|
|
53
|
+
`include_chunk_content` to `true` and parses the NDJSON response incrementally. Its Main
|
|
54
|
+
output remains an aggregated query result containing `response`, `references`, and any
|
|
55
|
+
`response_time` or `llm_generated` metadata returned by LightRAG. Outside a streaming
|
|
56
|
+
Chat Trigger workflow, the same mode still parses and returns the complete result but
|
|
57
|
+
does not emit UI chunks.
|
|
58
|
+
|
|
39
59
|
### LightRAG Tool
|
|
40
60
|
|
|
41
61
|
Connect `LightRAG Tool` to the tool input of an n8n AI Agent. This node is dedicated
|
|
@@ -111,7 +131,7 @@ management and custom requests, but is not exposed as an AI Agent tool.
|
|
|
111
131
|
|
|
112
132
|
## Supported operations
|
|
113
133
|
|
|
114
|
-
- `query` — `POST /query
|
|
134
|
+
- `query` — `POST /query`, or `POST /query/stream` when `Stream Progress to Chat` is enabled;
|
|
115
135
|
- `queryData` — `POST /query/data`;
|
|
116
136
|
- `insertText` — `POST /documents/text`;
|
|
117
137
|
- `insertTexts` — `POST /documents/texts`;
|
|
@@ -4,6 +4,7 @@ exports.LightRag = void 0;
|
|
|
4
4
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
5
|
const request_1 = require("../LightRagTool/request");
|
|
6
6
|
const workflowRequest_1 = require("./workflowRequest");
|
|
7
|
+
const streamingQuery_1 = require("./streamingQuery");
|
|
7
8
|
const bodyOperations = [
|
|
8
9
|
'query',
|
|
9
10
|
'queryData',
|
|
@@ -121,6 +122,30 @@ class LightRag {
|
|
|
121
122
|
},
|
|
122
123
|
description: 'JSON body sent to LightRAG. By default, the complete current input item is used.',
|
|
123
124
|
},
|
|
125
|
+
{
|
|
126
|
+
displayName: 'Stream Progress to Chat',
|
|
127
|
+
name: 'streamProgressToChat',
|
|
128
|
+
type: 'boolean',
|
|
129
|
+
default: false,
|
|
130
|
+
displayOptions: {
|
|
131
|
+
show: {
|
|
132
|
+
operation: ['query'],
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
description: 'Whether to stream LightRAG retrieval progress, source excerpts, and answer text to an n8n Chat Trigger',
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
displayName: 'Chat Trigger must use Streaming Response. Requires a recent LightRAG server with /query/stream and include_progress support.',
|
|
139
|
+
name: 'streamProgressNotice',
|
|
140
|
+
type: 'notice',
|
|
141
|
+
default: '',
|
|
142
|
+
displayOptions: {
|
|
143
|
+
show: {
|
|
144
|
+
operation: ['query'],
|
|
145
|
+
streamProgressToChat: [true],
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
},
|
|
124
149
|
{
|
|
125
150
|
displayName: 'Track ID',
|
|
126
151
|
name: 'trackId',
|
|
@@ -201,12 +226,16 @@ class LightRag {
|
|
|
201
226
|
const credentials = await this.getCredentials('lightRagApi');
|
|
202
227
|
const baseUrl = (0, request_1.normalizeBaseUrl)(credentials.baseUrl);
|
|
203
228
|
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
|
229
|
+
let chatStreamStarted = false;
|
|
204
230
|
try {
|
|
205
231
|
const operation = this.getNodeParameter('operation', itemIndex);
|
|
206
232
|
const parameters = {};
|
|
207
233
|
if (bodyOperations.includes(operation)) {
|
|
208
234
|
parameters.body = this.getNodeParameter('body', itemIndex);
|
|
209
235
|
}
|
|
236
|
+
const streamProgressToChat = operation === 'query'
|
|
237
|
+
? this.getNodeParameter('streamProgressToChat', itemIndex, false)
|
|
238
|
+
: false;
|
|
210
239
|
if (operation === 'trackStatus') {
|
|
211
240
|
parameters.trackId = this.getNodeParameter('trackId', itemIndex);
|
|
212
241
|
}
|
|
@@ -220,10 +249,54 @@ class LightRag {
|
|
|
220
249
|
}
|
|
221
250
|
}
|
|
222
251
|
const request = (0, workflowRequest_1.normalizeWorkflowRequest)(operation, parameters);
|
|
252
|
+
if (streamProgressToChat) {
|
|
253
|
+
const canStreamToChat = this.isStreaming();
|
|
254
|
+
const sentEvents = new Set();
|
|
255
|
+
const sentMessages = new Set();
|
|
256
|
+
let answerStarted = false;
|
|
257
|
+
const sendItem = (content) => {
|
|
258
|
+
if (canStreamToChat)
|
|
259
|
+
this.sendChunk('item', itemIndex, content);
|
|
260
|
+
};
|
|
261
|
+
if (canStreamToChat) {
|
|
262
|
+
this.sendChunk('begin', itemIndex);
|
|
263
|
+
chatStreamStarted = true;
|
|
264
|
+
sendItem('_🔎 Отправляю запрос в базу знаний…_\n\n');
|
|
265
|
+
}
|
|
266
|
+
const response = await (0, streamingQuery_1.executeStreamingQuery)(this, baseUrl, (0, streamingQuery_1.normalizeStreamingQueryBody)(request.body), {
|
|
267
|
+
onProgress: (event) => {
|
|
268
|
+
const message = (0, streamingQuery_1.progressMessage)(event);
|
|
269
|
+
if (sentEvents.has(event) || sentMessages.has(message))
|
|
270
|
+
return;
|
|
271
|
+
sentEvents.add(event);
|
|
272
|
+
sentMessages.add(message);
|
|
273
|
+
sendItem(`_${message}_\n\n`);
|
|
274
|
+
},
|
|
275
|
+
onReferences: (references) => {
|
|
276
|
+
sendItem((0, streamingQuery_1.formatReferencesMessage)(references));
|
|
277
|
+
},
|
|
278
|
+
onResponseChunk: (chunk) => {
|
|
279
|
+
if (!answerStarted) {
|
|
280
|
+
answerStarted = true;
|
|
281
|
+
sendItem('---\n\n**Ответ:**\n\n');
|
|
282
|
+
}
|
|
283
|
+
sendItem(chunk);
|
|
284
|
+
},
|
|
285
|
+
});
|
|
286
|
+
if (canStreamToChat) {
|
|
287
|
+
this.sendChunk('end', itemIndex);
|
|
288
|
+
chatStreamStarted = false;
|
|
289
|
+
}
|
|
290
|
+
returnData.push({ json: response, pairedItem: itemIndex });
|
|
291
|
+
continue;
|
|
292
|
+
}
|
|
223
293
|
const response = await (0, request_1.executeLightRagRequest)(this, baseUrl, request);
|
|
224
294
|
returnData.push(...(0, request_1.responseToExecutionData)(response, itemIndex));
|
|
225
295
|
}
|
|
226
296
|
catch (error) {
|
|
297
|
+
if (chatStreamStarted) {
|
|
298
|
+
this.sendChunk('error', itemIndex, error instanceof Error ? error.message : 'LightRAG streaming query failed');
|
|
299
|
+
}
|
|
227
300
|
if (this.continueOnFail()) {
|
|
228
301
|
returnData.push({
|
|
229
302
|
json: { error: error instanceof Error ? error.message : String(error) },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LightRag.node.js","sourceRoot":"","sources":["../../../nodes/LightRag/LightRag.node.ts"],"names":[],"mappings":";;;AAMA,+CAAuE;AACvE,qDAIiC;AACjC,uDAG2B;
|
|
1
|
+
{"version":3,"file":"LightRag.node.js","sourceRoot":"","sources":["../../../nodes/LightRag/LightRag.node.ts"],"names":[],"mappings":";;;AAMA,+CAAuE;AACvE,qDAIiC;AACjC,uDAG2B;AAC3B,qDAK0B;AAE1B,MAAM,cAAc,GAAG;IACtB,OAAO;IACP,WAAW;IACX,YAAY;IACZ,aAAa;IACb,eAAe;IACf,iBAAiB;CACjB,CAAC;AAIF,MAAa,QAAQ;IAArB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,UAAU;YACvB,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,+BAA+B;YACrC,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8BAA8B;YACxC,WAAW,EAAE,qDAAqD;YAClE,QAAQ,EAAE;gBACT,IAAI,EAAE,UAAU;aAChB;YACD,MAAM,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YAClC,OAAO,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;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AAM,IAAA,gCAAsB,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;gBAEtE,UAAU,CAAC,IAAI,CAAC,GAAG,IAAA,iCAAuB,EAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;YAClE,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,IAAI,iBAAiB,EAAE,CAAC;oBACvB,IAAI,CAAC,SAAS,CACb,OAAO,EACP,SAAS,EACT,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,iCAAiC,CAC1E,CAAC;gBACH,CAAC;gBACD,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAC3B,UAAU,CAAC,IAAI,CAAC;wBACf,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;wBACvE,UAAU,EAAE,SAAS;qBACrB,CAAC,CAAC;oBACH,SAAS;gBACV,CAAC;gBAED,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;YACpE,CAAC;QACF,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AAvUD,4BAuUC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { IDataObject, IExecuteFunctions } from 'n8n-workflow';
|
|
2
|
+
interface StreamReference extends IDataObject {
|
|
3
|
+
file_path?: string;
|
|
4
|
+
content?: string[];
|
|
5
|
+
}
|
|
6
|
+
export interface StreamingQueryCallbacks {
|
|
7
|
+
onProgress?: (event: string) => void;
|
|
8
|
+
onReferences?: (references: StreamReference[]) => void;
|
|
9
|
+
onResponseChunk?: (chunk: string) => void;
|
|
10
|
+
}
|
|
11
|
+
export interface StreamingQueryResult extends IDataObject {
|
|
12
|
+
response: string;
|
|
13
|
+
references: StreamReference[];
|
|
14
|
+
response_time?: number;
|
|
15
|
+
llm_generated?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare function normalizeStreamingQueryBody(value: unknown): IDataObject;
|
|
18
|
+
export declare function parseLightRagQueryStream(stream: AsyncIterable<unknown>, callbacks?: StreamingQueryCallbacks): Promise<StreamingQueryResult>;
|
|
19
|
+
export declare function executeStreamingQuery(context: IExecuteFunctions, baseUrl: string, body: IDataObject, callbacks?: StreamingQueryCallbacks): Promise<StreamingQueryResult>;
|
|
20
|
+
export declare function progressMessage(event: string): string;
|
|
21
|
+
export declare function formatReferencesMessage(references: StreamReference[]): string;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeStreamingQueryBody = normalizeStreamingQueryBody;
|
|
4
|
+
exports.parseLightRagQueryStream = parseLightRagQueryStream;
|
|
5
|
+
exports.executeStreamingQuery = executeStreamingQuery;
|
|
6
|
+
exports.progressMessage = progressMessage;
|
|
7
|
+
exports.formatReferencesMessage = formatReferencesMessage;
|
|
8
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
9
|
+
const request_1 = require("../LightRagTool/request");
|
|
10
|
+
const PROGRESS_MESSAGES = {
|
|
11
|
+
extracting_keywords: '🔑 Выделяю ключевые понятия…',
|
|
12
|
+
retrieving_entities: '🧩 Ищу связанные сущности…',
|
|
13
|
+
retrieving_relations: '🔗 Проверяю связи…',
|
|
14
|
+
retrieving_chunks: '📚 Подбираю фрагменты документов…',
|
|
15
|
+
reranking: '🎯 Уточняю релевантность результатов…',
|
|
16
|
+
generating_response: '✍️ Формирую ответ по найденным материалам…',
|
|
17
|
+
};
|
|
18
|
+
const UNKNOWN_PROGRESS_MESSAGE = '⚙️ Выполняю следующий этап поиска…';
|
|
19
|
+
function isObject(value) {
|
|
20
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
21
|
+
}
|
|
22
|
+
function asReferences(value) {
|
|
23
|
+
if (!Array.isArray(value) || !value.every(isObject)) {
|
|
24
|
+
throw new n8n_workflow_1.ApplicationError('LightRAG returned malformed references in the query stream');
|
|
25
|
+
}
|
|
26
|
+
return value;
|
|
27
|
+
}
|
|
28
|
+
function parseStreamLine(line, result, callbacks) {
|
|
29
|
+
var _a, _b, _c;
|
|
30
|
+
let value;
|
|
31
|
+
try {
|
|
32
|
+
value = JSON.parse(line);
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
throw new n8n_workflow_1.ApplicationError('LightRAG returned malformed NDJSON in the query stream');
|
|
36
|
+
}
|
|
37
|
+
if (!isObject(value)) {
|
|
38
|
+
throw new n8n_workflow_1.ApplicationError('LightRAG returned a malformed query stream event');
|
|
39
|
+
}
|
|
40
|
+
if (value.error !== undefined) {
|
|
41
|
+
if (typeof value.error !== 'string' || !value.error.trim()) {
|
|
42
|
+
throw new n8n_workflow_1.ApplicationError('LightRAG returned a malformed query stream error');
|
|
43
|
+
}
|
|
44
|
+
throw new n8n_workflow_1.ApplicationError(`LightRAG query stream reported an error: ${value.error.trim()}`);
|
|
45
|
+
}
|
|
46
|
+
if (value.progress !== undefined) {
|
|
47
|
+
if (typeof value.progress !== 'string' || !value.progress.trim()) {
|
|
48
|
+
throw new n8n_workflow_1.ApplicationError('LightRAG returned malformed progress in the query stream');
|
|
49
|
+
}
|
|
50
|
+
(_a = callbacks.onProgress) === null || _a === void 0 ? void 0 : _a.call(callbacks, value.progress.trim());
|
|
51
|
+
}
|
|
52
|
+
if (value.references !== undefined) {
|
|
53
|
+
const references = asReferences(value.references);
|
|
54
|
+
result.references = references;
|
|
55
|
+
(_b = callbacks.onReferences) === null || _b === void 0 ? void 0 : _b.call(callbacks, references);
|
|
56
|
+
}
|
|
57
|
+
if (value.llm_generated !== undefined) {
|
|
58
|
+
if (typeof value.llm_generated !== 'boolean') {
|
|
59
|
+
throw new n8n_workflow_1.ApplicationError('LightRAG returned malformed LLM metadata in the query stream');
|
|
60
|
+
}
|
|
61
|
+
result.llm_generated = value.llm_generated;
|
|
62
|
+
}
|
|
63
|
+
if (value.response_time !== undefined) {
|
|
64
|
+
if (typeof value.response_time !== 'number' || !Number.isFinite(value.response_time)) {
|
|
65
|
+
throw new n8n_workflow_1.ApplicationError('LightRAG returned malformed timing metadata in the query stream');
|
|
66
|
+
}
|
|
67
|
+
result.response_time = value.response_time;
|
|
68
|
+
}
|
|
69
|
+
if (value.response !== undefined) {
|
|
70
|
+
if (typeof value.response !== 'string') {
|
|
71
|
+
throw new n8n_workflow_1.ApplicationError('LightRAG returned malformed response content in the query stream');
|
|
72
|
+
}
|
|
73
|
+
result.response += value.response;
|
|
74
|
+
(_c = callbacks.onResponseChunk) === null || _c === void 0 ? void 0 : _c.call(callbacks, value.response);
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
function normalizeStreamingQueryBody(value) {
|
|
80
|
+
const body = (0, request_1.parseRequestObject)(value, 'Query body');
|
|
81
|
+
return {
|
|
82
|
+
...body,
|
|
83
|
+
stream: true,
|
|
84
|
+
include_progress: true,
|
|
85
|
+
include_references: true,
|
|
86
|
+
include_chunk_content: true,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
async function parseLightRagQueryStream(stream, callbacks = {}) {
|
|
90
|
+
const decoder = new TextDecoder();
|
|
91
|
+
const result = { response: '', references: [] };
|
|
92
|
+
let buffer = '';
|
|
93
|
+
let receivedResponse = false;
|
|
94
|
+
const processLines = (flush) => {
|
|
95
|
+
var _a;
|
|
96
|
+
const lines = buffer.split('\n');
|
|
97
|
+
buffer = flush ? '' : ((_a = lines.pop()) !== null && _a !== void 0 ? _a : '');
|
|
98
|
+
for (const rawLine of lines) {
|
|
99
|
+
const line = rawLine.trim();
|
|
100
|
+
if (!line)
|
|
101
|
+
continue;
|
|
102
|
+
receivedResponse = parseStreamLine(line, result, callbacks) || receivedResponse;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
for await (const chunk of stream) {
|
|
106
|
+
if (typeof chunk === 'string') {
|
|
107
|
+
buffer += chunk;
|
|
108
|
+
}
|
|
109
|
+
else if (chunk instanceof Uint8Array) {
|
|
110
|
+
buffer += decoder.decode(chunk, { stream: true });
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
throw new n8n_workflow_1.ApplicationError('LightRAG returned an unsupported query stream chunk');
|
|
114
|
+
}
|
|
115
|
+
processLines(false);
|
|
116
|
+
}
|
|
117
|
+
buffer += decoder.decode();
|
|
118
|
+
if (buffer.trim())
|
|
119
|
+
buffer += '\n';
|
|
120
|
+
processLines(true);
|
|
121
|
+
if (!receivedResponse) {
|
|
122
|
+
throw new n8n_workflow_1.ApplicationError('LightRAG query stream ended without a response');
|
|
123
|
+
}
|
|
124
|
+
return result;
|
|
125
|
+
}
|
|
126
|
+
async function executeStreamingQuery(context, baseUrl, body, callbacks = {}) {
|
|
127
|
+
const response = await context.helpers.httpRequestWithAuthentication.call(context, 'lightRagApi', {
|
|
128
|
+
method: 'POST',
|
|
129
|
+
url: `${baseUrl}/query/stream`,
|
|
130
|
+
body,
|
|
131
|
+
json: true,
|
|
132
|
+
encoding: 'stream',
|
|
133
|
+
returnFullResponse: true,
|
|
134
|
+
abortSignal: context.getExecutionCancelSignal(),
|
|
135
|
+
});
|
|
136
|
+
const responseBody = isObject(response) && response.body !== undefined ? response.body : response;
|
|
137
|
+
if (responseBody === null ||
|
|
138
|
+
typeof responseBody !== 'object' ||
|
|
139
|
+
!(Symbol.asyncIterator in responseBody)) {
|
|
140
|
+
throw new n8n_workflow_1.ApplicationError('LightRAG did not return a readable query stream');
|
|
141
|
+
}
|
|
142
|
+
return await parseLightRagQueryStream(responseBody, callbacks);
|
|
143
|
+
}
|
|
144
|
+
function progressMessage(event) {
|
|
145
|
+
var _a;
|
|
146
|
+
return (_a = PROGRESS_MESSAGES[event]) !== null && _a !== void 0 ? _a : UNKNOWN_PROGRESS_MESSAGE;
|
|
147
|
+
}
|
|
148
|
+
function escapeMarkdown(value) {
|
|
149
|
+
return value.replace(/([\\`*_[\]{}()#+\-.!|>])/g, '\\$1');
|
|
150
|
+
}
|
|
151
|
+
function sourceName(filePath, index) {
|
|
152
|
+
if (typeof filePath !== 'string' || !filePath.trim())
|
|
153
|
+
return `Источник ${index + 1}`;
|
|
154
|
+
const segments = filePath.trim().split(/[\\/]/);
|
|
155
|
+
return segments.at(-1) || `Источник ${index + 1}`;
|
|
156
|
+
}
|
|
157
|
+
function excerpt(reference) {
|
|
158
|
+
if (!Array.isArray(reference.content))
|
|
159
|
+
return undefined;
|
|
160
|
+
const content = reference.content.find((candidate) => typeof candidate === 'string' && candidate.trim());
|
|
161
|
+
if (!content)
|
|
162
|
+
return undefined;
|
|
163
|
+
const normalized = content.replace(/\s+/g, ' ').trim();
|
|
164
|
+
const characters = Array.from(normalized);
|
|
165
|
+
return characters.length > 240 ? `${characters.slice(0, 240).join('')}…` : normalized;
|
|
166
|
+
}
|
|
167
|
+
function formatReferencesMessage(references) {
|
|
168
|
+
const uniqueReferences = [];
|
|
169
|
+
const seenPaths = new Set();
|
|
170
|
+
for (const reference of references) {
|
|
171
|
+
const path = typeof reference.file_path === 'string' ? reference.file_path.trim() : '';
|
|
172
|
+
const key = path || JSON.stringify(reference);
|
|
173
|
+
if (seenPaths.has(key))
|
|
174
|
+
continue;
|
|
175
|
+
seenPaths.add(key);
|
|
176
|
+
uniqueReferences.push(reference);
|
|
177
|
+
if (uniqueReferences.length === 3)
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
if (uniqueReferences.length === 0) {
|
|
181
|
+
return '**Поиск завершён:** релевантные источники не найдены.\n\n';
|
|
182
|
+
}
|
|
183
|
+
const items = uniqueReferences.map((reference, index) => {
|
|
184
|
+
const name = escapeMarkdown(sourceName(reference.file_path, index));
|
|
185
|
+
const content = excerpt(reference);
|
|
186
|
+
return content
|
|
187
|
+
? `${index + 1}. **${name}** — ${escapeMarkdown(content)}`
|
|
188
|
+
: `${index + 1}. **${name}**`;
|
|
189
|
+
});
|
|
190
|
+
return `**Найденные материалы:**\n\n${items.join('\n\n')}\n\n`;
|
|
191
|
+
}
|
|
192
|
+
//# sourceMappingURL=streamingQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streamingQuery.js","sourceRoot":"","sources":["../../../nodes/LightRag/streamingQuery.ts"],"names":[],"mappings":";;AAmHA,kEAUC;AAED,4DAyCC;AAED,sDA8BC;AAED,0CAEC;AAsBD,0DA0BC;AA3PD,+CAAgD;AAChD,qDAA6D;AAE7D,MAAM,iBAAiB,GAA2B;IACjD,mBAAmB,EAAE,8BAA8B;IACnD,mBAAmB,EAAE,4BAA4B;IACjD,oBAAoB,EAAE,oBAAoB;IAC1C,iBAAiB,EAAE,mCAAmC;IACtD,SAAS,EAAE,uCAAuC;IAClD,mBAAmB,EAAE,4CAA4C;CACjE,CAAC;AAEF,MAAM,wBAAwB,GAAG,oCAAoC,CAAC;AAoBtE,SAAS,QAAQ,CAAC,KAAc;IAC/B,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC7E,CAAC;AAED,SAAS,YAAY,CAAC,KAAc;IACnC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QACrD,MAAM,IAAI,+BAAgB,CAAC,4DAA4D,CAAC,CAAC;IAC1F,CAAC;IAED,OAAO,KAA0B,CAAC;AACnC,CAAC;AAED,SAAS,eAAe,CACvB,IAAY,EACZ,MAA4B,EAC5B,SAAkC;;IAElC,IAAI,KAAc,CAAC;IAEnB,IAAI,CAAC;QACJ,KAAK,GAAG,IAAI,CAAC,KAAK,CA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