@xuda.io/ai_module 1.1.4861 → 1.1.4863

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 +10 -2
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -3518,7 +3518,7 @@ export const create_conversation = async function (req, job_id, headers) {
3518
3518
  }
3519
3519
  };
3520
3520
 
3521
- export const process_conversation = async function (uid, conversation_id, account_profile_info, job_id, headers) {
3521
+ const process_conversation = async function (uid, conversation_id, account_profile_info, job_id, headers) {
3522
3522
  let conversation_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, conversation_id);
3523
3523
  const { conversation_type, prompt, reference_id } = conversation_doc;
3524
3524
 
@@ -3654,7 +3654,7 @@ export const submit_chat_conversation = async function (req, job_id, headers) {
3654
3654
  }
3655
3655
  };
3656
3656
 
3657
- export const update_conversation_mood_level = async function (uid, target_contacts = [], conversation_id, prompt, sender_uid, receiver_uid, update_contact, account_profile_info) {
3657
+ const update_conversation_mood_level = async function (uid, target_contacts = [], conversation_id, prompt, sender_uid, receiver_uid, update_contact, account_profile_info) {
3658
3658
  try {
3659
3659
  // analyze the mood of the conversation
3660
3660
  const mood_level = await submit_chat_gpt_prompt({
@@ -6059,6 +6059,14 @@ const attachment_handler = async function (uid, app_id, conversation_id, attachm
6059
6059
  };
6060
6060
 
6061
6061
  export const is_spam_email = async function (uid, email, subject, account_profile_info) {
6062
+ const spam_whitelists = await db_module.find_couch_query('xuda_accounts', {
6063
+ selector: {
6064
+ docType: 'spam_whitelist',
6065
+ email,
6066
+ stat: 3,
6067
+ },
6068
+ });
6069
+
6062
6070
  const is_spam_ret = await submit_chat_gpt_prompt({
6063
6071
  uid,
6064
6072
  prompt: `detect if the email: ${email} with a subject ${subject} is spam or promotional. return true or false`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4861",
3
+ "version": "1.1.4863",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",