aotrautils-srv 0.0.646 → 0.0.647
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 (19/10/2023-23:
|
|
3
|
+
/*utils COMMONS library associated with aotra version : «1_29072022-2359 (19/10/2023-23:54:39)»*/
|
|
4
4
|
/*-----------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
6
|
|
|
@@ -5050,7 +5050,10 @@ class OpenAIAPIClient{
|
|
|
5050
5050
|
{ role: "user", content: (this.prompt + additionalPrompt) },
|
|
5051
5051
|
];
|
|
5052
5052
|
|
|
5053
|
-
|
|
5053
|
+
//DBG
|
|
5054
|
+
lognow("!!!!!!self.apiURL:",self.apiURL);
|
|
5055
|
+
/*
|
|
5056
|
+
const result=()=>{
|
|
5054
5057
|
const p=new Promise((resolve,reject)=>{
|
|
5055
5058
|
|
|
5056
5059
|
fetch(self.apiURL, {
|
|
@@ -5064,30 +5067,25 @@ class OpenAIAPIClient{
|
|
|
5064
5067
|
messages,
|
|
5065
5068
|
}),
|
|
5066
5069
|
})
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
});
|
|
5081
|
-
|
|
5082
|
-
const r=await p;
|
|
5070
|
+
.then(response => response.json())
|
|
5071
|
+
.then(data => {
|
|
5072
|
+
// DBG
|
|
5073
|
+
// console.log("data :",data);
|
|
5074
|
+
const assistantReply = data.choices[0].message.content;
|
|
5075
|
+
resolve(assistantReply);
|
|
5076
|
+
})
|
|
5077
|
+
.catch(error => {
|
|
5078
|
+
// TRACE
|
|
5079
|
+
console.error("Error:", error);
|
|
5080
|
+
reject(""+error);
|
|
5081
|
+
});
|
|
5083
5082
|
|
|
5083
|
+
}();
|
|
5084
|
+
|
|
5084
5085
|
// DBG
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
return
|
|
5088
|
-
}
|
|
5089
|
-
|
|
5090
|
-
return getResult();
|
|
5086
|
+
console.log("! RESULT text :",result);
|
|
5087
|
+
*/
|
|
5088
|
+
return result;
|
|
5091
5089
|
}
|
|
5092
5090
|
|
|
5093
5091
|
|
|
@@ -5111,7 +5109,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
|
|
|
5111
5109
|
|
|
5112
5110
|
|
|
5113
5111
|
|
|
5114
|
-
/*utils SERVER library associated with aotra version : «1_29072022-2359 (19/10/2023-23:
|
|
5112
|
+
/*utils SERVER library associated with aotra version : «1_29072022-2359 (19/10/2023-23:54:39)»*/
|
|
5115
5113
|
/*-----------------------------------------------------------------------------*/
|
|
5116
5114
|
|
|
5117
5115
|
|
aotrautils-srv/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aotrautils-srv",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.647",
|
|
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)",
|