@xuda.io/ai_module 1.1.4287 → 1.1.4288

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 +8 -3
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -6705,15 +6705,20 @@ export const is_spam_email = async function (uid, email, subject, account_profil
6705
6705
  };
6706
6706
 
6707
6707
  export const is_business_contact = async function (uid, email, subject, body, account_profile_info) {
6708
- const is_business = await submit_chat_gpt_prompt({
6708
+ const is_business_ret = await submit_chat_gpt_prompt({
6709
6709
  uid,
6710
6710
  prompt: `Determine if the contact with email "${email}", subject "${subject}", and body "${body}" belongs to a business account. Return true if it is a business contact, false otherwise.`,
6711
6711
  model: 'gpt-5-nano',
6712
6712
  response_format: z.object({
6713
- is_spam: z.boolean().describe('true if this is a business account/contact, false otherwise'),
6713
+ is_business: z.boolean().describe('true if this is a business account/contact, false otherwise'),
6714
6714
  }),
6715
6715
  metadata: { func: 'is_business_contact' },
6716
6716
  account_profile_info,
6717
6717
  });
6718
- return is_business;
6718
+ try {
6719
+ if (is_business_ret.code > -1) {
6720
+ const data = JSON.parse(is_business_ret.data);
6721
+ return data.is_business;
6722
+ }
6723
+ } catch (error) {}
6719
6724
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4287",
3
+ "version": "1.1.4288",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",