aotrautils-srv 0.0.1975 → 0.0.1978
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
/*utils COMMONS library associated with aotra version : «1_29072022-2359 (09/09/2026-
|
|
3
|
+
/*utils COMMONS library associated with aotra version : «1_29072022-2359 (09/09/2026-23:02:10)»*/
|
|
4
4
|
/*-----------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
6
|
|
|
@@ -5475,7 +5475,7 @@ window.AOTRAUTILS_LIB_IS_LOADED=true;
|
|
|
5475
5475
|
|
|
5476
5476
|
|
|
5477
5477
|
|
|
5478
|
-
/*utils AI library associated with aotra version : «1_29072022-2359 (09/09/2026-
|
|
5478
|
+
/*utils AI library associated with aotra version : «1_29072022-2359 (09/09/2026-23:02:10)»*/
|
|
5479
5479
|
/*-----------------------------------------------------------------------------*/
|
|
5480
5480
|
|
|
5481
5481
|
|
|
@@ -5541,7 +5541,9 @@ window.LLMAPIClient=class LLMAPIClient{
|
|
|
5541
5541
|
this.defaultPrompt=defaultPrompt;
|
|
5542
5542
|
}
|
|
5543
5543
|
|
|
5544
|
-
async getAnswer(AIAPIKey, userPrompt, defaultPromptParameters={})
|
|
5544
|
+
async getAnswer(AIAPIKey, userPrompt, defaultPromptParameters={})
|
|
5545
|
+
/*THROWS LLMTextGenerationError*/
|
|
5546
|
+
{
|
|
5545
5547
|
|
|
5546
5548
|
const PARAMETERS_DELIMITERS=["<",">"];
|
|
5547
5549
|
|
|
@@ -5556,10 +5558,10 @@ window.LLMAPIClient=class LLMAPIClient{
|
|
|
5556
5558
|
try{
|
|
5557
5559
|
const result=await this.launchLLMRequest(AIAPIKey, messages);
|
|
5558
5560
|
return result;
|
|
5559
|
-
}catch(
|
|
5561
|
+
}catch(llmTextGenerationError){
|
|
5560
5562
|
// TRACE
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
+
const errorMessage="ERROR : LLM provider returned an error when prompted";
|
|
5564
|
+
throw new Error(errorMessage, {cause:llmTextGenerationError});
|
|
5563
5565
|
}
|
|
5564
5566
|
|
|
5565
5567
|
}
|
|
@@ -5573,7 +5575,7 @@ window.LLMAPIClient=class LLMAPIClient{
|
|
|
5573
5575
|
];
|
|
5574
5576
|
}
|
|
5575
5577
|
|
|
5576
|
-
|
|
5578
|
+
// DO NOT USE DIRECTLY !!!
|
|
5577
5579
|
/*private*/launchLLMRequest(AIAPIKey, messages){
|
|
5578
5580
|
|
|
5579
5581
|
const self=this;
|
|
@@ -5596,6 +5598,7 @@ window.LLMAPIClient=class LLMAPIClient{
|
|
|
5596
5598
|
|
|
5597
5599
|
// TRACE
|
|
5598
5600
|
lognow("ERROR:", error);
|
|
5601
|
+
|
|
5599
5602
|
reject(error);
|
|
5600
5603
|
}
|
|
5601
5604
|
|
|
@@ -5603,6 +5606,7 @@ window.LLMAPIClient=class LLMAPIClient{
|
|
|
5603
5606
|
|
|
5604
5607
|
resolve(assistantReply);
|
|
5605
5608
|
}).catch(errorObj=>{
|
|
5609
|
+
|
|
5606
5610
|
const error=errorObj.error;
|
|
5607
5611
|
const httpStatus=errorObj.httpStatus;
|
|
5608
5612
|
|
|
@@ -5743,7 +5747,7 @@ window.getLLMAPIClient=(modelName, apiURL, agentRole, defaultPrompt, llmProvider
|
|
|
5743
5747
|
|
|
5744
5748
|
|
|
5745
5749
|
|
|
5746
|
-
/*utils CONSOLE library associated with aotra version : «1_29072022-2359 (09/09/2026-
|
|
5750
|
+
/*utils CONSOLE library associated with aotra version : «1_29072022-2359 (09/09/2026-23:02:10)»*/
|
|
5747
5751
|
/*-----------------------------------------------------------------------------*/
|
|
5748
5752
|
|
|
5749
5753
|
|
aotrautils-srv/package-lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aotrautils-srv",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1978",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "aotrautils-srv",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.1978",
|
|
10
10
|
"license": "HGPL-1.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"atob": "^2.1.2",
|
aotrautils-srv/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aotrautils-srv",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1978",
|
|
4
4
|
"main": "aotrautils-srv.build.js",
|
|
5
5
|
"description": "A library for vanilla javascript utils (server-side) used in aotra javascript CMS",
|
|
6
6
|
"author": "Jeremie Ratomposon <info@alqemia.com> (https://alqemia.com)",
|