From a1c95b67e723a4670e0a5391a162996e0539ccea Mon Sep 17 00:00:00 2001 From: Adhityan K V Date: Fri, 2 Feb 2024 11:02:31 +0100 Subject: [PATCH] only provide unique sources --- package-lock.json | 4 ++-- package.json | 2 +- src/core/llm-application.ts | 2 +- src/loaders/confluence-loader.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1dd957cc..bb2715b3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@llm-tools/embedjs", - "version": "0.0.51", + "version": "0.0.53", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@llm-tools/embedjs", - "version": "0.0.51", + "version": "0.0.53", "license": "Apache-2.0", "dependencies": { "@huggingface/inference": "^2.6.4", diff --git a/package.json b/package.json index 2cf11531..4853ed59 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@llm-tools/embedjs", - "version": "0.0.51", + "version": "0.0.53", "description": "A NodeJS RAG framework to easily work with LLMs and custom datasets", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/core/llm-application.ts b/src/core/llm-application.ts index 36ca062b..45b605ec 100644 --- a/src/core/llm-application.ts +++ b/src/core/llm-application.ts @@ -162,7 +162,7 @@ export class LLMApplication { sources: string[]; }> { const context = await this.getContext(userQuery); - const sources = context.supportingContext.map((chunk) => chunk.metadata.source); + const sources = [...new Set(context.supportingContext.map((chunk) => chunk.metadata.source))]; return { sources, diff --git a/src/loaders/confluence-loader.ts b/src/loaders/confluence-loader.ts index 15a6e579..58625aa4 100644 --- a/src/loaders/confluence-loader.ts +++ b/src/loaders/confluence-loader.ts @@ -82,7 +82,7 @@ export class ConfluenceLoader extends BaseLoader<{ type: 'ConfluenceLoader' }> { contentHash: result.contentHash, metadata: { type: <'ConfluenceLoader'>'ConfluenceLoader', - source: `${this.confluenceBaseUrl}${content._links.webui}`, + source: `${this.confluenceBaseUrl}/wiki${content._links.webui}`, }, }; }