@xuda.io/ai_module 1.1.4565 → 1.1.4567

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 +18 -0
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -4530,6 +4530,24 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4530
4530
  await _utils.delay(1000);
4531
4531
  const conversation_id = conversation_doc._id;
4532
4532
 
4533
+ const obj = { id: output.state._lastTurnResponse.responseId, ts: Date.now(), ai_agent_id: output.state._currentAgent.name, attachments, conversation_type: 'ai_chat' };
4534
+ let out_conversation_item_obj = {
4535
+ _id: obj.id,
4536
+ stat: 1,
4537
+ docType: 'chat_conversation_item',
4538
+ uid,
4539
+ conversation_type: 'ai_chat',
4540
+ type: obj.conversation_type,
4541
+ date_created_ts: Date.now(),
4542
+ ts: Date.now(),
4543
+ conversation_id,
4544
+ text: prompt,
4545
+ reference_id: conversation_doc.reference_id,
4546
+ direction: 'out',
4547
+ role: 'user',
4548
+ };
4549
+ await db_module.save_app_couch_doc_native(account_profile_info.app_id, conversation_item_obj);
4550
+
4533
4551
  // const { account_profile_info } = conversation_doc;
4534
4552
  const emitToDashboard = (type, content) => {
4535
4553
  // console.log(type, content);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4565",
3
+ "version": "1.1.4567",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",