@xuda.io/ai_module 1.1.5227 → 1.1.5229
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 +10 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4182,7 +4182,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4182
4182
|
await update_job('initiating conversation');
|
|
4183
4183
|
let prompt_suggestions = [];
|
|
4184
4184
|
|
|
4185
|
-
const get_prompt_suggestions = function () {
|
|
4185
|
+
const get_prompt_suggestions = async function () {
|
|
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 });
|
|
@@ -4202,6 +4202,10 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4202
4202
|
});
|
|
4203
4203
|
};
|
|
4204
4204
|
|
|
4205
|
+
const render_output_suggestions = async function () {
|
|
4206
|
+
const ret = await get_chat_suggestions({ uid, ai_agents, conversation_item_id: out_conversation_item_save_ret.data.id, context: prompt });
|
|
4207
|
+
};
|
|
4208
|
+
|
|
4205
4209
|
// const suggestionsPromise = activate_prompt_suggestions ? get_chat_suggestions({ uid, ai_agents, conversation_item_id: out_conversation_item_save_ret.data.id, context: prompt }) : Promise.resolve(null);
|
|
4206
4210
|
|
|
4207
4211
|
conversation_doc.stat = 2;
|
|
@@ -4886,6 +4890,10 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4886
4890
|
// update_thumbnail('conversation', conversation_doc, app_id, uid, job_id, headers);
|
|
4887
4891
|
// }
|
|
4888
4892
|
|
|
4893
|
+
if (activate_prompt_suggestions) {
|
|
4894
|
+
await render_output_suggestions(out_conversation_item_doc.conversation_item_reference_id);
|
|
4895
|
+
}
|
|
4896
|
+
|
|
4889
4897
|
return save_ret;
|
|
4890
4898
|
} catch (error) {
|
|
4891
4899
|
debugger;
|
|
@@ -4932,6 +4940,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4932
4940
|
await update_job('finalizing');
|
|
4933
4941
|
|
|
4934
4942
|
const save_ret = await done(output);
|
|
4943
|
+
|
|
4935
4944
|
return {
|
|
4936
4945
|
code: 4,
|
|
4937
4946
|
data: save_ret,
|