@xuda.io/ai_module 1.1.4932 → 1.1.4934

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.
Files changed (2) hide show
  1. package/index.mjs +13 -1
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1794,6 +1794,18 @@ export const get_ai_agent_info = async function (uid, job_id, headers, doc, from
1794
1794
  return ret;
1795
1795
  };
1796
1796
 
1797
+ const chat_conversation_count = async function (agent_id) {
1798
+ const counts_ret = await db_module.get_app_couch_view(account_profile_info.app_id, 'chat_conversation_item_counts', {
1799
+ reduce: true,
1800
+ group_level: 1,
1801
+
1802
+ startkey: [agent_id, ''],
1803
+ endkey: [agent_id, 'zzzzzz'],
1804
+ });
1805
+
1806
+ return counts_ret?.rows?.[0]?.value || 0;
1807
+ };
1808
+
1797
1809
  delete doc.agentConfig;
1798
1810
 
1799
1811
  if (doc.stat === 1) {
@@ -1806,7 +1818,7 @@ export const get_ai_agent_info = async function (uid, job_id, headers, doc, from
1806
1818
  if (!from_marketplace) {
1807
1819
  doc.interactions = 0;
1808
1820
  doc.chats = 0;
1809
- const chats_ret = []; // = await get_ai_chats({ uid, reference_id: doc._id }, job_id, headers);
1821
+ const chats_ret = await get_ai_chats({ uid, reference_id: doc._id }, job_id, headers);
1810
1822
 
1811
1823
  for (let chat of chats_ret?.data?.docs || []) {
1812
1824
  doc.chats++;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4932",
3
+ "version": "1.1.4934",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",