@xuda.io/ai_module 1.1.4540 → 1.1.4542
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 +3 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4260,7 +4260,7 @@ export const submit_chat_conversation = async function (req, job_id, headers) {
|
|
|
4260
4260
|
req.conversation_doc = conversation_doc;
|
|
4261
4261
|
let ret;
|
|
4262
4262
|
if (conversation_doc.reference_type === 'contacts') {
|
|
4263
|
-
|
|
4263
|
+
req._thread_reentry = Date.now() - conversation_doc.date_created_ts > 60000;
|
|
4264
4264
|
|
|
4265
4265
|
account_module.ts_contact(uid, conversation_doc.reference_id);
|
|
4266
4266
|
|
|
@@ -4411,7 +4411,7 @@ const chat_note = async function (req, job_id, headers) {
|
|
|
4411
4411
|
};
|
|
4412
4412
|
|
|
4413
4413
|
const chat_email = async function (req, job_id, headers) {
|
|
4414
|
-
const { uid, email_id, perform_ai_execution = true, from_mailbox } = req;
|
|
4414
|
+
const { uid, email_id, perform_ai_execution = true, from_mailbox, _thread_reentry } = req;
|
|
4415
4415
|
const account_profile_info = await account_module.get_active_account_profile_info(uid);
|
|
4416
4416
|
let { prompt: body, conversation_doc, attachments = [], ai_agents } = req;
|
|
4417
4417
|
try {
|
|
@@ -4438,7 +4438,7 @@ const chat_email = async function (req, job_id, headers) {
|
|
|
4438
4438
|
|
|
4439
4439
|
// send an email by user invocation
|
|
4440
4440
|
if (!from_mailbox) {
|
|
4441
|
-
let subject = body;
|
|
4441
|
+
let subject = _thread_reentry ? '' : body;
|
|
4442
4442
|
if (body.split(' ').length > 10) {
|
|
4443
4443
|
const subject_ret = await submit_chat_gpt_prompt({ uid, prompt: `create title for the prompt return 5 words result maximum text only without options : ${body}`, model: 'gpt-5-nano', metadata: { conversation_id: conversation_doc._id, func: 'chat_email' }, account_profile_info });
|
|
4444
4444
|
if (subject_ret.code < 0) {
|