@xuda.io/ai_module 1.1.4253 → 1.1.4255
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 +8 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4290,7 +4290,7 @@ export const submit_chat_conversation = async function (req, job_id, headers) {
|
|
|
4290
4290
|
req.conversation_doc = conversation_doc;
|
|
4291
4291
|
let ret;
|
|
4292
4292
|
if (conversation_doc.reference_type === 'contacts') {
|
|
4293
|
-
account_module.ts_contact(conversation_doc.reference_id);
|
|
4293
|
+
account_module.ts_contact(uid, conversation_doc.reference_id);
|
|
4294
4294
|
|
|
4295
4295
|
switch (conversation_doc.conversation_type) {
|
|
4296
4296
|
case 'note': {
|
|
@@ -4302,6 +4302,11 @@ export const submit_chat_conversation = async function (req, job_id, headers) {
|
|
|
4302
4302
|
break;
|
|
4303
4303
|
}
|
|
4304
4304
|
|
|
4305
|
+
case 'email': {
|
|
4306
|
+
ret = await chat_email(req, job_id, headers);
|
|
4307
|
+
break;
|
|
4308
|
+
}
|
|
4309
|
+
|
|
4305
4310
|
case 'chat': {
|
|
4306
4311
|
ret = await contact_chat_conversation(req, job_id, headers);
|
|
4307
4312
|
break;
|
|
@@ -6641,7 +6646,7 @@ const attachment_handler = async function (uid, app_id, conversation_id, attachm
|
|
|
6641
6646
|
return system_message_items;
|
|
6642
6647
|
};
|
|
6643
6648
|
|
|
6644
|
-
export const is_spam_email = async function (uid, email, subject) {
|
|
6649
|
+
export const is_spam_email = async function (uid, email, subject, account_profile_info) {
|
|
6645
6650
|
const is_spam = await submit_chat_gpt_prompt({
|
|
6646
6651
|
uid,
|
|
6647
6652
|
prompt: `detect if the email: ${email} with a subject ${subject} is spam or promotional. return true or false`,
|
|
@@ -6650,6 +6655,7 @@ export const is_spam_email = async function (uid, email, subject) {
|
|
|
6650
6655
|
is_spam: z.boolean().describe('if spam or promotional email return true otherwise false'),
|
|
6651
6656
|
}),
|
|
6652
6657
|
metadata: { func: 'is_spam_email' },
|
|
6658
|
+
account_profile_info,
|
|
6653
6659
|
});
|
|
6654
6660
|
return is_spam;
|
|
6655
6661
|
};
|