@retrivora-ai/rag-engine 1.4.5 → 1.4.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.
|
@@ -153,7 +153,7 @@ function getEnvConfig(env = process.env, base) {
|
|
|
153
153
|
apiKey: (_$ = llmApiKeyByProvider[llmProvider]) != null ? _$ : "",
|
|
154
154
|
baseUrl: readString(env, "LLM_BASE_URL"),
|
|
155
155
|
systemPrompt: readString(env, "LLM_SYSTEM_PROMPT"),
|
|
156
|
-
maxTokens: readNumber(env, "LLM_MAX_TOKENS",
|
|
156
|
+
maxTokens: readNumber(env, "LLM_MAX_TOKENS", 4096),
|
|
157
157
|
temperature: readNumber(env, "LLM_TEMPERATURE", 0.7),
|
|
158
158
|
options: {
|
|
159
159
|
profile: readString(env, "LLM_UNIVERSAL_PROFILE")
|
|
@@ -2257,7 +2257,7 @@ var Pipeline = class {
|
|
|
2257
2257
|
this.reranker = new Reranker();
|
|
2258
2258
|
}
|
|
2259
2259
|
async initialize() {
|
|
2260
|
-
var _a
|
|
2260
|
+
var _a;
|
|
2261
2261
|
if (this.initialised) return;
|
|
2262
2262
|
const chartInstruction = `
|
|
2263
2263
|
|
|
@@ -2279,7 +2279,7 @@ When presenting structured data, statistics, or comparisons, decide if it is bes
|
|
|
2279
2279
|
"data": [{"name": "A", "value": 10}]
|
|
2280
2280
|
}
|
|
2281
2281
|
\`\`\``;
|
|
2282
|
-
if (!
|
|
2282
|
+
if (!this.config.llm.systemPrompt || !this.config.llm.systemPrompt.includes("```chart")) {
|
|
2283
2283
|
this.config.llm.systemPrompt = (this.config.llm.systemPrompt || "") + chartInstruction;
|
|
2284
2284
|
}
|
|
2285
2285
|
console.log(`[Pipeline] Initializing with provider: ${this.config.vectorDb.provider}...`);
|
|
@@ -2296,7 +2296,7 @@ When presenting structured data, statistics, or comparisons, decide if it is bes
|
|
|
2296
2296
|
this.entityExtractor = new EntityExtractor(this.llmProvider);
|
|
2297
2297
|
}
|
|
2298
2298
|
await this.vectorDB.initialize();
|
|
2299
|
-
if (((
|
|
2299
|
+
if (((_a = this.config.rag) == null ? void 0 : _a.architecture) === "agentic") {
|
|
2300
2300
|
this.agent = new LangChainAgent(this, this.config);
|
|
2301
2301
|
await this.agent.initialize(this.llmProvider);
|
|
2302
2302
|
}
|
package/dist/handlers/index.js
CHANGED
|
@@ -1760,7 +1760,7 @@ function getEnvConfig(env = process.env, base) {
|
|
|
1760
1760
|
apiKey: (_$ = llmApiKeyByProvider[llmProvider]) != null ? _$ : "",
|
|
1761
1761
|
baseUrl: readString(env, "LLM_BASE_URL"),
|
|
1762
1762
|
systemPrompt: readString(env, "LLM_SYSTEM_PROMPT"),
|
|
1763
|
-
maxTokens: readNumber(env, "LLM_MAX_TOKENS",
|
|
1763
|
+
maxTokens: readNumber(env, "LLM_MAX_TOKENS", 4096),
|
|
1764
1764
|
temperature: readNumber(env, "LLM_TEMPERATURE", 0.7),
|
|
1765
1765
|
options: {
|
|
1766
1766
|
profile: readString(env, "LLM_UNIVERSAL_PROFILE")
|
|
@@ -3820,7 +3820,7 @@ var Pipeline = class {
|
|
|
3820
3820
|
this.reranker = new Reranker();
|
|
3821
3821
|
}
|
|
3822
3822
|
async initialize() {
|
|
3823
|
-
var _a
|
|
3823
|
+
var _a;
|
|
3824
3824
|
if (this.initialised) return;
|
|
3825
3825
|
const chartInstruction = `
|
|
3826
3826
|
|
|
@@ -3842,7 +3842,7 @@ When presenting structured data, statistics, or comparisons, decide if it is bes
|
|
|
3842
3842
|
"data": [{"name": "A", "value": 10}]
|
|
3843
3843
|
}
|
|
3844
3844
|
\`\`\``;
|
|
3845
|
-
if (!
|
|
3845
|
+
if (!this.config.llm.systemPrompt || !this.config.llm.systemPrompt.includes("```chart")) {
|
|
3846
3846
|
this.config.llm.systemPrompt = (this.config.llm.systemPrompt || "") + chartInstruction;
|
|
3847
3847
|
}
|
|
3848
3848
|
console.log(`[Pipeline] Initializing with provider: ${this.config.vectorDb.provider}...`);
|
|
@@ -3859,7 +3859,7 @@ When presenting structured data, statistics, or comparisons, decide if it is bes
|
|
|
3859
3859
|
this.entityExtractor = new EntityExtractor(this.llmProvider);
|
|
3860
3860
|
}
|
|
3861
3861
|
await this.vectorDB.initialize();
|
|
3862
|
-
if (((
|
|
3862
|
+
if (((_a = this.config.rag) == null ? void 0 : _a.architecture) === "agentic") {
|
|
3863
3863
|
this.agent = new LangChainAgent(this, this.config);
|
|
3864
3864
|
await this.agent.initialize(this.llmProvider);
|
|
3865
3865
|
}
|
package/dist/handlers/index.mjs
CHANGED
package/dist/server.js
CHANGED
|
@@ -1806,7 +1806,7 @@ function getEnvConfig(env = process.env, base) {
|
|
|
1806
1806
|
apiKey: (_$ = llmApiKeyByProvider[llmProvider]) != null ? _$ : "",
|
|
1807
1807
|
baseUrl: readString(env, "LLM_BASE_URL"),
|
|
1808
1808
|
systemPrompt: readString(env, "LLM_SYSTEM_PROMPT"),
|
|
1809
|
-
maxTokens: readNumber(env, "LLM_MAX_TOKENS",
|
|
1809
|
+
maxTokens: readNumber(env, "LLM_MAX_TOKENS", 4096),
|
|
1810
1810
|
temperature: readNumber(env, "LLM_TEMPERATURE", 0.7),
|
|
1811
1811
|
options: {
|
|
1812
1812
|
profile: readString(env, "LLM_UNIVERSAL_PROFILE")
|
|
@@ -3911,7 +3911,7 @@ var Pipeline = class {
|
|
|
3911
3911
|
this.reranker = new Reranker();
|
|
3912
3912
|
}
|
|
3913
3913
|
async initialize() {
|
|
3914
|
-
var _a
|
|
3914
|
+
var _a;
|
|
3915
3915
|
if (this.initialised) return;
|
|
3916
3916
|
const chartInstruction = `
|
|
3917
3917
|
|
|
@@ -3933,7 +3933,7 @@ When presenting structured data, statistics, or comparisons, decide if it is bes
|
|
|
3933
3933
|
"data": [{"name": "A", "value": 10}]
|
|
3934
3934
|
}
|
|
3935
3935
|
\`\`\``;
|
|
3936
|
-
if (!
|
|
3936
|
+
if (!this.config.llm.systemPrompt || !this.config.llm.systemPrompt.includes("```chart")) {
|
|
3937
3937
|
this.config.llm.systemPrompt = (this.config.llm.systemPrompt || "") + chartInstruction;
|
|
3938
3938
|
}
|
|
3939
3939
|
console.log(`[Pipeline] Initializing with provider: ${this.config.vectorDb.provider}...`);
|
|
@@ -3950,7 +3950,7 @@ When presenting structured data, statistics, or comparisons, decide if it is bes
|
|
|
3950
3950
|
this.entityExtractor = new EntityExtractor(this.llmProvider);
|
|
3951
3951
|
}
|
|
3952
3952
|
await this.vectorDB.initialize();
|
|
3953
|
-
if (((
|
|
3953
|
+
if (((_a = this.config.rag) == null ? void 0 : _a.architecture) === "agentic") {
|
|
3954
3954
|
this.agent = new LangChainAgent(this, this.config);
|
|
3955
3955
|
await this.agent.initialize(this.llmProvider);
|
|
3956
3956
|
}
|
package/dist/server.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@retrivora-ai/rag-engine",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.6",
|
|
4
4
|
"description": "Retrivora AI is a plug-and-play AI engine for RAG chat experiences — generic vector DB + LLM provider, embeddable or standalone.",
|
|
5
5
|
"author": "Abhinav Alkuchi",
|
|
6
6
|
"license": "MIT",
|
|
@@ -146,7 +146,7 @@ export function getEnvConfig(env: Record<string, string | undefined> = process.e
|
|
|
146
146
|
apiKey: llmApiKeyByProvider[llmProvider] ?? '',
|
|
147
147
|
baseUrl: readString(env, 'LLM_BASE_URL'),
|
|
148
148
|
systemPrompt: readString(env, 'LLM_SYSTEM_PROMPT'),
|
|
149
|
-
maxTokens: readNumber(env, 'LLM_MAX_TOKENS',
|
|
149
|
+
maxTokens: readNumber(env, 'LLM_MAX_TOKENS', 4096),
|
|
150
150
|
temperature: readNumber(env, 'LLM_TEMPERATURE', 0.7),
|
|
151
151
|
options: {
|
|
152
152
|
profile: readString(env, 'LLM_UNIVERSAL_PROFILE'),
|
package/src/core/Pipeline.ts
CHANGED
|
@@ -119,7 +119,8 @@ export class Pipeline {
|
|
|
119
119
|
}
|
|
120
120
|
\`\`\``;
|
|
121
121
|
|
|
122
|
-
if (
|
|
122
|
+
// Inject chart instructions if not already present (including when systemPrompt is undefined)
|
|
123
|
+
if (!this.config.llm.systemPrompt || !this.config.llm.systemPrompt.includes('```chart')) {
|
|
123
124
|
this.config.llm.systemPrompt = (this.config.llm.systemPrompt || '') + chartInstruction;
|
|
124
125
|
}
|
|
125
126
|
|