@xuda.io/ai_module 1.1.4659 → 1.1.4661

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 +22 -21
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -4313,32 +4313,33 @@ const process_conversation = async function (uid, conversation_id, account_profi
4313
4313
  }
4314
4314
  }
4315
4315
  /// categorize prompt
4316
- let category_info = {};
4317
- switch (conversation_type) {
4318
- case 'ai': {
4319
- category_info = await categorize_ai_prompt(uid, prompt, account_profile_info);
4320
- break;
4321
- }
4316
+ let category_info = { category: 'unknown' };
4317
+ if (prompt?.length > 5) {
4318
+ switch (conversation_type) {
4319
+ case 'ai': {
4320
+ category_info = await categorize_ai_prompt(uid, prompt, account_profile_info);
4321
+ break;
4322
+ }
4322
4323
 
4323
- case 'email': {
4324
- category_info = await categorize_email_subject(uid, prompt, account_profile_info);
4325
- break;
4326
- }
4324
+ case 'email': {
4325
+ category_info = await categorize_email_subject(uid, prompt, account_profile_info);
4326
+ break;
4327
+ }
4327
4328
 
4328
- case 'chat': {
4329
- category_info = await categorize_text_message(uid, prompt, account_profile_info);
4330
- break;
4331
- }
4329
+ case 'chat': {
4330
+ category_info = await categorize_text_message(uid, prompt, account_profile_info);
4331
+ break;
4332
+ }
4332
4333
 
4333
- case 'note': {
4334
- category_info = await categorize_contact_note(uid, prompt, account_profile_info);
4335
- break;
4336
- }
4334
+ case 'note': {
4335
+ category_info = await categorize_contact_note(uid, prompt, account_profile_info);
4336
+ break;
4337
+ }
4337
4338
 
4338
- default:
4339
- break;
4339
+ default:
4340
+ break;
4341
+ }
4340
4342
  }
4341
-
4342
4343
  conversation_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, conversation_doc._id);
4343
4344
  contact_doc.category_info = category_info;
4344
4345
  await db_module.save_app_couch_doc_native(account_profile_info.app_id, conversation_doc);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4659",
3
+ "version": "1.1.4661",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",