aotrautils-srv 0.0.1971 → 0.0.1974
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 (
|
|
3
|
+
/*utils COMMONS library associated with aotra version : «1_29072022-2359 (09/09/2026-01:11:05)»*/
|
|
4
4
|
/*-----------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
6
|
|
|
@@ -489,6 +489,8 @@ window.aotestMethods.getScenariiByName=function(allTests, scenariiNames){
|
|
|
489
489
|
}, null, null, scenario=>contains(scenariiNames,scenario.name));
|
|
490
490
|
return results;
|
|
491
491
|
}
|
|
492
|
+
|
|
493
|
+
// Structure : appId > testsType > test > scenario
|
|
492
494
|
window.aotestMethods.getNumberOfScenariiInApp=function(allTestsBagForClientIdForAppReadOnly, testsType){
|
|
493
495
|
let currentScenariiNumberInApp=0;
|
|
494
496
|
window.aotestMethods.iterateOverScenarii(allTestsBagForClientIdForAppReadOnly, (scenario)=>{
|
|
@@ -498,7 +500,7 @@ window.aotestMethods.getNumberOfScenariiInApp=function(allTestsBagForClientIdFor
|
|
|
498
500
|
}
|
|
499
501
|
window.aotestMethods.getNumberOfScenariiInGlobal=function(allTestsBagForClientReadOnly, testsType){
|
|
500
502
|
let currentScenariiNumber=0;
|
|
501
|
-
foreach(allTestsBagForClientReadOnly, (allTestsBag,
|
|
503
|
+
foreach(allTestsBagForClientReadOnly, (allTestsBag, appId)=>{
|
|
502
504
|
currentScenariiNumber+=aotestMethods.getNumberOfScenariiInApp(allTestsBag, testsType);
|
|
503
505
|
});
|
|
504
506
|
return currentScenariiNumber;
|
|
@@ -5473,7 +5475,7 @@ window.AOTRAUTILS_LIB_IS_LOADED=true;
|
|
|
5473
5475
|
|
|
5474
5476
|
|
|
5475
5477
|
|
|
5476
|
-
/*utils AI library associated with aotra version : «1_29072022-2359 (
|
|
5478
|
+
/*utils AI library associated with aotra version : «1_29072022-2359 (09/09/2026-01:11:05)»*/
|
|
5477
5479
|
/*-----------------------------------------------------------------------------*/
|
|
5478
5480
|
|
|
5479
5481
|
|
|
@@ -5551,9 +5553,15 @@ window.LLMAPIClient=class LLMAPIClient{
|
|
|
5551
5553
|
|
|
5552
5554
|
const messages=this.getMessages(newDefaultPrompt, userPrompt);
|
|
5553
5555
|
|
|
5554
|
-
|
|
5556
|
+
try{
|
|
5557
|
+
const result=await this.launchLLMRequest(AIAPIKey, messages);
|
|
5558
|
+
return result;
|
|
5559
|
+
}catch(error){
|
|
5560
|
+
// TRACE
|
|
5561
|
+
lognow("ERROR : LLM provider returned an error when prompted, returning error object, wrapped : ",error);
|
|
5562
|
+
return {error:error};
|
|
5563
|
+
}
|
|
5555
5564
|
|
|
5556
|
-
return result;
|
|
5557
5565
|
}
|
|
5558
5566
|
|
|
5559
5567
|
|
|
@@ -5566,14 +5574,14 @@ window.LLMAPIClient=class LLMAPIClient{
|
|
|
5566
5574
|
}
|
|
5567
5575
|
|
|
5568
5576
|
|
|
5569
|
-
/*private*/
|
|
5577
|
+
/*private*/launchLLMRequest(AIAPIKey, messages){
|
|
5570
5578
|
|
|
5571
5579
|
const self=this;
|
|
5572
5580
|
|
|
5573
5581
|
|
|
5574
5582
|
const headers=this.getAPIRequestHeaders(AIAPIKey);
|
|
5575
5583
|
|
|
5576
|
-
const parameters=getAPIRequestParameters(messages);
|
|
5584
|
+
const parameters=this.getAPIRequestParameters(messages);
|
|
5577
5585
|
|
|
5578
5586
|
return new Promise((resolve,reject)=>{
|
|
5579
5587
|
performHTTPRequest(this.apiURL, "POST", headers, parameters, true).then((responseObj)=>{
|
|
@@ -5585,9 +5593,10 @@ window.LLMAPIClient=class LLMAPIClient{
|
|
|
5585
5593
|
|
|
5586
5594
|
if(data.error){
|
|
5587
5595
|
const error=data.error;
|
|
5596
|
+
|
|
5588
5597
|
// TRACE
|
|
5589
|
-
|
|
5590
|
-
reject(
|
|
5598
|
+
lognow("ERROR:", error);
|
|
5599
|
+
reject(error);
|
|
5591
5600
|
}
|
|
5592
5601
|
|
|
5593
5602
|
const assistantReply=self.getAssistantReply(data);
|
|
@@ -5596,6 +5605,7 @@ window.LLMAPIClient=class LLMAPIClient{
|
|
|
5596
5605
|
}).catch(errorObj=>{
|
|
5597
5606
|
const error=errorObj.error;
|
|
5598
5607
|
const httpStatus=errorObj.httpStatus;
|
|
5608
|
+
|
|
5599
5609
|
// TRACE
|
|
5600
5610
|
lognow("ERROR:", error);
|
|
5601
5611
|
reject(error);
|
|
@@ -5733,7 +5743,7 @@ window.getLLMAPIClient=(modelName, apiURL, agentRole, defaultPrompt, llmProvider
|
|
|
5733
5743
|
|
|
5734
5744
|
|
|
5735
5745
|
|
|
5736
|
-
/*utils CONSOLE library associated with aotra version : «1_29072022-2359 (
|
|
5746
|
+
/*utils CONSOLE library associated with aotra version : «1_29072022-2359 (09/09/2026-01:11:05)»*/
|
|
5737
5747
|
/*-----------------------------------------------------------------------------*/
|
|
5738
5748
|
|
|
5739
5749
|
|
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.1974",
|
|
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.1974",
|
|
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.1974",
|
|
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)",
|