@xuda.io/ai_module 1.1.4611 → 1.1.4613
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 +3 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4115,14 +4115,14 @@ export const create_conversation = async function (req, job_id, headers) {
|
|
|
4115
4115
|
if (ai_credits.credits.total - ai_credits.usage.total < -0.5) {
|
|
4116
4116
|
throw new Error('ai credits reach to hard limit');
|
|
4117
4117
|
}
|
|
4118
|
-
|
|
4118
|
+
|
|
4119
4119
|
const conversation_obj = await client.conversations.create();
|
|
4120
4120
|
const t = Date.now();
|
|
4121
4121
|
let conversation_doc = {
|
|
4122
4122
|
_id: await _common.xuda_get_uuid('chat_conversation'),
|
|
4123
4123
|
docType: 'chat_conversation',
|
|
4124
4124
|
title: conversation_type !== 'email' ? getFirstNWords(prompt, 10) : prompt,
|
|
4125
|
-
date_created_ts: Date
|
|
4125
|
+
date_created_ts: new Date(date_created).getTime(),
|
|
4126
4126
|
ts: t,
|
|
4127
4127
|
stat: !conversation_type || conversation_type === 'ai' ? 1 : 3,
|
|
4128
4128
|
uid,
|
|
@@ -7112,7 +7112,7 @@ export const get_name_from_email_addr = async function (uid, email, account_prof
|
|
|
7112
7112
|
if (name_ret.code > -1) {
|
|
7113
7113
|
const data = typeof name_ret.data === 'string' ? JSON.parse(name_ret.data) : name_ret.data;
|
|
7114
7114
|
|
|
7115
|
-
return data;
|
|
7115
|
+
return data?.name;
|
|
7116
7116
|
}
|
|
7117
7117
|
} catch (error) {
|
|
7118
7118
|
console.error('Error in get_name_from_email_addr:', error);
|