@xuda.io/ai_module 1.1.4715 → 1.1.4716

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.
Files changed (2) hide show
  1. package/index.mjs +20 -0
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -6854,6 +6854,26 @@ export const is_business_contact = async function (uid, email, name, subject, bo
6854
6854
  } catch (error) {}
6855
6855
  };
6856
6856
 
6857
+ export const is_business_contact_has_person = async function (uid, email, name, subject, body, account_profile_info) {
6858
+ const has_person_ret = await submit_chat_gpt_prompt({
6859
+ uid,
6860
+ prompt: `detect if the email "${email}", subject "${subject}", name "${name}", or body "${body}" is has person. Return true if it is a has person , false otherwise.`,
6861
+
6862
+ model: 'gpt-5-nano',
6863
+ response_format: z.object({
6864
+ has_person: z.boolean().describe('true if the email has person, false otherwise'),
6865
+ }),
6866
+ metadata: { func: 'is_business_contact' },
6867
+ account_profile_info,
6868
+ });
6869
+ try {
6870
+ if (has_person_ret.code > -1) {
6871
+ const data = JSON.parse(has_person_ret.data);
6872
+ return data.has_person;
6873
+ }
6874
+ } catch (error) {}
6875
+ };
6876
+
6857
6877
  function normalizeFilename(name) {
6858
6878
  return name
6859
6879
  .toLowerCase() // lowercase
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4715",
3
+ "version": "1.1.4716",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",