@xuda.io/ai_module 1.1.4511 → 1.1.4513

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 +7 -8
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -4101,17 +4101,16 @@ export const create_conversation = async function (req, job_id, headers) {
4101
4101
 
4102
4102
  const account_profile_info = await account_module.get_active_account_profile_info(uid);
4103
4103
  const { account_profile_obj } = account_profile_info;
4104
-
4105
- if (conversation_type === 'email') {
4106
- ///&& email_direction === 'out'
4107
- if (!account_profile_obj?.email_account_id) {
4108
- throw new Error('The user profile must include a defined email_account_id');
4104
+ try {
4105
+ if (conversation_type === 'email') {
4106
+ ///&& email_direction === 'out'
4107
+ if (!account_profile_obj?.email_account_id) {
4108
+ throw new Error('The user profile must include a defined email_account_id');
4109
+ }
4109
4110
  }
4110
- }
4111
4111
 
4112
- let { data: ai_credits } = await account_module.get_account_ai_usage(account_profile_info.uid);
4112
+ let { data: ai_credits } = await account_module.get_account_ai_usage(account_profile_info.uid);
4113
4113
 
4114
- try {
4115
4114
  if (ai_credits.credits.total - ai_credits.usage.total < -0.5) {
4116
4115
  throw new Error('ai credits reach to hard limit');
4117
4116
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4511",
3
+ "version": "1.1.4513",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",