@xuda.io/ai_module 1.1.3882 → 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.
- package/index.mjs +18 -0
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -3120,6 +3120,19 @@ export const update_ai_agent_properties = async function (doc, app_id, uid) {
|
|
|
3120
3120
|
return ret.data;
|
|
3121
3121
|
};
|
|
3122
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
|
+
|
|
3123
3136
|
db_doc.studio_meta.agent_assistant_name = await get_agent_assistant_name();
|
|
3124
3137
|
|
|
3125
3138
|
if (!db_doc.agentConfig.agent_category) {
|
|
@@ -3132,6 +3145,11 @@ export const update_ai_agent_properties = async function (doc, app_id, uid) {
|
|
|
3132
3145
|
db_doc.studio_meta.agent_industry = db_doc.agentConfig.agent_industry;
|
|
3133
3146
|
}
|
|
3134
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
|
+
|
|
3135
3153
|
const save_ret = await db_module.save_app_couch_doc_native(app_id, db_doc);
|
|
3136
3154
|
return save_ret;
|
|
3137
3155
|
};
|