@xuda.io/ai_module 1.1.5208 → 1.1.5209
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.
- package/index.mjs +8 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4186,10 +4186,17 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4186
4186
|
return new Promise(async (resolve, reject) => {
|
|
4187
4187
|
let interval = setInterval(async function () {
|
|
4188
4188
|
const job_info = await jobs_ms.get_job_info({ job_id });
|
|
4189
|
+
|
|
4190
|
+
if (job_info.code < 0 || job_info.data.stat === 4) {
|
|
4191
|
+
resolve({ code: -1, data: 'aborted' });
|
|
4192
|
+
}
|
|
4193
|
+
if (job_info?.data?.payload?.ai_agents) {
|
|
4194
|
+
}
|
|
4195
|
+
|
|
4189
4196
|
clearInterval(interval);
|
|
4190
|
-
resolve({ code: -1, data: 'aborted' });
|
|
4191
4197
|
}, 1000);
|
|
4192
4198
|
const ret = await get_chat_suggestions({ uid, ai_agents, conversation_item_id: out_conversation_item_save_ret.data.id, context: prompt });
|
|
4199
|
+
clearInterval(interval);
|
|
4193
4200
|
resolve(ret);
|
|
4194
4201
|
});
|
|
4195
4202
|
};
|