@xuda.io/ai_module 1.1.5124 → 1.1.5126
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 +35 -9
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4785,7 +4785,7 @@ setTimeout(async () => {
|
|
|
4785
4785
|
|
|
4786
4786
|
// await init_studio_units();
|
|
4787
4787
|
let ret;
|
|
4788
|
-
ret = await get_chat_suggestions(uid, [], 'coi_7b65b783af38b91c8ec4c499d3694bab');
|
|
4788
|
+
// ret = await get_chat_suggestions(uid, [], 'coi_7b65b783af38b91c8ec4c499d3694bab');
|
|
4789
4789
|
// ret = await get_active_account_profile_info(uid);
|
|
4790
4790
|
// ret = await is_spam_email(uid, 'dsgr8-2994400420@gigs.craigslist.org', 'To: You, From: Us - 70% Off Stickers & Labels Today Only');
|
|
4791
4791
|
// ret = await is_spam_email(uid, 'noreply@tm.openai.com', 'Please update your Plus payment method', account_profile_info);
|
|
@@ -10842,7 +10842,7 @@ export const get_chat_suggestions = async function (uid, ai_agents, conversation
|
|
|
10842
10842
|
const account_profile_info = await get_active_account_profile_info(uid);
|
|
10843
10843
|
const account_doc = await db_module.get_couch_doc_native('xuda_accounts', uid);
|
|
10844
10844
|
const conversation_item_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, conversation_item_id);
|
|
10845
|
-
|
|
10845
|
+
const conversation_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, conversation_item_doc.conversation_id);
|
|
10846
10846
|
|
|
10847
10847
|
const get_agents = async function () {
|
|
10848
10848
|
if (typeof ai_agents === 'undefined') {
|
|
@@ -10888,14 +10888,40 @@ export const get_chat_suggestions = async function (uid, ai_agents, conversation
|
|
|
10888
10888
|
|
|
10889
10889
|
const agents_docs = await get_agents();
|
|
10890
10890
|
|
|
10891
|
-
const
|
|
10891
|
+
const chat_ret = await submit_chat_gpt_prompt({
|
|
10892
10892
|
uid,
|
|
10893
|
-
prompt: `
|
|
10894
|
-
|
|
10895
|
-
|
|
10896
|
-
|
|
10897
|
-
|
|
10898
|
-
|
|
10893
|
+
prompt: `
|
|
10894
|
+
|
|
10895
|
+
## goal:
|
|
10896
|
+
return 5 agent names best fit from the ## agent list
|
|
10897
|
+
considure the following parametes:
|
|
10898
|
+
|
|
10899
|
+
1. the ## user info::
|
|
10900
|
+
2. the ## user prompt
|
|
10901
|
+
3. the ## prompt category
|
|
10902
|
+
4. the ## prompt response
|
|
10903
|
+
|
|
10904
|
+
## user info:
|
|
10905
|
+
${JSON.stringify(account_doc.account_info)}
|
|
10906
|
+
|
|
10907
|
+
## user prompt:
|
|
10908
|
+
${conversation_item_doc.prompt || conversation_doc.prompt}
|
|
10909
|
+
|
|
10910
|
+
## prompt category:
|
|
10911
|
+
${conversation_doc?.category_info?.category}
|
|
10912
|
+
|
|
10913
|
+
## prompt response:
|
|
10914
|
+
${conversation_item_doc.text}
|
|
10915
|
+
|
|
10916
|
+
## agent list:
|
|
10917
|
+
${JSON.stringify(agents_docs)}
|
|
10918
|
+
|
|
10919
|
+
`,
|
|
10920
|
+
model: ai_model,
|
|
10921
|
+
// response_format: z.object({
|
|
10922
|
+
// mood_level: z.number().describe('mood level of interaction: -2: very negative,-1: negative 0:natural 1:positive 2: very positive'),
|
|
10923
|
+
// }),
|
|
10924
|
+
metadata: { conversation_item_id, func: 'get_chat_suggestions' },
|
|
10899
10925
|
account_profile_info,
|
|
10900
10926
|
});
|
|
10901
10927
|
|