@xuda.io/ai_module 1.1.4501 → 1.1.4503
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 +8 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -3175,7 +3175,9 @@ export const create_ai_agent = async function (req, job_id, headers) {
|
|
|
3175
3175
|
|
|
3176
3176
|
export const update_ai_agent_properties = async function (doc, app_id, uid, fields_changed = {}) {
|
|
3177
3177
|
const db_doc = await db_module.get_app_couch_doc_native(app_id, doc._id);
|
|
3178
|
-
const { account_profile_info } = doc.studio_meta;
|
|
3178
|
+
// const { account_profile_info } = doc.studio_meta;
|
|
3179
|
+
const account_profile_info = await account_module.get_active_account_profile_info(uid);
|
|
3180
|
+
|
|
3179
3181
|
const get_agent_assistant_name = async function () {
|
|
3180
3182
|
const ret = await submit_chat_gpt_prompt({
|
|
3181
3183
|
uid,
|
|
@@ -4145,7 +4147,7 @@ export const create_conversation = async function (req, job_id, headers) {
|
|
|
4145
4147
|
|
|
4146
4148
|
const conversation_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, conversation_obj.id);
|
|
4147
4149
|
|
|
4148
|
-
const recipient_account_profile_info = await
|
|
4150
|
+
const recipient_account_profile_info = await ac3180count_module.get_active_account_profile_info(recipient_uid);
|
|
4149
4151
|
let recipient_conversation_doc = await db_module.get_app_couch_doc_native(recipient_account_profile_info.app_id, conversation_obj.id);
|
|
4150
4152
|
recipient_conversation_doc.title = conversation_doc.title;
|
|
4151
4153
|
|
|
@@ -4398,6 +4400,10 @@ const chat_email = async function (req, job_id, headers) {
|
|
|
4398
4400
|
// send an email by user invocation
|
|
4399
4401
|
if (!from_mailbox) {
|
|
4400
4402
|
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 });
|
|
4403
|
+
if (subject_ret.code < 0) {
|
|
4404
|
+
throw new Error('something wrong creating email subject');
|
|
4405
|
+
}
|
|
4406
|
+
|
|
4401
4407
|
const subject = subject_ret.data;
|
|
4402
4408
|
const email_module = await import(`${module_path}/email_module/index.mjs`);
|
|
4403
4409
|
const email_ret = email_module.sendEmailFromAccount(email_account_doc, contact_info.email, subject, body, null, attachments);
|