@xuda.io/ai_module 1.1.3826 → 1.1.3827
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 +20 -18
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2001,23 +2001,22 @@ export const unarchive_ai_chat = async function (req) {
|
|
|
2001
2001
|
}
|
|
2002
2002
|
};
|
|
2003
2003
|
|
|
2004
|
-
export const create_studio_app = async function (subject) {
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
1. list all tables and screens to build an ${subject} app.
|
|
2009
|
-
2. return object array for each item (name,type,description)
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
`;
|
|
2004
|
+
// export const create_studio_app = async function (subject) {
|
|
2005
|
+
// try {
|
|
2006
|
+
// let prompt = `
|
|
2013
2007
|
|
|
2014
|
-
|
|
2008
|
+
// 1. list all tables and screens to build an ${subject} app.
|
|
2009
|
+
// 2. return object array for each item (name,type,description)
|
|
2015
2010
|
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
};
|
|
2011
|
+
// `;
|
|
2012
|
+
|
|
2013
|
+
// const data = await submit_chat_gpt_prompt({ prompt });
|
|
2014
|
+
|
|
2015
|
+
// return { code: 6, data };
|
|
2016
|
+
// } catch (err) {
|
|
2017
|
+
// return { code: -6, data: err.message };
|
|
2018
|
+
// }
|
|
2019
|
+
// };
|
|
2021
2020
|
|
|
2022
2021
|
const create_image = async function (prompt, model = 'gpt-image-1-mini', size = '1024x1024', n = 1, width = 256, height = 256) {
|
|
2023
2022
|
try {
|
|
@@ -2697,7 +2696,7 @@ export const update_ai_agent = async function (req, job_id, headers) {
|
|
|
2697
2696
|
|
|
2698
2697
|
setTimeout(async () => {
|
|
2699
2698
|
if (!name_changed) return;
|
|
2700
|
-
await update_ai_agent_properties(agent_doc, app_id);
|
|
2699
|
+
await update_ai_agent_properties(agent_doc, app_id, uid);
|
|
2701
2700
|
await update_thumbnail('ai_agent', agent_doc, app_id, uid, job_id, headers);
|
|
2702
2701
|
}, 500);
|
|
2703
2702
|
|
|
@@ -3050,7 +3049,7 @@ export const create_ai_agent = async function (req, job_id, headers) {
|
|
|
3050
3049
|
|
|
3051
3050
|
const data = await db_module.save_app_couch_doc_native(app_id, agent_doc);
|
|
3052
3051
|
setTimeout(async () => {
|
|
3053
|
-
await update_ai_agent_properties(agent_doc, app_id);
|
|
3052
|
+
await update_ai_agent_properties(agent_doc, app_id, uid);
|
|
3054
3053
|
await update_thumbnail('ai_agent', agent_doc, app_id, uid, job_id, headers);
|
|
3055
3054
|
}, 500);
|
|
3056
3055
|
|
|
@@ -3061,11 +3060,12 @@ export const create_ai_agent = async function (req, job_id, headers) {
|
|
|
3061
3060
|
}
|
|
3062
3061
|
};
|
|
3063
3062
|
|
|
3064
|
-
export const update_ai_agent_properties = async function (doc, app_id) {
|
|
3063
|
+
export const update_ai_agent_properties = async function (doc, app_id, uid) {
|
|
3065
3064
|
const db_doc = await db_module.get_app_couch_doc_native(app_id, doc._id);
|
|
3066
3065
|
|
|
3067
3066
|
const get_agent_assistant_name = async function () {
|
|
3068
3067
|
const ret = await submit_chat_gpt_prompt({
|
|
3068
|
+
uid,
|
|
3069
3069
|
prompt: `Generate a professional assistant name (e.g., “Data Analyst Assistant”) for the AI agent titled:
|
|
3070
3070
|
“${doc.properties.menuName}” and also base on the instructions : "${doc.agentConfig.agent_instructions}"
|
|
3071
3071
|
Output one option 3 words max.`,
|
|
@@ -3077,6 +3077,7 @@ export const update_ai_agent_properties = async function (doc, app_id) {
|
|
|
3077
3077
|
|
|
3078
3078
|
const get_agent_category = async function () {
|
|
3079
3079
|
const ret = await submit_chat_gpt_prompt({
|
|
3080
|
+
uid,
|
|
3080
3081
|
prompt: `Generate agent category for the AI agent titled:
|
|
3081
3082
|
“${doc.properties.menuName}” choose only one from the list:
|
|
3082
3083
|
Personal Productivity
|
|
@@ -3099,6 +3100,7 @@ export const update_ai_agent_properties = async function (doc, app_id) {
|
|
|
3099
3100
|
|
|
3100
3101
|
const get_agent_industry = async function () {
|
|
3101
3102
|
const ret = await submit_chat_gpt_prompt({
|
|
3103
|
+
uid,
|
|
3102
3104
|
prompt: `Generate agent industry for the AI agent titled:
|
|
3103
3105
|
“${doc.properties.menuName}” choose only one from the list:
|
|
3104
3106
|
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`,
|