@xuda.io/ai_module 1.1.5144 → 1.1.5146

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 +7 -3
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -4744,6 +4744,8 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4744
4744
  // if (!conversation_doc.chat_image && (!conversation_doc.thumbnail_request_ts || Date.now() - conversation_doc.thumbnail_request_ts > 120000)) {
4745
4745
  // update_thumbnail('conversation', conversation_doc, app_id, uid, job_id, headers);
4746
4746
  // }
4747
+
4748
+ return save_ret;
4747
4749
  } catch (error) {
4748
4750
  debugger;
4749
4751
  }
@@ -4787,7 +4789,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4787
4789
  }
4788
4790
  // else {
4789
4791
  await update_job('finalizing');
4790
- await done(output);
4792
+ const save_ret = await done(output);
4791
4793
  return {
4792
4794
  code: 4,
4793
4795
  data: save_ret,
@@ -10974,8 +10976,10 @@ export const get_chat_suggestions = async function (uid, ai_agents, conversation
10974
10976
  };
10975
10977
 
10976
10978
  const agents_docs = await get_agents();
10977
- const suggestions = await get_suggestions();
10978
-
10979
+ let suggestions = [];
10980
+ if (agents_docs.length) {
10981
+ suggestions = await get_suggestions();
10982
+ }
10979
10983
  return { code: 44, data: suggestions };
10980
10984
  } catch (err) {
10981
10985
  return { code: -44, data: err.message || String(err) };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.5144",
3
+ "version": "1.1.5146",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",