@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.
- package/index.mjs +26 -11
- 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
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
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
|
-
|
|
1312
|
-
|
|
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 = [];
|