@xuda.io/ai_module 1.1.4480 → 1.1.4482
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 +9 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4068,7 +4068,7 @@ export const create_conversation = async function (req, job_id, headers) {
|
|
|
4068
4068
|
if (conversation_type === 'email') {
|
|
4069
4069
|
///&& email_direction === 'out'
|
|
4070
4070
|
if (!account_profile_obj?.email_account_id) {
|
|
4071
|
-
throw new Error('
|
|
4071
|
+
throw new Error('The user profile must include a defined email_account_id');
|
|
4072
4072
|
}
|
|
4073
4073
|
}
|
|
4074
4074
|
|
|
@@ -4216,7 +4216,7 @@ export const submit_chat_conversation = async function (req, job_id, headers) {
|
|
|
4216
4216
|
try {
|
|
4217
4217
|
if (!conversation_id) throw new Error('missing conversation_id');
|
|
4218
4218
|
const account_profile_info = await account_module.get_active_account_profile_info(uid);
|
|
4219
|
-
|
|
4219
|
+
|
|
4220
4220
|
let conversation_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, conversation_id);
|
|
4221
4221
|
req.conversation_doc = conversation_doc;
|
|
4222
4222
|
let ret;
|
|
@@ -4374,6 +4374,13 @@ const chat_email = async function (req, job_id, headers) {
|
|
|
4374
4374
|
const account_profile_info = await account_module.get_active_account_profile_info(uid);
|
|
4375
4375
|
let { prompt: body, conversation_doc, attachments = [], ai_agents } = req;
|
|
4376
4376
|
try {
|
|
4377
|
+
if (conversation_type === 'email') {
|
|
4378
|
+
///&& email_direction === 'out'
|
|
4379
|
+
if (!account_profile_info.account_profile_obj?.email_account_id) {
|
|
4380
|
+
throw new Error('The user profile must include a defined email_account_id');
|
|
4381
|
+
}
|
|
4382
|
+
}
|
|
4383
|
+
|
|
4377
4384
|
const conversation_id = conversation_doc._id;
|
|
4378
4385
|
|
|
4379
4386
|
const sender_app_id = account_profile_info.app_id;
|