aotrautils-srv 0.0.662 → 0.0.664

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 (20/10/2023-00:31:21)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (20/10/2023-00:44:14)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -5033,12 +5033,12 @@ window.stringifyObject=function(objectToStringify){
5033
5033
 
5034
5034
  class OpenAIAPIClient{
5035
5035
 
5036
- constructor(modelName, apiURL, agentRole, prompt){
5036
+ constructor(apiKey, modelName, apiURL, agentRole, prompt){
5037
5037
 
5038
5038
  //DBG
5039
5039
  lognow(">>>>>>>>>>>>>>>>!!!!!!apiURL:",apiURL);
5040
5040
 
5041
-
5041
+ this.apiKey=apiKey;
5042
5042
  this.modelName=modelName;
5043
5043
  this.apiURL=apiURL;
5044
5044
  this.agentRole=agentRole;
@@ -5074,6 +5074,7 @@ class OpenAIAPIClient{
5074
5074
  .then(data => {
5075
5075
 
5076
5076
  if(data.error){
5077
+ const error=data.error;
5077
5078
  // TRACE
5078
5079
  console.error("Error:", error);
5079
5080
  reject(""+error);
@@ -5111,12 +5112,8 @@ class OpenAIAPIClient{
5111
5112
 
5112
5113
 
5113
5114
  // Nodejs compatibility :
5114
- getOpenAIAPIClient=(modelName, apiURL, agentRole, prompt)=>{
5115
-
5116
- // DBG
5117
- lognow(`TEST : ${modelName}, ${apiURL}, ${agentRole}, ${prompt}.`)
5118
-
5119
- return new OpenAIAPIClient(modelName, apiURL, agentRole, prompt);
5115
+ getOpenAIAPIClient=(apiKey, modelName, apiURL, agentRole, prompt)=>{
5116
+ return new OpenAIAPIClient(apiKey, modelName, apiURL, agentRole, prompt);
5120
5117
  };
5121
5118
 
5122
5119
 
@@ -5131,7 +5128,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
5131
5128
 
5132
5129
 
5133
5130
 
5134
- /*utils SERVER library associated with aotra version : «1_29072022-2359 (20/10/2023-00:31:21)»*/
5131
+ /*utils SERVER library associated with aotra version : «1_29072022-2359 (20/10/2023-00:44:14)»*/
5135
5132
  /*-----------------------------------------------------------------------------*/
5136
5133
 
5137
5134
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils-srv",
3
- "version": "0.0.662",
3
+ "version": "0.0.664",
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)",