@xuda.io/ai_module 1.1.4547 → 1.1.4549

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 -6
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -4454,13 +4454,17 @@ const chat_email = async function (req, job_id, headers) {
4454
4454
 
4455
4455
  //////////
4456
4456
 
4457
- let subject = last_email_item?.subject ? '' : body;
4458
- if (body.split(' ').length > 10) {
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 });
4460
- if (subject_ret.code < 0) {
4461
- throw new Error('something wrong creating email subject');
4457
+ let subject = body;
4458
+ if (!last_email_item) {
4459
+ if (!last_email_item && body.split(' ').length > 10) {
4460
+ 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 });
4461
+ if (subject_ret.code < 0) {
4462
+ throw new Error('something wrong creating email subject');
4463
+ }
4464
+ subject = subject_ret.data;
4462
4465
  }
4463
- subject = subject_ret.data;
4466
+ } else {
4467
+ subject = 'Re: ' + last_email_item?.subject;
4464
4468
  }
4465
4469
  debugger;
4466
4470
  let email_attachments = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4547",
3
+ "version": "1.1.4549",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",