@xuda.io/ai_module 1.1.4454 → 1.1.4456
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 +4 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4063,8 +4063,10 @@ export const create_conversation = async function (req, job_id, headers) {
|
|
|
4063
4063
|
const account_profile_info = await account_module.get_active_account_profile_info(uid);
|
|
4064
4064
|
const { account_profile_obj } = account_profile_info;
|
|
4065
4065
|
|
|
4066
|
-
account_module.get_account_ai_usage(account_profile_info.uid);
|
|
4067
|
-
|
|
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();
|
|
4069
|
+
}
|
|
4068
4070
|
try {
|
|
4069
4071
|
const conversation_obj = await client.conversations.create();
|
|
4070
4072
|
const t = Date.now();
|