@xuda.io/ai_module 1.1.5432 → 1.1.5442

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 +16 -4
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -3661,9 +3661,20 @@ const process_conversation = async function (uid, conversation_id, account_profi
3661
3661
  conversation_doc.process_stat = 'full';
3662
3662
  await db_module.save_app_couch_doc_native(account_profile_info.app_id, conversation_doc);
3663
3663
 
3664
- if (category_info.category) {
3665
- await update_thumbnail('conversation_category', conversation_doc, account_profile_info.app_id, uid, job_id, headers, null, null, account_profile_info);
3664
+ //enable_thumbnail_avatar_generation
3665
+ const { data: account_doc } = await db_module.get_couch_doc('xuda_accounts', account_profile_info.uid);
3666
+ let thumbnail_type = 'conversation_category';
3667
+ if ((conversation_type === 'chat' && account_doc?.preferences?.enable_thumbnail_avatar_generation) || !category_info.category) {
3668
+ thumbnail_type = 'conversation_title';
3666
3669
  }
3670
+
3671
+ await update_thumbnail(thumbnail_type, conversation_doc, account_profile_info.app_id, uid, job_id, headers, null, null, account_profile_info);
3672
+
3673
+ // if ((conversation_type === 'chat' && enable_thumbnail_avatar_generation) || !category_info.category) {
3674
+ // await update_thumbnail('conversation_title', conversation_doc, account_profile_info.app_id, uid, job_id, headers, null, null, account_profile_info);
3675
+ // } else if (category_info.category) {
3676
+ // await update_thumbnail('conversation_category', conversation_doc, account_profile_info.app_id, uid, job_id, headers, null, null, account_profile_info);
3677
+ // }
3667
3678
  };
3668
3679
 
3669
3680
  const contactGuardrailAgent = new Agent({
@@ -4151,6 +4162,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4151
4162
 
4152
4163
  const app_id = await get_account_default_project_id(uid);
4153
4164
  const app_obj = await get_app_obj(account_profile_info.app_id);
4165
+
4154
4166
  const userName = await account_ms.get_user_name(uid);
4155
4167
  const account_info = (await get_account_name({ uid })).data;
4156
4168
  let context = { ...{ app_id: account_profile_info.app_id, uid, userName, account_info, app_obj, account_id: uid }, ...extractClientInfo(headers) };
@@ -4262,7 +4274,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4262
4274
  agent.on('agent_tool_start', (context, tool, details) => {
4263
4275
  debugger;
4264
4276
  // emitToDashboard('agent_tool_start', tool.name);
4265
- emitToDashboard('stream_phase', `Starting ${tool?.name?.replaceAll('_', '')} tool`, { update: true });
4277
+ emitToDashboard('stream_phase', `Starting ${tool?.name?.replaceAll('_', ' ')} tool`, { update: true });
4266
4278
  });
4267
4279
 
4268
4280
  agent.on('agent_tool_end', (context, tool, result, details) => {
@@ -4338,7 +4350,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4338
4350
  };
4339
4351
  const get_agents = async function () {
4340
4352
  if (reference_type === 'ai_agents') {
4341
- local_ai_agents.push(reference_id);
4353
+ local_ai_agents[reference_id];
4342
4354
  } else {
4343
4355
  if (typeof local_ai_agents === 'undefined') {
4344
4356
  // no agents
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.5432",
3
+ "version": "1.1.5442",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",