@xuda.io/ai_module 1.1.3881 → 1.1.3883

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 +20 -0
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2694,6 +2694,7 @@ export const update_ai_agent = async function (req, job_id, headers) {
2694
2694
  agent_doc.studio_meta.agent_subcategory = agentConfig.agent_subcategory;
2695
2695
  agent_doc.studio_meta.agent_industry = agentConfig.agent_industry;
2696
2696
  agent_doc.studio_meta.agent_tags = agentConfig.agent_tags;
2697
+ agent_doc.studio_meta.agent_user_guide = agentConfig.agent_user_guide;
2697
2698
 
2698
2699
  const data = await db_module.save_app_couch_doc_native(app_id, agent_doc);
2699
2700
 
@@ -3049,6 +3050,7 @@ export const create_ai_agent = async function (req, job_id, headers) {
3049
3050
  agent_doc.studio_meta.agent_subcategory = agentConfig.agent_subcategory;
3050
3051
  agent_doc.studio_meta.agent_industry = agentConfig.agent_industry;
3051
3052
  agent_doc.studio_meta.agent_tags = agentConfig.agent_tags;
3053
+ agent_doc.studio_meta.agent_user_guide = agentConfig.agent_user_guide;
3052
3054
 
3053
3055
  // const data = await db.insert(agent_doc);
3054
3056
 
@@ -3118,6 +3120,19 @@ export const update_ai_agent_properties = async function (doc, app_id, uid) {
3118
3120
  return ret.data;
3119
3121
  };
3120
3122
 
3123
+ const get_agent_user_guide = async function () {
3124
+ const ret = await submit_chat_gpt_prompt({
3125
+ uid,
3126
+ prompt: `Generate agent industry for the AI agent titled:
3127
+ “${doc.properties.menuName}” choose only one from the list:
3128
+ Artificial Intelligence,SaaS,Fintech,Healthtech,Edtech,Blockchain/Crypto,Cybersecurity,Gaming,Consulting,Marketing & Advertising,Human Resources,Legal Services,Real Estate,E-commerce,Retail,Fashion & Apparel,Consumer Goods,Healthcare,Medical,Pharmaceutical,Banking,Insurance,Investment,Manufacturing,Logistics & Supply Chain,Construction,Energy,Media,Entertainment,Sports,Education,Travel & Hospitality,Food & Beverage,Non-Profit,Government,Agriculture,Automotive,Telecommunications`,
3129
+ model: 'gpt-5-nano',
3130
+ metadata: { agent_id: db_doc._id, func: 'get_agent_user_guide' },
3131
+ });
3132
+
3133
+ return ret.data;
3134
+ };
3135
+
3121
3136
  db_doc.studio_meta.agent_assistant_name = await get_agent_assistant_name();
3122
3137
 
3123
3138
  if (!db_doc.agentConfig.agent_category) {
@@ -3130,6 +3145,11 @@ export const update_ai_agent_properties = async function (doc, app_id, uid) {
3130
3145
  db_doc.studio_meta.agent_industry = db_doc.agentConfig.agent_industry;
3131
3146
  }
3132
3147
 
3148
+ if (!db_doc.agentConfig.agent_user_guide_fields && db_doc.agentConfig.agent_user_guide) {
3149
+ db_doc.agentConfig.agent_user_guide_fields = await get_agent_user_guide();
3150
+ db_doc.studio_meta.agent_user_guide_fields = db_doc.agentConfig.agent_user_guide_fields;
3151
+ }
3152
+
3133
3153
  const save_ret = await db_module.save_app_couch_doc_native(app_id, db_doc);
3134
3154
  return save_ret;
3135
3155
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.3881",
3
+ "version": "1.1.3883",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",