@xuda.io/ai_module 1.1.5522 → 1.1.5524

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 +2 -13
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -3857,24 +3857,13 @@ const contact_chat_conversation = async function (req, job_id, headers) {
3857
3857
 
3858
3858
  try {
3859
3859
  add_conversation_item(uid, profile_id, conversation_id, prompt, 'chat', conversation_doc.reference_id);
3860
- // item = await client.conversations.items.create(conversation_doc.reference_conversation_id, {
3861
- // items: [
3862
- // {
3863
- // type: 'message',
3864
- // role: 'user',
3865
- // content: [{ type: 'input_text', text: prompt }],
3866
- // },
3867
- // ],
3868
- // });
3860
+
3869
3861
  report_ai_status('conversations');
3870
3862
  } catch (err) {
3871
3863
  report_ai_status('conversations', err);
3872
3864
  throw err;
3873
3865
  }
3874
3866
 
3875
- // const obj = { id: item.data[0].id, ts: Date.now(), uid, read: true, conversation_type: 'chat' };
3876
- // receiver_conversation_doc.messages.push(obj);
3877
-
3878
3867
  await db_module.save_app_couch_doc_native(receiver_app_id, receiver_conversation_doc);
3879
3868
  // sender_conversation_doc.messages.push({ ...obj, ...{ read: false } });
3880
3869
 
@@ -5106,7 +5095,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
5106
5095
  }
5107
5096
  };
5108
5097
 
5109
- const add_conversation_item = async function (uid, profile_id, conversation_id, body, conversation_type, contact_id, metadata = {}) {
5098
+ const add_conversation_item = async function (uid, profile_id, conversation_id, body = '', conversation_type, contact_id, metadata = {}) {
5110
5099
  const account_profile_info = await get_active_account_profile_info(uid, profile_id);
5111
5100
 
5112
5101
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.5522",
3
+ "version": "1.1.5524",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",