@xuda.io/ai_module 1.1.3899 → 1.1.3901
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 +3 -4
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2703,8 +2703,7 @@ export const update_ai_agent = async function (req, job_id, headers) {
|
|
|
2703
2703
|
const data = await db_module.save_app_couch_doc_native(app_id, agent_doc);
|
|
2704
2704
|
|
|
2705
2705
|
setTimeout(async () => {
|
|
2706
|
-
|
|
2707
|
-
await update_ai_agent_properties(agent_doc, app_id, uid);
|
|
2706
|
+
await update_ai_agent_properties(agent_doc, app_id, uid, { name_changed, agent_user_guide_changed, agent_category_changed, agent_subcategory_changed, agent_instructions_changed });
|
|
2708
2707
|
if (name_changed) {
|
|
2709
2708
|
await update_thumbnail('ai_agent', agent_doc, app_id, uid, job_id, headers);
|
|
2710
2709
|
}
|
|
@@ -3073,7 +3072,7 @@ export const create_ai_agent = async function (req, job_id, headers) {
|
|
|
3073
3072
|
}
|
|
3074
3073
|
};
|
|
3075
3074
|
|
|
3076
|
-
export const update_ai_agent_properties = async function (doc, app_id, uid) {
|
|
3075
|
+
export const update_ai_agent_properties = async function (doc, app_id, uid, fields_changed = {}) {
|
|
3077
3076
|
const db_doc = await db_module.get_app_couch_doc_native(app_id, doc._id);
|
|
3078
3077
|
|
|
3079
3078
|
const get_agent_assistant_name = async function () {
|
|
@@ -3212,7 +3211,7 @@ export const update_ai_agent_properties = async function (doc, app_id, uid) {
|
|
|
3212
3211
|
|
|
3213
3212
|
db_doc.studio_meta.agent_assistant_name = await get_agent_assistant_name();
|
|
3214
3213
|
|
|
3215
|
-
if (!db_doc.agentConfig.agent_category) {
|
|
3214
|
+
if (!db_doc.agentConfig.agent_category || fields_changed.name_changed || fields_changed.agent_instructions_changed) {
|
|
3216
3215
|
db_doc.agentConfig.agent_category = await get_agent_category();
|
|
3217
3216
|
db_doc.studio_meta.agent_category = db_doc.agentConfig.agent_category;
|
|
3218
3217
|
}
|