@xuda.io/ai_module 1.1.4290 → 1.1.4291
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 +19 -0
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -6722,3 +6722,22 @@ export const is_business_contact = async function (uid, email, name, subject, bo
|
|
|
6722
6722
|
}
|
|
6723
6723
|
} catch (error) {}
|
|
6724
6724
|
};
|
|
6725
|
+
|
|
6726
|
+
const get_business_logo = async function (uid, email, name, account_profile_info) {
|
|
6727
|
+
const ret = await submit_chat_gpt_prompt({
|
|
6728
|
+
uid,
|
|
6729
|
+
prompt: `Determine if the contact with email "${email}", subject "${subject}", name "${name}", or body "${body}" belongs to a business account. Return true if it is a business contact, false otherwise.`,
|
|
6730
|
+
model: 'gpt-5-nano',
|
|
6731
|
+
response_format: z.object({
|
|
6732
|
+
is_business: z.boolean().describe('true if this is a business account/contact, false otherwise'),
|
|
6733
|
+
}),
|
|
6734
|
+
metadata: { func: 'get_business_logo' },
|
|
6735
|
+
account_profile_info,
|
|
6736
|
+
});
|
|
6737
|
+
try {
|
|
6738
|
+
if (ret.code > -1) {
|
|
6739
|
+
const data = JSON.parse(ret.data);
|
|
6740
|
+
return data.is_business;
|
|
6741
|
+
}
|
|
6742
|
+
} catch (error) {}
|
|
6743
|
+
};
|