@xuda.io/ai_module 1.1.5146 → 1.1.5148
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 -5
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4050,6 +4050,8 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4050
4050
|
const account_profile_info = await get_active_account_profile_info(uid, profile_id);
|
|
4051
4051
|
let { prompt, conversation_doc, attachments = [], ai_agents, output_format = 'md', stream = true, with_context = true, ai_model = _conf.default_ai_model } = req;
|
|
4052
4052
|
|
|
4053
|
+
const activate_prompt_suggestions = (typeof ai_agents === 'undefined' || ai_agents.length > 0) && conversation_doc.reference_type !== 'ai_agents';
|
|
4054
|
+
|
|
4053
4055
|
let model = ai_model;
|
|
4054
4056
|
if (!_conf.ai_models[model]) {
|
|
4055
4057
|
throw new Error('model not supported');
|
|
@@ -4160,6 +4162,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4160
4162
|
let prompt_suggestions = [];
|
|
4161
4163
|
setTimeout(async () => {
|
|
4162
4164
|
debugger;
|
|
4165
|
+
if (!activate_prompt_suggestions) return;
|
|
4163
4166
|
const prompt_suggestions_ret = await get_chat_suggestions(uid, ai_agents, out_conversation_item_save_ret.data.id);
|
|
4164
4167
|
if (prompt_suggestions_ret.code > -1) prompt_suggestions = prompt_suggestions_ret.data;
|
|
4165
4168
|
}, 1);
|
|
@@ -4659,12 +4662,14 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4659
4662
|
await attachment_handler(uid, app_id, conversation_id, attachments, account_profile_info);
|
|
4660
4663
|
}
|
|
4661
4664
|
////////////
|
|
4662
|
-
if (
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
+
if (activate_prompt_suggestions) {
|
|
4666
|
+
if (!prompt_suggestions.length) {
|
|
4667
|
+
await _utils.delay(5000);
|
|
4668
|
+
}
|
|
4665
4669
|
|
|
4666
|
-
|
|
4667
|
-
|
|
4670
|
+
if (prompt_suggestions.length) {
|
|
4671
|
+
await render_suggestions();
|
|
4672
|
+
}
|
|
4668
4673
|
}
|
|
4669
4674
|
///////////
|
|
4670
4675
|
|