@xuda.io/ai_module 1.1.5000 → 1.1.5001
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 +14 -0
- 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
|