@xuda.io/ai_module 1.1.4457 → 1.1.4458

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 -3
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -4064,10 +4064,12 @@ export const create_conversation = async function (req, job_id, headers) {
4064
4064
  const { account_profile_obj } = account_profile_info;
4065
4065
 
4066
4066
  const { data: ai_credits } = await account_module.get_account_ai_usage(account_profile_info.uid);
4067
- if (ai_credits.credits.total - ai_usage.usage.total < -0.5) {
4068
- throw new Error('ai credits reach to hard limit');
4069
- }
4067
+
4070
4068
  try {
4069
+ if (ai_credits.credits.total - ai_usage.usage.total < -0.5) {
4070
+ throw new Error('ai credits reach to hard limit');
4071
+ }
4072
+
4071
4073
  const conversation_obj = await client.conversations.create();
4072
4074
  const t = Date.now();
4073
4075
  let conversation_doc = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4457",
3
+ "version": "1.1.4458",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",