@xuda.io/ai_module 1.1.4810 → 1.1.4811

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.
Files changed (2) hide show
  1. package/index.mjs +5 -2
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -34,8 +34,6 @@ const _defaultAppConfig = {
34
34
  };
35
35
  admin.initializeApp(_defaultAppConfig);
36
36
 
37
- var open_ai_status = {};
38
-
39
37
  const module_path = path.join(process.env.XUDA_HOME, 'cpi') + (!_conf.is_debug ? '/node_modules/@xuda.io' : '');
40
38
  const runtime_modules_path = path.join(process.env.XUDA_HOME, 'dist', 'runtime', 'js', 'modules');
41
39
 
@@ -68,6 +66,11 @@ const db_module = await import(`${module_path}/db_module/index.mjs`);
68
66
  const drive_module = await import(`${module_path}/drive_module/index.mjs`);
69
67
  const jobs_module = await import(`${module_path}/jobs_module/index.mjs`);
70
68
 
69
+ var open_ai_status = {};
70
+ const report_ai_status = function (model, error) {
71
+ open_ai_status[model] = { stat: error ? 'error' : 'ok', error, date: new Date() };
72
+ };
73
+
71
74
  let client;
72
75
  try {
73
76
  client = new OpenAI({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4810",
3
+ "version": "1.1.4811",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",