@xuda.io/ai_module 1.1.4545 → 1.1.4546
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 +2 -4
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4450,13 +4450,11 @@ const chat_email = async function (req, job_id, headers) {
|
|
|
4450
4450
|
sort: [{ date_created_ts: 'desc' }],
|
|
4451
4451
|
});
|
|
4452
4452
|
|
|
4453
|
-
|
|
4454
|
-
throw new Error('the email already processed');
|
|
4455
|
-
}
|
|
4453
|
+
const last_email_item = chat_conversation_item.docs[0];
|
|
4456
4454
|
|
|
4457
4455
|
//////////
|
|
4458
4456
|
|
|
4459
|
-
let subject =
|
|
4457
|
+
let subject = last_email_item?.subject ? '' : body;
|
|
4460
4458
|
if (body.split(' ').length > 10) {
|
|
4461
4459
|
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 });
|
|
4462
4460
|
if (subject_ret.code < 0) {
|