@xuda.io/ai_module 1.1.4934 → 1.1.4935
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 -6
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1794,7 +1794,7 @@ export const get_ai_agent_info = async function (uid, job_id, headers, doc, from
|
|
|
1794
1794
|
return ret;
|
|
1795
1795
|
};
|
|
1796
1796
|
|
|
1797
|
-
const
|
|
1797
|
+
const agent_conversation_count = async function (agent_id) {
|
|
1798
1798
|
const counts_ret = await db_module.get_app_couch_view(account_profile_info.app_id, 'chat_conversation_item_counts', {
|
|
1799
1799
|
reduce: true,
|
|
1800
1800
|
group_level: 1,
|
|
@@ -1818,12 +1818,14 @@ export const get_ai_agent_info = async function (uid, job_id, headers, doc, from
|
|
|
1818
1818
|
if (!from_marketplace) {
|
|
1819
1819
|
doc.interactions = 0;
|
|
1820
1820
|
doc.chats = 0;
|
|
1821
|
-
|
|
1821
|
+
debugger;
|
|
1822
|
+
const aa = await agent_conversation_count(doc._id);
|
|
1823
|
+
// const chats_ret = await get_ai_chats({ uid, reference_id: doc._id }, job_id, headers);
|
|
1822
1824
|
|
|
1823
|
-
for (let chat of chats_ret?.data?.docs || []) {
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
}
|
|
1825
|
+
// for (let chat of chats_ret?.data?.docs || []) {
|
|
1826
|
+
// doc.chats++;
|
|
1827
|
+
// if (chat.interactions) doc.interactions += chat.interactions;
|
|
1828
|
+
// }
|
|
1827
1829
|
}
|
|
1828
1830
|
doc.border = get_contact_border(doc);
|
|
1829
1831
|
doc.card_background = get_background(doc);
|