@xuda.io/ai_module 1.1.4927 → 1.1.4929

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 (3) hide show
  1. package/index.mjs +1 -1
  2. package/index_ms.mjs +58 -49
  3. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1806,7 +1806,7 @@ export const get_ai_agent_info = async function (uid, job_id, headers, doc, from
1806
1806
  if (!from_marketplace) {
1807
1807
  doc.interactions = 0;
1808
1808
  doc.chats = 0;
1809
- const chats_ret = await get_ai_chats({ uid, reference_id: doc._id }, job_id, headers);
1809
+ const chats_ret; // = await get_ai_chats({ uid, reference_id: doc._id }, job_id, headers);
1810
1810
 
1811
1811
  for (let chat of chats_ret?.data?.docs || []) {
1812
1812
  doc.chats++;
package/index_ms.mjs CHANGED
@@ -3,191 +3,200 @@
3
3
  // Queue target : ai_module
4
4
  // =====================================================
5
5
 
6
- import path from 'node:path';
7
6
 
8
- global.queueName = 'ai_module';
9
- const _ms_broker = await import(path.join(process.env.XUDA_HOME, 'common', 'ms_broker.mjs'));
7
+ import path from 'node:path';
8
+
9
+ const { MessageBroker } = await import(path.join(process.env.XUDA_HOME, 'common', 'ms_broker.mjs'));
10
+
11
+ const broker = new MessageBroker();
12
+
13
+ await broker.init({
14
+ queueName: 'ai_module',
15
+ module_in: global.module_in
16
+ });
17
+
18
+
10
19
 
11
20
  export const get_chat_conversation = async function (...args) {
12
- return await _ms_broker.send_to_queue('get_chat_conversation', ...args);
21
+ return await broker.send_to_queue("get_chat_conversation", ...args);
13
22
  };
14
23
 
15
24
  export const get_ai_chats = async function (...args) {
16
- return await _ms_broker.send_to_queue('get_ai_chats', ...args);
25
+ return await broker.send_to_queue("get_ai_chats", ...args);
17
26
  };
18
27
 
19
28
  export const delete_ai_chat = async function (...args) {
20
- return await _ms_broker.send_to_queue('delete_ai_chat', ...args);
29
+ return await broker.send_to_queue("delete_ai_chat", ...args);
21
30
  };
22
31
 
23
32
  export const archive_ai_chat = async function (...args) {
24
- return await _ms_broker.send_to_queue('archive_ai_chat', ...args);
33
+ return await broker.send_to_queue("archive_ai_chat", ...args);
25
34
  };
26
35
 
27
36
  export const unarchive_ai_chat = async function (...args) {
28
- return await _ms_broker.send_to_queue('unarchive_ai_chat', ...args);
37
+ return await broker.send_to_queue("unarchive_ai_chat", ...args);
29
38
  };
30
39
 
31
40
  export const get_ai_agent_info = async function (...args) {
32
- return await _ms_broker.send_to_queue('get_ai_agent_info', ...args);
41
+ return await broker.send_to_queue("get_ai_agent_info", ...args);
33
42
  };
34
43
 
35
44
  export const get_ai_agents = async function (...args) {
36
- return await _ms_broker.send_to_queue('get_ai_agents', ...args);
45
+ return await broker.send_to_queue("get_ai_agents", ...args);
37
46
  };
38
47
 
39
48
  export const delete_ai_agent = async function (...args) {
40
- return await _ms_broker.send_to_queue('delete_ai_agent', ...args);
49
+ return await broker.send_to_queue("delete_ai_agent", ...args);
41
50
  };
42
51
 
43
52
  export const uninstall_ai_agent = async function (...args) {
44
- return await _ms_broker.send_to_queue('uninstall_ai_agent', ...args);
53
+ return await broker.send_to_queue("uninstall_ai_agent", ...args);
45
54
  };
46
55
 
47
56
  export const unarchive_ai_agent = async function (...args) {
48
- return await _ms_broker.send_to_queue('unarchive_ai_agent', ...args);
57
+ return await broker.send_to_queue("unarchive_ai_agent", ...args);
49
58
  };
50
59
 
51
60
  export const archive_ai_agent = async function (...args) {
52
- return await _ms_broker.send_to_queue('archive_ai_agent', ...args);
61
+ return await broker.send_to_queue("archive_ai_agent", ...args);
53
62
  };
54
63
 
55
64
  export const archive_mini_app = async function (...args) {
56
- return await _ms_broker.send_to_queue('archive_mini_app', ...args);
65
+ return await broker.send_to_queue("archive_mini_app", ...args);
57
66
  };
58
67
 
59
68
  export const unarchive_mini_app = async function (...args) {
60
- return await _ms_broker.send_to_queue('unarchive_mini_app', ...args);
69
+ return await broker.send_to_queue("unarchive_mini_app", ...args);
61
70
  };
62
71
 
63
72
  export const delete_mini_app = async function (...args) {
64
- return await _ms_broker.send_to_queue('delete_mini_app', ...args);
73
+ return await broker.send_to_queue("delete_mini_app", ...args);
65
74
  };
66
75
 
67
76
  export const update_ai_agent = async function (...args) {
68
- return await _ms_broker.send_to_queue('update_ai_agent', ...args);
77
+ return await broker.send_to_queue("update_ai_agent", ...args);
69
78
  };
70
79
 
71
80
  export const get_apps = async function (...args) {
72
- return await _ms_broker.send_to_queue('get_apps', ...args);
81
+ return await broker.send_to_queue("get_apps", ...args);
73
82
  };
74
83
 
75
84
  export const create_ai_agent = async function (...args) {
76
- return await _ms_broker.send_to_queue('create_ai_agent', ...args);
85
+ return await broker.send_to_queue("create_ai_agent", ...args);
77
86
  };
78
87
 
79
88
  export const update_ai_agent_properties = async function (...args) {
80
- return await _ms_broker.send_to_queue('update_ai_agent_properties', ...args);
89
+ return await broker.send_to_queue("update_ai_agent_properties", ...args);
81
90
  };
82
91
 
83
92
  export const update_thumbnail = async function (...args) {
84
- return await _ms_broker.send_to_queue('update_thumbnail', ...args);
93
+ return await broker.send_to_queue("update_thumbnail", ...args);
85
94
  };
86
95
 
87
96
  export const upload_prompt_attachment = async function (...args) {
88
- return await _ms_broker.send_to_queue('upload_prompt_attachment', ...args);
97
+ return await broker.send_to_queue("upload_prompt_attachment", ...args);
89
98
  };
90
99
 
91
100
  export const delete_prompt_attachment = async function (...args) {
92
- return await _ms_broker.send_to_queue('delete_prompt_attachment', ...args);
101
+ return await broker.send_to_queue("delete_prompt_attachment", ...args);
93
102
  };
94
103
 
95
104
  export const submit_chat_gpt_prompt = async function (...args) {
96
- return await _ms_broker.send_to_queue('submit_chat_gpt_prompt', ...args);
105
+ return await broker.send_to_queue("submit_chat_gpt_prompt", ...args);
97
106
  };
98
107
 
99
108
  export const create_conversation = async function (...args) {
100
- return await _ms_broker.send_to_queue('create_conversation', ...args);
109
+ return await broker.send_to_queue("create_conversation", ...args);
101
110
  };
102
111
 
103
112
  export const submit_chat_conversation = async function (...args) {
104
- return await _ms_broker.send_to_queue('submit_chat_conversation', ...args);
113
+ return await broker.send_to_queue("submit_chat_conversation", ...args);
105
114
  };
106
115
 
107
116
  export const create_avatar = async function (...args) {
108
- return await _ms_broker.send_to_queue('create_avatar', ...args);
117
+ return await broker.send_to_queue("create_avatar", ...args);
109
118
  };
110
119
 
111
120
  export const get_profile_avatar = async function (...args) {
112
- return await _ms_broker.send_to_queue('get_profile_avatar', ...args);
121
+ return await broker.send_to_queue("get_profile_avatar", ...args);
113
122
  };
114
123
 
115
124
  export const get_profile_picture = async function (...args) {
116
- return await _ms_broker.send_to_queue('get_profile_picture', ...args);
125
+ return await broker.send_to_queue("get_profile_picture", ...args);
117
126
  };
118
127
 
119
128
  export const conversation_actions = async function (...args) {
120
- return await _ms_broker.send_to_queue('conversation_actions', ...args);
129
+ return await broker.send_to_queue("conversation_actions", ...args);
121
130
  };
122
131
 
123
132
  export const modify_profile_avatar = async function (...args) {
124
- return await _ms_broker.send_to_queue('modify_profile_avatar', ...args);
133
+ return await broker.send_to_queue("modify_profile_avatar", ...args);
125
134
  };
126
135
 
127
136
  export const get_ai_workspace_pending_counts = async function (...args) {
128
- return await _ms_broker.send_to_queue('get_ai_workspace_pending_counts', ...args);
137
+ return await broker.send_to_queue("get_ai_workspace_pending_counts", ...args);
129
138
  };
130
139
 
131
140
  export const create_mini_app = async function (...args) {
132
- return await _ms_broker.send_to_queue('create_mini_app', ...args);
141
+ return await broker.send_to_queue("create_mini_app", ...args);
133
142
  };
134
143
 
135
144
  export const pin_ai_agent = async function (...args) {
136
- return await _ms_broker.send_to_queue('pin_ai_agent', ...args);
145
+ return await broker.send_to_queue("pin_ai_agent", ...args);
137
146
  };
138
147
 
139
148
  export const unpin_ai_agent = async function (...args) {
140
- return await _ms_broker.send_to_queue('unpin_ai_agent', ...args);
149
+ return await broker.send_to_queue("unpin_ai_agent", ...args);
141
150
  };
142
151
 
143
152
  export const get_transcript = async function (...args) {
144
- return await _ms_broker.send_to_queue('get_transcript', ...args);
153
+ return await broker.send_to_queue("get_transcript", ...args);
145
154
  };
146
155
 
147
156
  export const add_transcript_conversation_item = async function (...args) {
148
- return await _ms_broker.send_to_queue('add_transcript_conversation_item', ...args);
157
+ return await broker.send_to_queue("add_transcript_conversation_item", ...args);
149
158
  };
150
159
 
151
160
  export const is_spam_email = async function (...args) {
152
- return await _ms_broker.send_to_queue('is_spam_email', ...args);
161
+ return await broker.send_to_queue("is_spam_email", ...args);
153
162
  };
154
163
 
155
164
  export const is_business_contact = async function (...args) {
156
- return await _ms_broker.send_to_queue('is_business_contact', ...args);
165
+ return await broker.send_to_queue("is_business_contact", ...args);
157
166
  };
158
167
 
159
168
  export const is_business_contact_has_person = async function (...args) {
160
- return await _ms_broker.send_to_queue('is_business_contact_has_person', ...args);
169
+ return await broker.send_to_queue("is_business_contact_has_person", ...args);
161
170
  };
162
171
 
163
172
  export const get_name_from_email_addr = async function (...args) {
164
- return await _ms_broker.send_to_queue('get_name_from_email_addr', ...args);
173
+ return await broker.send_to_queue("get_name_from_email_addr", ...args);
165
174
  };
166
175
 
167
176
  export const categorize_email_subject = async function (...args) {
168
- return await _ms_broker.send_to_queue('categorize_email_subject', ...args);
177
+ return await broker.send_to_queue("categorize_email_subject", ...args);
169
178
  };
170
179
 
171
180
  export const categorize_ai_prompt = async function (...args) {
172
- return await _ms_broker.send_to_queue('categorize_ai_prompt', ...args);
181
+ return await broker.send_to_queue("categorize_ai_prompt", ...args);
173
182
  };
174
183
 
175
184
  export const categorize_text_message = async function (...args) {
176
- return await _ms_broker.send_to_queue('categorize_text_message', ...args);
185
+ return await broker.send_to_queue("categorize_text_message", ...args);
177
186
  };
178
187
 
179
188
  export const categorize_contact_note = async function (...args) {
180
- return await _ms_broker.send_to_queue('categorize_contact_note', ...args);
189
+ return await broker.send_to_queue("categorize_contact_note", ...args);
181
190
  };
182
191
 
183
192
  export const get_business_info = async function (...args) {
184
- return await _ms_broker.send_to_queue('get_business_info', ...args);
193
+ return await broker.send_to_queue("get_business_info", ...args);
185
194
  };
186
195
 
187
196
  export const get_person_info = async function (...args) {
188
- return await _ms_broker.send_to_queue('get_person_info', ...args);
197
+ return await broker.send_to_queue("get_person_info", ...args);
189
198
  };
190
199
 
191
200
  export const open_ai_alive_check = async function (...args) {
192
- return await _ms_broker.send_to_queue('open_ai_alive_check', ...args);
201
+ return await broker.send_to_queue("open_ai_alive_check", ...args);
193
202
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4927",
3
+ "version": "1.1.4929",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",