@jeliq/app-sdk-llm 1.1.22 → 1.1.24
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/lib/commonjs/controllers/genJSON.js +6 -24
- package/lib/commonjs/controllers/genJSON.js.map +1 -1
- package/lib/commonjs/utils/retryWithBackoff.js +40 -0
- package/lib/commonjs/utils/retryWithBackoff.js.map +1 -0
- package/lib/module/controllers/genJSON.js +6 -24
- package/lib/module/controllers/genJSON.js.map +1 -1
- package/lib/module/utils/retryWithBackoff.js +34 -0
- package/lib/module/utils/retryWithBackoff.js.map +1 -0
- package/lib/typescript/src/controllers/genJSON.d.ts +5 -1
- package/lib/typescript/src/controllers/genJSON.d.ts.map +1 -1
- package/lib/typescript/src/utils/retryWithBackoff.d.ts +9 -0
- package/lib/typescript/src/utils/retryWithBackoff.d.ts.map +1 -0
- package/package.json +3 -3
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = genJSON;
|
|
7
|
-
var _chains = require("langchain/chains");
|
|
8
7
|
var _output_parsers = require("langchain/output_parsers");
|
|
9
8
|
var _ShouldMustTemplate = _interopRequireDefault(require("../templates/ShouldMustTemplate"));
|
|
9
|
+
var _retryWithBackoff = require("../utils/retryWithBackoff");
|
|
10
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
async function genJSON(context, taskName, template, args) {
|
|
11
|
+
async function genJSON(context, taskName, template, args, options) {
|
|
12
12
|
if (!(context !== null && context !== void 0 && context.getLLM)) {
|
|
13
13
|
throw new Error("getLLM is not set");
|
|
14
14
|
}
|
|
@@ -23,28 +23,10 @@ async function genJSON(context, taskName, template, args) {
|
|
|
23
23
|
throw new Error("outputParser is not set");
|
|
24
24
|
}
|
|
25
25
|
const llm = context.getLLM(taskName, await promptTemplate.format(args));
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
prompt: promptTemplate
|
|
26
|
+
const fixParser = _output_parsers.OutputFixingParser.fromLLM(llm, parser).withRetry({
|
|
27
|
+
stopAfterAttempt: 5
|
|
29
28
|
});
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
return await parser.parse(response.text);
|
|
33
|
-
} catch (e) {
|
|
34
|
-
let count = 0;
|
|
35
|
-
async function doFix() {
|
|
36
|
-
count++;
|
|
37
|
-
try {
|
|
38
|
-
const llmFixingParser = context.getLLM(taskName, await promptTemplate.format(args), args);
|
|
39
|
-
const fixParser = _output_parsers.OutputFixingParser.fromLLM(llmFixingParser, parser);
|
|
40
|
-
const fixed = await fixParser.parse(response.text);
|
|
41
|
-
return fixed;
|
|
42
|
-
} catch (e) {
|
|
43
|
-
if (count > 5) throw e;
|
|
44
|
-
return await doFix();
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return await doFix();
|
|
48
|
-
}
|
|
29
|
+
const chain = promptTemplate.pipe(llm).pipe(fixParser);
|
|
30
|
+
return await (0, _retryWithBackoff.retryWithBackoff)(() => chain.invoke(args), (options === null || options === void 0 ? void 0 : options.maxRetries) ?? 5, options === null || options === void 0 ? void 0 : options.initialDelayMs, options === null || options === void 0 ? void 0 : options.maxDelayMs);
|
|
49
31
|
}
|
|
50
32
|
//# sourceMappingURL=genJSON.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_output_parsers","require","_ShouldMustTemplate","_interopRequireDefault","_retryWithBackoff","e","__esModule","default","genJSON","context","taskName","template","args","options","getLLM","Error","outputParser","StructuredOutputParser","fromZodSchema","outputSchema","promptTemplate","createShouldMustTemplate","Object","keys","inputDef","map","key","name","type","description","summary","shouldSection","mustSection","example","partialVars","parser","llm","format","fixParser","OutputFixingParser","fromLLM","withRetry","stopAfterAttempt","chain","pipe","retryWithBackoff","invoke","maxRetries","initialDelayMs","maxDelayMs"],"sourceRoot":"../../../src","sources":["controllers/genJSON.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,CAACzB,IAAI,CACpC,CAAC;EAED,MAAM0B,SAAS,GAAGC,kCAAkB,CAACC,OAAO,CACxCJ,GAAG,EACHD,MACJ,CAAC,CAACM,SAAS,CAAC;IAAEC,gBAAgB,EAAE;EAAE,CAAC,CAAC;EAEpC,MAAMC,KAAK,GAAGvB,cAAc,CAACwB,IAAI,CAACR,GAAG,CAAC,CAACQ,IAAI,CAACN,SAAS,CAAC;EAEtD,OAAO,MAAM,IAAAO,kCAAgB,EACzB,MAAMF,KAAK,CAACG,MAAM,CAAClC,IAAI,CAAC,EACxB,CAAAC,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEkC,UAAU,KAAI,CAAC,EACxBlC,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEmC,cAAc,EAAEnC,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEoC,UACtC,CAAC;AACL","ignoreList":[]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.retryWithBackoff = retryWithBackoff;
|
|
7
|
+
/**
|
|
8
|
+
* Retry function with exponential backoff
|
|
9
|
+
* @param fn Function to retry
|
|
10
|
+
* @param maxRetries Maximum number of retries (default: 5)
|
|
11
|
+
* @param initialDelay Initial delay in milliseconds (default: 2000)
|
|
12
|
+
* @param maxDelay Maximum delay in milliseconds (default: 60000)
|
|
13
|
+
*/
|
|
14
|
+
async function retryWithBackoff(fn, maxRetries = 5, initialDelay = 2000, maxDelay = 60000) {
|
|
15
|
+
let lastError;
|
|
16
|
+
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
17
|
+
try {
|
|
18
|
+
return await fn();
|
|
19
|
+
} catch (error) {
|
|
20
|
+
lastError = error;
|
|
21
|
+
if (attempt === maxRetries) {
|
|
22
|
+
console.error(`Failed after ${maxRetries + 1} attempts:`, lastError);
|
|
23
|
+
throw lastError;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Calculate delay with exponential backoff and jitter
|
|
27
|
+
const exponentialDelay = Math.min(initialDelay * Math.pow(2, attempt), maxDelay);
|
|
28
|
+
const jitter = Math.random() * 1000; // Add random jitter up to 1 second
|
|
29
|
+
const delay = exponentialDelay + jitter;
|
|
30
|
+
console.warn(`Attempt ${attempt + 1} failed. Retrying in ${Math.round(delay)}ms...`, {
|
|
31
|
+
error: lastError.message,
|
|
32
|
+
attempt: attempt + 1,
|
|
33
|
+
maxRetries: maxRetries + 1
|
|
34
|
+
});
|
|
35
|
+
await new Promise(resolve => setTimeout(resolve, delay));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
throw lastError;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=retryWithBackoff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["retryWithBackoff","fn","maxRetries","initialDelay","maxDelay","lastError","attempt","error","console","exponentialDelay","Math","min","pow","jitter","random","delay","warn","round","message","Promise","resolve","setTimeout"],"sourceRoot":"../../../src","sources":["utils/retryWithBackoff.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeA,gBAAgBA,CAClCC,EAAoB,EACpBC,UAAkB,GAAG,CAAC,EACtBC,YAAoB,GAAG,IAAI,EAC3BC,QAAgB,GAAG,KAAK,EACd;EACV,IAAIC,SAA4B;EAEhC,KAAK,IAAIC,OAAO,GAAG,CAAC,EAAEA,OAAO,IAAIJ,UAAU,EAAEI,OAAO,EAAE,EAAE;IACpD,IAAI;MACA,OAAO,MAAML,EAAE,CAAC,CAAC;IACrB,CAAC,CAAC,OAAOM,KAAK,EAAE;MACZF,SAAS,GAAGE,KAAc;MAE1B,IAAID,OAAO,KAAKJ,UAAU,EAAE;QACxBM,OAAO,CAACD,KAAK,CAAC,gBAAgBL,UAAU,GAAG,CAAC,YAAY,EAAEG,SAAS,CAAC;QACpE,MAAMA,SAAS;MACnB;;MAEA;MACA,MAAMI,gBAAgB,GAAGC,IAAI,CAACC,GAAG,CAACR,YAAY,GAAGO,IAAI,CAACE,GAAG,CAAC,CAAC,EAAEN,OAAO,CAAC,EAAEF,QAAQ,CAAC;MAChF,MAAMS,MAAM,GAAGH,IAAI,CAACI,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;MACrC,MAAMC,KAAK,GAAGN,gBAAgB,GAAGI,MAAM;MAEvCL,OAAO,CAACQ,IAAI,CAAC,WAAWV,OAAO,GAAG,CAAC,wBAAwBI,IAAI,CAACO,KAAK,CAACF,KAAK,CAAC,OAAO,EAAE;QACjFR,KAAK,EAAEF,SAAS,CAACa,OAAO;QACxBZ,OAAO,EAAEA,OAAO,GAAG,CAAC;QACpBJ,UAAU,EAAEA,UAAU,GAAG;MAC7B,CAAC,CAAC;MAEF,MAAM,IAAIiB,OAAO,CAACC,OAAO,IAAIC,UAAU,CAACD,OAAO,EAAEL,KAAK,CAAC,CAAC;IAC5D;EACJ;EAEA,MAAMV,SAAS;AACnB","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { LLMChain } from "langchain/chains";
|
|
2
1
|
import { OutputFixingParser, StructuredOutputParser } from "langchain/output_parsers";
|
|
3
2
|
import createShouldMustTemplate from "../templates/ShouldMustTemplate";
|
|
4
|
-
|
|
3
|
+
import { retryWithBackoff } from "../utils/retryWithBackoff";
|
|
4
|
+
export default async function genJSON(context, taskName, template, args, options) {
|
|
5
5
|
if (!(context !== null && context !== void 0 && context.getLLM)) {
|
|
6
6
|
throw new Error("getLLM is not set");
|
|
7
7
|
}
|
|
@@ -16,28 +16,10 @@ export default async function genJSON(context, taskName, template, args) {
|
|
|
16
16
|
throw new Error("outputParser is not set");
|
|
17
17
|
}
|
|
18
18
|
const llm = context.getLLM(taskName, await promptTemplate.format(args));
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
prompt: promptTemplate
|
|
19
|
+
const fixParser = OutputFixingParser.fromLLM(llm, parser).withRetry({
|
|
20
|
+
stopAfterAttempt: 5
|
|
22
21
|
});
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
return await parser.parse(response.text);
|
|
26
|
-
} catch (e) {
|
|
27
|
-
let count = 0;
|
|
28
|
-
async function doFix() {
|
|
29
|
-
count++;
|
|
30
|
-
try {
|
|
31
|
-
const llmFixingParser = context.getLLM(taskName, await promptTemplate.format(args), args);
|
|
32
|
-
const fixParser = OutputFixingParser.fromLLM(llmFixingParser, parser);
|
|
33
|
-
const fixed = await fixParser.parse(response.text);
|
|
34
|
-
return fixed;
|
|
35
|
-
} catch (e) {
|
|
36
|
-
if (count > 5) throw e;
|
|
37
|
-
return await doFix();
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return await doFix();
|
|
41
|
-
}
|
|
22
|
+
const chain = promptTemplate.pipe(llm).pipe(fixParser);
|
|
23
|
+
return await retryWithBackoff(() => chain.invoke(args), (options === null || options === void 0 ? void 0 : options.maxRetries) ?? 5, options === null || options === void 0 ? void 0 : options.initialDelayMs, options === null || options === void 0 ? void 0 : options.maxDelayMs);
|
|
42
24
|
}
|
|
43
25
|
//# sourceMappingURL=genJSON.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["OutputFixingParser","StructuredOutputParser","createShouldMustTemplate","retryWithBackoff","genJSON","context","taskName","template","args","options","getLLM","Error","outputParser","fromZodSchema","outputSchema","promptTemplate","Object","keys","inputDef","map","key","name","type","description","summary","shouldSection","mustSection","example","partialVars","parser","llm","format","fixParser","fromLLM","withRetry","stopAfterAttempt","chain","pipe","invoke","maxRetries","initialDelayMs","maxDelayMs"],"sourceRoot":"../../../src","sources":["controllers/genJSON.ts"],"mappings":"AACA,SAASA,kBAAkB,EAAEC,sBAAsB,QAAQ,0BAA0B;AAGrF,OAAOC,wBAAwB,MAAM,iCAAiC;AAEtE,SAASC,gBAAgB,QAAQ,2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ACO,IAAI,CAACL,SAAS,CAAC;EAEtD,OAAO,MAAM7B,gBAAgB,CACzB,MAAMiC,KAAK,CAACE,MAAM,CAAC9B,IAAI,CAAC,EACxB,CAAAC,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAE8B,UAAU,KAAI,CAAC,EACxB9B,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAE+B,cAAc,EAAE/B,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEgC,UACtC,CAAC;AACL","ignoreList":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retry function with exponential backoff
|
|
3
|
+
* @param fn Function to retry
|
|
4
|
+
* @param maxRetries Maximum number of retries (default: 5)
|
|
5
|
+
* @param initialDelay Initial delay in milliseconds (default: 2000)
|
|
6
|
+
* @param maxDelay Maximum delay in milliseconds (default: 60000)
|
|
7
|
+
*/
|
|
8
|
+
export async function retryWithBackoff(fn, maxRetries = 5, initialDelay = 2000, maxDelay = 60000) {
|
|
9
|
+
let lastError;
|
|
10
|
+
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
11
|
+
try {
|
|
12
|
+
return await fn();
|
|
13
|
+
} catch (error) {
|
|
14
|
+
lastError = error;
|
|
15
|
+
if (attempt === maxRetries) {
|
|
16
|
+
console.error(`Failed after ${maxRetries + 1} attempts:`, lastError);
|
|
17
|
+
throw lastError;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Calculate delay with exponential backoff and jitter
|
|
21
|
+
const exponentialDelay = Math.min(initialDelay * Math.pow(2, attempt), maxDelay);
|
|
22
|
+
const jitter = Math.random() * 1000; // Add random jitter up to 1 second
|
|
23
|
+
const delay = exponentialDelay + jitter;
|
|
24
|
+
console.warn(`Attempt ${attempt + 1} failed. Retrying in ${Math.round(delay)}ms...`, {
|
|
25
|
+
error: lastError.message,
|
|
26
|
+
attempt: attempt + 1,
|
|
27
|
+
maxRetries: maxRetries + 1
|
|
28
|
+
});
|
|
29
|
+
await new Promise(resolve => setTimeout(resolve, delay));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
throw lastError;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=retryWithBackoff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["retryWithBackoff","fn","maxRetries","initialDelay","maxDelay","lastError","attempt","error","console","exponentialDelay","Math","min","pow","jitter","random","delay","warn","round","message","Promise","resolve","setTimeout"],"sourceRoot":"../../../src","sources":["utils/retryWithBackoff.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeA,gBAAgBA,CAClCC,EAAoB,EACpBC,UAAkB,GAAG,CAAC,EACtBC,YAAoB,GAAG,IAAI,EAC3BC,QAAgB,GAAG,KAAK,EACd;EACV,IAAIC,SAA4B;EAEhC,KAAK,IAAIC,OAAO,GAAG,CAAC,EAAEA,OAAO,IAAIJ,UAAU,EAAEI,OAAO,EAAE,EAAE;IACpD,IAAI;MACA,OAAO,MAAML,EAAE,CAAC,CAAC;IACrB,CAAC,CAAC,OAAOM,KAAK,EAAE;MACZF,SAAS,GAAGE,KAAc;MAE1B,IAAID,OAAO,KAAKJ,UAAU,EAAE;QACxBM,OAAO,CAACD,KAAK,CAAC,gBAAgBL,UAAU,GAAG,CAAC,YAAY,EAAEG,SAAS,CAAC;QACpE,MAAMA,SAAS;MACnB;;MAEA;MACA,MAAMI,gBAAgB,GAAGC,IAAI,CAACC,GAAG,CAACR,YAAY,GAAGO,IAAI,CAACE,GAAG,CAAC,CAAC,EAAEN,OAAO,CAAC,EAAEF,QAAQ,CAAC;MAChF,MAAMS,MAAM,GAAGH,IAAI,CAACI,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;MACrC,MAAMC,KAAK,GAAGN,gBAAgB,GAAGI,MAAM;MAEvCL,OAAO,CAACQ,IAAI,CAAC,WAAWV,OAAO,GAAG,CAAC,wBAAwBI,IAAI,CAACO,KAAK,CAACF,KAAK,CAAC,OAAO,EAAE;QACjFR,KAAK,EAAEF,SAAS,CAACa,OAAO;QACxBZ,OAAO,EAAEA,OAAO,GAAG,CAAC;QACpBJ,UAAU,EAAEA,UAAU,GAAG;MAC7B,CAAC,CAAC;MAEF,MAAM,IAAIiB,OAAO,CAACC,OAAO,IAAIC,UAAU,CAACD,OAAO,EAAEL,KAAK,CAAC,CAAC;IAC5D;EACJ;EAEA,MAAMV,SAAS;AACnB","ignoreList":[]}
|
|
@@ -10,5 +10,9 @@ export default function genJSON<InputKeys extends string | number | symbol, Outp
|
|
|
10
10
|
mustSection?: PromptElement[];
|
|
11
11
|
example?: PromptElement[];
|
|
12
12
|
partialVars?: Record<string, string | (() => Promise<string> | (() => string))>;
|
|
13
|
-
}, args: Record<InputKeys, string | undefined | null
|
|
13
|
+
}, args: Record<InputKeys, string | undefined | null>, options?: {
|
|
14
|
+
maxRetries?: number;
|
|
15
|
+
initialDelayMs?: number;
|
|
16
|
+
maxDelayMs?: number;
|
|
17
|
+
}): Promise<Output>;
|
|
14
18
|
//# sourceMappingURL=genJSON.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genJSON.d.ts","sourceRoot":"","sources":["../../../../src/controllers/genJSON.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"genJSON.d.ts","sourceRoot":"","sources":["../../../../src/controllers/genJSON.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAGhC,wBAA8B,OAAO,CAAC,SAAS,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,MAAM,EACpF,OAAO,EAAE,cAAc,CAAC,GAAG,CAAC,EAC5B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE;IACN,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IAChC,aAAa,CAAC,EAAE,aAAa,EAAE,CAAC;IAChC,WAAW,CAAC,EAAE,aAAa,EAAE,CAAC;IAC9B,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,MAAM,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,MAAM,CAAC,CAAC,CAAC,CAAC;CACnF,EACD,IAAI,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,EAClD,OAAO,CAAC,EAAE;IACN,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,GACF,OAAO,CAAC,MAAM,CAAC,CA4CjB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retry function with exponential backoff
|
|
3
|
+
* @param fn Function to retry
|
|
4
|
+
* @param maxRetries Maximum number of retries (default: 5)
|
|
5
|
+
* @param initialDelay Initial delay in milliseconds (default: 2000)
|
|
6
|
+
* @param maxDelay Maximum delay in milliseconds (default: 60000)
|
|
7
|
+
*/
|
|
8
|
+
export declare function retryWithBackoff<T>(fn: () => Promise<T>, maxRetries?: number, initialDelay?: number, maxDelay?: number): Promise<T>;
|
|
9
|
+
//# sourceMappingURL=retryWithBackoff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retryWithBackoff.d.ts","sourceRoot":"","sources":["../../../../src/utils/retryWithBackoff.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EACpC,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,UAAU,GAAE,MAAU,EACtB,YAAY,GAAE,MAAa,EAC3B,QAAQ,GAAE,MAAc,GACzB,OAAO,CAAC,CAAC,CAAC,CA8BZ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jeliq/app-sdk-llm",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.24",
|
|
4
4
|
"homepage": "https://jeliq.ai/",
|
|
5
5
|
"author": "Jeliq.ai",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@langchain/google-vertexai": "^0.2.18",
|
|
24
24
|
"@langchain/openai": "^0.6.14",
|
|
25
25
|
"@langchain/textsplitters": "^0.0.3",
|
|
26
|
-
"langchain": "^0.3.
|
|
26
|
+
"langchain": "^0.3.27",
|
|
27
27
|
"lodash": "^4.17.21",
|
|
28
28
|
"ts-node": "^10.9.2"
|
|
29
29
|
},
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"typescript": "^5.9.3"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@jeliq/app-sdk-core": "^
|
|
41
|
+
"@jeliq/app-sdk-core": "^3.0.0",
|
|
42
42
|
"zod": ">=3.25.76"
|
|
43
43
|
},
|
|
44
44
|
"react-native-builder-bob": {
|