@xuda.io/ai_module 1.1.5128 → 1.1.5130
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 +12 -15
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2961,7 +2961,6 @@ export const update_thumbnail = async function (type, doc, app_id, uid, job_id,
|
|
|
2961
2961
|
|
|
2962
2962
|
switch (type) {
|
|
2963
2963
|
case 'ai_agent': {
|
|
2964
|
-
debugger;
|
|
2965
2964
|
const images_arr = await create_ai_agent_image({ app_id, uid, ai_agent_id: doc._id, tags }, job_id, headers);
|
|
2966
2965
|
db_doc = await get_db_doc();
|
|
2967
2966
|
db_doc.studio_meta.thumbnail_request_ts = Date.now();
|
|
@@ -10836,8 +10835,6 @@ export const open_ai_alive_check = async function () {};
|
|
|
10836
10835
|
// };
|
|
10837
10836
|
|
|
10838
10837
|
export const get_chat_suggestions = async function (uid, ai_agents, conversation_item_id, ai_model = _conf.default_ai_model) {
|
|
10839
|
-
let ret = [];
|
|
10840
|
-
|
|
10841
10838
|
try {
|
|
10842
10839
|
const account_profile_info = await get_active_account_profile_info(uid);
|
|
10843
10840
|
const account_doc = await db_module.get_couch_doc_native('xuda_accounts', uid);
|
|
@@ -10903,24 +10900,24 @@ export const get_chat_suggestions = async function (uid, ai_agents, conversation
|
|
|
10903
10900
|
uid,
|
|
10904
10901
|
prompt: `
|
|
10905
10902
|
|
|
10906
|
-
|
|
10903
|
+
Role: You are a routing assistant.
|
|
10907
10904
|
|
|
10908
|
-
|
|
10905
|
+
Task: Analyze the provided user context and select the 5 most relevant agents from the ## Agent List.
|
|
10909
10906
|
|
|
10910
|
-
|
|
10911
|
-
|
|
10907
|
+
Selection Logic:
|
|
10908
|
+
Base your selection on the alignment between the agent's purpose and the following context:
|
|
10912
10909
|
|
|
10913
|
-
|
|
10910
|
+
User Profile: ${JSON.stringify(account_doc.account_info)}
|
|
10914
10911
|
|
|
10915
|
-
|
|
10912
|
+
Recent Interaction: The user asked ${conversation_item_doc.prompt || conversation_doc.prompt}, categorized as ${conversation_doc?.category_info?.category}, which resulted in the response: ${conversation_item_doc.text}.
|
|
10916
10913
|
|
|
10917
|
-
|
|
10914
|
+
Data Source: > ${JSON.stringify(agents_docs)}
|
|
10918
10915
|
|
|
10919
|
-
|
|
10920
|
-
|
|
10916
|
+
Output: > Return a JSON array of exactly 5 objects following this schema:
|
|
10917
|
+
[{ "agent_id": "string", "short_action": "string", "agent_description": "string" }]
|
|
10921
10918
|
|
|
10922
|
-
|
|
10923
|
-
|
|
10919
|
+
## output example:
|
|
10920
|
+
[{agent_id:"392_agn_55cb328d2743",short_action:"Create article","agent_description":"create proffessional article..."}]
|
|
10924
10921
|
|
|
10925
10922
|
`,
|
|
10926
10923
|
model: ai_model,
|
|
@@ -10939,7 +10936,7 @@ export const get_chat_suggestions = async function (uid, ai_agents, conversation
|
|
|
10939
10936
|
const agents_docs = await get_agents();
|
|
10940
10937
|
const suggestions = await get_suggestions();
|
|
10941
10938
|
|
|
10942
|
-
|
|
10939
|
+
return { code: 44, data: suggestions };
|
|
10943
10940
|
} catch (err) {
|
|
10944
10941
|
return { code: -44, data: err.message || String(err) };
|
|
10945
10942
|
}
|