@xuda.io/ai_module 1.1.5524 → 1.1.5526

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 +3 -11
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -3856,7 +3856,7 @@ const contact_chat_conversation = async function (req, job_id, headers) {
3856
3856
  let sender_conversation_doc = await db_module.get_app_couch_doc_native(sender_app_id, conversation_id);
3857
3857
 
3858
3858
  try {
3859
- add_conversation_item(uid, profile_id, conversation_id, prompt, 'chat', conversation_doc.reference_id);
3859
+ add_conversation_item(uid, profile_id, conversation_id, prompt, 'chat', conversation_doc.reference_id, { direction: 'out' });
3860
3860
 
3861
3861
  report_ai_status('conversations');
3862
3862
  } catch (err) {
@@ -3865,7 +3865,6 @@ const contact_chat_conversation = async function (req, job_id, headers) {
3865
3865
  }
3866
3866
 
3867
3867
  await db_module.save_app_couch_doc_native(receiver_app_id, receiver_conversation_doc);
3868
- // sender_conversation_doc.messages.push({ ...obj, ...{ read: false } });
3869
3868
 
3870
3869
  await db_module.save_app_couch_doc_native(sender_app_id, sender_conversation_doc);
3871
3870
 
@@ -3906,15 +3905,8 @@ const chat_note = async function (req, job_id, headers) {
3906
3905
  await attachment_handler(uid, sender_app_id, conversation_id, attachments, account_profile_info);
3907
3906
  let item;
3908
3907
  try {
3909
- item = await client.conversations.items.create(conversation_doc.reference_conversation_id, {
3910
- items: [
3911
- {
3912
- type: 'message',
3913
- role: 'user',
3914
- content: [{ type: 'input_text', text: body }],
3915
- },
3916
- ],
3917
- });
3908
+ add_conversation_item(uid, profile_id, conversation_id, body, 'note', conversation_doc.reference_id, {});
3909
+
3918
3910
  report_ai_status('conversations');
3919
3911
  } catch (err) {
3920
3912
  report_ai_status('conversations', err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.5524",
3
+ "version": "1.1.5526",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",