@xuda.io/ai_module 1.1.5000 → 1.1.5002

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 +26 -11
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1267,6 +1267,20 @@ export const get_ai_chats = async function (req, job_id, headers) {
1267
1267
  ],
1268
1268
  };
1269
1269
  }
1270
+
1271
+ let ai_chats = await db_module.find_app_couch_query(account_profile_info.app_id, opt);
1272
+ if (!limit || conversation_id) {
1273
+ ai_chats.total_docs = ai_chats.docs.length;
1274
+ } else {
1275
+ delete opt.sort;
1276
+ delete opt.skip;
1277
+ opt.limit = 9999;
1278
+ opt.fields = ['_id'];
1279
+
1280
+ const counter = await db_module.find_app_couch_query(account_profile_info.app_id, opt);
1281
+ ai_chats.total_docs = counter.docs.length;
1282
+ }
1283
+ return ai_chats;
1270
1284
  };
1271
1285
 
1272
1286
  ////// FROM - IN
@@ -1299,18 +1313,19 @@ export const get_ai_chats = async function (req, job_id, headers) {
1299
1313
  let ai_chats = { docs: [], total_docs: 0 };
1300
1314
 
1301
1315
  if (filter_type !== 'pending') {
1302
- ai_chats = await db_module.find_app_couch_query(account_profile_info.app_id, opt);
1303
- if (!limit || conversation_id) {
1304
- ai_chats.total_docs = ai_chats.docs.length;
1305
- } else {
1306
- delete opt.sort;
1307
- delete opt.skip;
1308
- opt.limit = 9999;
1309
- opt.fields = ['_id'];
1316
+ ai_chats = await get_data_find();
1317
+ // ai_chats = await db_module.find_app_couch_query(account_profile_info.app_id, opt);
1318
+ // if (!limit || conversation_id) {
1319
+ // ai_chats.total_docs = ai_chats.docs.length;
1320
+ // } else {
1321
+ // delete opt.sort;
1322
+ // delete opt.skip;
1323
+ // opt.limit = 9999;
1324
+ // opt.fields = ['_id'];
1310
1325
 
1311
- const counter = await db_module.find_app_couch_query(account_profile_info.app_id, opt);
1312
- ai_chats.total_docs = counter.docs.length;
1313
- }
1326
+ // const counter = await db_module.find_app_couch_query(account_profile_info.app_id, opt);
1327
+ // ai_chats.total_docs = counter.docs.length;
1328
+ // }
1314
1329
  }
1315
1330
 
1316
1331
  let docs = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.5000",
3
+ "version": "1.1.5002",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",