@xuda.io/ai_module 1.1.4060 → 1.1.4062
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 +13 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4113,7 +4113,7 @@ export const delete_prompt_attachment = async function (req, job_id, headers, fi
|
|
|
4113
4113
|
};
|
|
4114
4114
|
|
|
4115
4115
|
export const submit_chat_gpt_prompt = async function (req) {
|
|
4116
|
-
const { model = 'gpt-5-
|
|
4116
|
+
const { model = 'gpt-5-nano', prompt, response_format, uid, metadata = {} } = req; //'gpt-5-mini
|
|
4117
4117
|
|
|
4118
4118
|
let formattedParams;
|
|
4119
4119
|
if (response_format) {
|
|
@@ -6505,3 +6505,15 @@ const attachment_handler = async function (uid, app_id, conversation_id, attachm
|
|
|
6505
6505
|
await db_module.save_app_couch_doc_native(app_id, conversation_doc);
|
|
6506
6506
|
return system_message_items;
|
|
6507
6507
|
};
|
|
6508
|
+
|
|
6509
|
+
export const is_spam_email = async function (uid, email, content) {
|
|
6510
|
+
const mood_level = await submit_chat_gpt_prompt({
|
|
6511
|
+
uid: sender_uid,
|
|
6512
|
+
prompt: `analyze the mood of the following prompt: ${prompt}. return -2: very negative,-1: negative 0:natural 1:positive 2: very positive.`,
|
|
6513
|
+
model: 'gpt-5-nano',
|
|
6514
|
+
response_format: z.object({
|
|
6515
|
+
mood_level: z.number().describe('mood level of interaction: -2: very negative,-1: negative 0:natural 1:positive 2: very positive'),
|
|
6516
|
+
}),
|
|
6517
|
+
metadata: { conversation_id, func: 'update_conversation_mood_level' },
|
|
6518
|
+
});
|
|
6519
|
+
};
|