@xuda.io/ai_module 1.1.5256 → 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.
Files changed (2) hide show
  1. package/index.mjs +6 -3
  2. 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
- const suggestions_agent = await render_suggestions();
4794
- if (suggestions_agent) {
4794
+ selected_suggestion = await render_suggestions();
4795
+ if (selected_suggestion) {
4795
4796
  prompt_suggestion_activated = true;
4796
- ai_agents = suggestions_agent;
4797
+ ai_agents = selected_suggestion;
4797
4798
  agents = await get_agents();
4798
4799
  } else {
4799
4800
  emitToDashboard('response_start');
@@ -4891,6 +4892,8 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4891
4892
  let out_conversation_item_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, out_conversation_item_obj._id);
4892
4893
  // out_conversation_item_doc.stat = 3;
4893
4894
  out_conversation_item_doc.conversation_item_reference_id = conversation_items?.data?.[0]?.id;
4895
+ out_conversation_item_doc.prompt_suggestions = prompt_suggestions;
4896
+ out_conversation_item_doc.selected_suggestion = selected_suggestion;
4894
4897
  await db_module.save_app_couch_doc_native(account_profile_info.app_id, out_conversation_item_doc);
4895
4898
 
4896
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.5256",
3
+ "version": "1.1.5258",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",