@xuda.io/ai_module 1.1.4549 → 1.1.4550
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 +16 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4456,7 +4456,7 @@ const chat_email = async function (req, job_id, headers) {
|
|
|
4456
4456
|
|
|
4457
4457
|
let subject = body;
|
|
4458
4458
|
if (!last_email_item) {
|
|
4459
|
-
if (
|
|
4459
|
+
if (body.split(' ').length > 10) {
|
|
4460
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
4461
|
if (subject_ret.code < 0) {
|
|
4462
4462
|
throw new Error('something wrong creating email subject');
|
|
@@ -4500,7 +4500,21 @@ const chat_email = async function (req, job_id, headers) {
|
|
|
4500
4500
|
sender_conversation_doc.messages.push(obj);
|
|
4501
4501
|
await db_module.save_app_couch_doc_native(sender_app_id, sender_conversation_doc);
|
|
4502
4502
|
|
|
4503
|
-
const save_ret = await db_module.save_app_couch_doc_native(sender_app_id, {
|
|
4503
|
+
const save_ret = await db_module.save_app_couch_doc_native(sender_app_id, {
|
|
4504
|
+
_id: obj.id,
|
|
4505
|
+
stat: 3,
|
|
4506
|
+
docType: 'chat_conversation_item',
|
|
4507
|
+
sent_email_result,
|
|
4508
|
+
ts: obj.ts,
|
|
4509
|
+
uid,
|
|
4510
|
+
conversation_type: obj.conversation_type,
|
|
4511
|
+
date_created_ts: obj.ts,
|
|
4512
|
+
conversation_id,
|
|
4513
|
+
body,
|
|
4514
|
+
email_id,
|
|
4515
|
+
subject,
|
|
4516
|
+
last_email_item_id: last_email_item?._id,
|
|
4517
|
+
});
|
|
4504
4518
|
|
|
4505
4519
|
return save_ret;
|
|
4506
4520
|
} catch (err) {
|