@xuda.io/ai_module 1.1.4811 → 1.1.4813
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.
- package/index.mjs +3 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -68,7 +68,7 @@ const jobs_module = await import(`${module_path}/jobs_module/index.mjs`);
|
|
|
68
68
|
|
|
69
69
|
var open_ai_status = {};
|
|
70
70
|
const report_ai_status = function (model, error) {
|
|
71
|
-
open_ai_status[model] = { stat: error ? 'error' : 'ok',
|
|
71
|
+
open_ai_status[model] = { stat: error ? 'error' : 'ok', date: new Date(), error };
|
|
72
72
|
};
|
|
73
73
|
|
|
74
74
|
let client;
|
|
@@ -3020,11 +3020,12 @@ const transcribe = async function (uid, stream, metadata, account_profile_info)
|
|
|
3020
3020
|
language: 'en', // hint language (ISO 639-1), e.g. "he" for Hebrew
|
|
3021
3021
|
// temperature: 0 // lower = more literal
|
|
3022
3022
|
});
|
|
3023
|
+
report_ai_status(model);
|
|
3023
3024
|
account_module.record_ai_usage(uid, 0, resp.length || 0, 'transcribe', '', model, metadata, account_profile_info);
|
|
3024
3025
|
// console.log(resp); // or resp for JSON formats
|
|
3025
3026
|
return resp;
|
|
3026
3027
|
} catch (error) {
|
|
3027
|
-
|
|
3028
|
+
report_ai_status(model, error);
|
|
3028
3029
|
debugger;
|
|
3029
3030
|
}
|
|
3030
3031
|
};
|