@xuda.io/ai_module 1.1.4934 → 1.1.4936
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 +11 -7
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1536,6 +1536,8 @@ const get_studio_doc = async function (req) {
|
|
|
1536
1536
|
};
|
|
1537
1537
|
|
|
1538
1538
|
export const get_ai_agent_info = async function (uid, job_id, headers, doc, from_marketplace) {
|
|
1539
|
+
const account_profile_info = await account_ms.get_active_account_profile_info(uid);
|
|
1540
|
+
|
|
1539
1541
|
const get_contact_border = function (doc) {
|
|
1540
1542
|
const disable_color = `#1a3557`;
|
|
1541
1543
|
let ret;
|
|
@@ -1794,7 +1796,7 @@ export const get_ai_agent_info = async function (uid, job_id, headers, doc, from
|
|
|
1794
1796
|
return ret;
|
|
1795
1797
|
};
|
|
1796
1798
|
|
|
1797
|
-
const
|
|
1799
|
+
const agent_conversation_count = async function (agent_id) {
|
|
1798
1800
|
const counts_ret = await db_module.get_app_couch_view(account_profile_info.app_id, 'chat_conversation_item_counts', {
|
|
1799
1801
|
reduce: true,
|
|
1800
1802
|
group_level: 1,
|
|
@@ -1818,12 +1820,14 @@ export const get_ai_agent_info = async function (uid, job_id, headers, doc, from
|
|
|
1818
1820
|
if (!from_marketplace) {
|
|
1819
1821
|
doc.interactions = 0;
|
|
1820
1822
|
doc.chats = 0;
|
|
1821
|
-
|
|
1823
|
+
debugger;
|
|
1824
|
+
const aa = await agent_conversation_count(doc._id);
|
|
1825
|
+
// const chats_ret = await get_ai_chats({ uid, reference_id: doc._id }, job_id, headers);
|
|
1822
1826
|
|
|
1823
|
-
for (let chat of chats_ret?.data?.docs || []) {
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
}
|
|
1827
|
+
// for (let chat of chats_ret?.data?.docs || []) {
|
|
1828
|
+
// doc.chats++;
|
|
1829
|
+
// if (chat.interactions) doc.interactions += chat.interactions;
|
|
1830
|
+
// }
|
|
1827
1831
|
}
|
|
1828
1832
|
doc.border = get_contact_border(doc);
|
|
1829
1833
|
doc.card_background = get_background(doc);
|
|
@@ -1839,7 +1843,7 @@ export const get_ai_agent_info = async function (uid, job_id, headers, doc, from
|
|
|
1839
1843
|
};
|
|
1840
1844
|
|
|
1841
1845
|
const get_user_ai_agents = async function (uid) {
|
|
1842
|
-
const account_profile_info = await account_ms.get_active_account_profile_info(uid);
|
|
1846
|
+
// const account_profile_info = await account_ms.get_active_account_profile_info(uid);
|
|
1843
1847
|
|
|
1844
1848
|
let opt = {
|
|
1845
1849
|
selector: {
|