@xuda.io/ai_module 1.1.5257 → 1.1.5258
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 +5 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4181,6 +4181,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4181
4181
|
// await _utils.delay(500);
|
|
4182
4182
|
await update_job('initiating conversation');
|
|
4183
4183
|
let prompt_suggestions = [];
|
|
4184
|
+
let selected_suggestion;
|
|
4184
4185
|
|
|
4185
4186
|
const get_prompt_suggestions = async function () {
|
|
4186
4187
|
emitToDashboard('stream_delta', 'Deep thinking...');
|
|
@@ -4790,10 +4791,10 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4790
4791
|
}
|
|
4791
4792
|
|
|
4792
4793
|
if (prompt_suggestions.length) {
|
|
4793
|
-
|
|
4794
|
-
if (
|
|
4794
|
+
selected_suggestion = await render_suggestions();
|
|
4795
|
+
if (selected_suggestion) {
|
|
4795
4796
|
prompt_suggestion_activated = true;
|
|
4796
|
-
ai_agents =
|
|
4797
|
+
ai_agents = selected_suggestion;
|
|
4797
4798
|
agents = await get_agents();
|
|
4798
4799
|
} else {
|
|
4799
4800
|
emitToDashboard('response_start');
|
|
@@ -4892,6 +4893,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4892
4893
|
// out_conversation_item_doc.stat = 3;
|
|
4893
4894
|
out_conversation_item_doc.conversation_item_reference_id = conversation_items?.data?.[0]?.id;
|
|
4894
4895
|
out_conversation_item_doc.prompt_suggestions = prompt_suggestions;
|
|
4896
|
+
out_conversation_item_doc.selected_suggestion = selected_suggestion;
|
|
4895
4897
|
await db_module.save_app_couch_doc_native(account_profile_info.app_id, out_conversation_item_doc);
|
|
4896
4898
|
|
|
4897
4899
|
account_msa.record_ai_usage(uid, inputTokens, outputTokens, 'conversation chat', prompt, model, { conversation_id, ai_agent_id: in_conversation_item_obj.ai_agent_id, item_id: in_conversation_item_obj._id }, account_profile_info);
|