@xuda.io/ai_module 1.1.4556 → 1.1.4558

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 +14 -12
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -4402,7 +4402,7 @@ const chat_note = async function (req, job_id, headers) {
4402
4402
  sender_conversation_doc.messages.push(obj);
4403
4403
  await db_module.save_app_couch_doc_native(sender_app_id, sender_conversation_doc);
4404
4404
 
4405
- await db_module.save_app_couch_doc_native(sender_app_id, { _id: obj.id, stat: 3, docType: 'chat_conversation_item', ts: obj.ts, uid, conversation_type: obj.conversation_type, date_created_ts: obj.ts, conversation_id, body });
4405
+ await db_module.save_app_couch_doc_native(sender_app_id, { _id: obj.id, stat: 3, docType: 'chat_conversation_item', ts: obj.ts, uid, conversation_type: obj.conversation_type, date_created_ts: obj.ts, conversation_id, body, reference_id: conversation_doc.reference_id });
4406
4406
 
4407
4407
  return { code: 15, data: item };
4408
4408
  } catch (err) {
@@ -4514,6 +4514,7 @@ const chat_email = async function (req, job_id, headers) {
4514
4514
  email_id,
4515
4515
  subject,
4516
4516
  last_email_item_id: last_email_item?._id,
4517
+ reference_id: conversation_doc.reference_id,
4517
4518
  });
4518
4519
 
4519
4520
  return save_ret;
@@ -5153,6 +5154,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
5153
5154
  output: output.output,
5154
5155
  prompt,
5155
5156
  response: output.state._currentStep.output,
5157
+ reference_id: conversation_doc.reference_id,
5156
5158
  });
5157
5159
 
5158
5160
  account_module.record_ai_usage(uid, inputTokens, outputTokens, 'conversation chat', prompt, model, { conversation_id, ai_agent_id: obj.ai_agent_id, item_id: obj.id }, account_profile_info);
@@ -5255,16 +5257,16 @@ setTimeout(async () => {
5255
5257
  // },
5256
5258
  // });
5257
5259
 
5258
- ret = await get_profile_picture(
5259
- uid,
5260
- 'business',
5261
- 'docxsite',
5262
- {
5263
- email: '',
5264
- body: '',
5265
- },
5266
- account_profile_info,
5267
- );
5260
+ // ret = await get_profile_picture(
5261
+ // uid,
5262
+ // 'business',
5263
+ // 'docxsite',
5264
+ // {
5265
+ // email: '',
5266
+ // body: '',
5267
+ // },
5268
+ // account_profile_info,
5269
+ // );
5268
5270
 
5269
5271
  // ret =await get_business_info(uid, 'docxsite', 'info@docxsite.com', account_profile_info);
5270
5272
 
@@ -6407,7 +6409,7 @@ const attachment_handler = async function (uid, app_id, conversation_id, attachm
6407
6409
  const obj = { id: items.last_id, ts: Date.now(), conversation_type: 'attachment', file };
6408
6410
  system_message_items.push(obj);
6409
6411
 
6410
- await db_module.save_app_couch_doc_native(account_profile_info.app_id, { _id: obj.id, stat: 3, docType: 'chat_conversation_item', ts: obj.ts, uid, conversation_type: obj.conversation_type, date_created_ts: obj.ts, conversation_id, file, transcript });
6412
+ await db_module.save_app_couch_doc_native(account_profile_info.app_id, { _id: obj.id, stat: 3, docType: 'chat_conversation_item', ts: obj.ts, uid, conversation_type: obj.conversation_type, date_created_ts: obj.ts, conversation_id, file, transcript, reference_id: conversation_doc.reference_id });
6411
6413
  }
6412
6414
 
6413
6415
  // const items = await client.conversations.items.create(conversation_id, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4556",
3
+ "version": "1.1.4558",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",