@xuda.io/ai_module 1.1.4607 → 1.1.4608

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 +31 -3
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -6974,11 +6974,13 @@ export const get_business_info = async function (uid, name, email, account_profi
6974
6974
  const business_info_ret = await submit_chat_gpt_prompt({
6975
6975
  uid,
6976
6976
  prompt: `Research the company: "${name}" (${email}).
6977
- 1. Provide a professional one-sentence biography of the company.
6978
- 2. Categorize them using the provided industry lists.
6979
- 3. Identify their primary country as a 2-letter ISO code (e.g., 'US').`,
6977
+ 1. get the company name.
6978
+ 2. Provide a professional one-sentence biography of the company.
6979
+ 3. Categorize them using the provided industry lists.
6980
+ 4. Identify their primary country as a 2-letter ISO code (e.g., 'US').`,
6980
6981
  model: 'gpt-5-nano',
6981
6982
  response_format: z.object({
6983
+ business_name: z.string().describe('the company name'),
6982
6984
  business_bio: z.string().describe('A concise, professional one-sentence summary of what the business does'),
6983
6985
  business_size: z.enum(['unknown', 'small', 'medium', 'large', 'enterprise']),
6984
6986
  business_category: z.enum(categoryNames),
@@ -7090,3 +7092,29 @@ const save_drive_file_to_disk = async function (drive_file) {
7090
7092
  contentType: validation_ret.mime,
7091
7093
  };
7092
7094
  };
7095
+
7096
+ export const get_name_from_email_addr = async function (uid, email, account_profile_info) {
7097
+ const name_ret = await submit_chat_gpt_prompt({
7098
+ uid,
7099
+ prompt: `
7100
+ extract name from the email address: "${email}" return clean name result.
7101
+ `,
7102
+ model: 'gpt-5-nano',
7103
+ response_format: z.object({
7104
+ name: z.string().describe('name from email'),
7105
+ }),
7106
+ metadata: { func: 'get_name_from_email_addr' },
7107
+ account_profile_info,
7108
+ // tools: [{ type: 'web_search_preview' }],
7109
+ });
7110
+
7111
+ try {
7112
+ if (name_ret.code > -1) {
7113
+ const data = typeof name_ret.data === 'string' ? JSON.parse(name_ret.data) : name_ret.data;
7114
+
7115
+ return data;
7116
+ }
7117
+ } catch (error) {
7118
+ console.error('Error in get_name_from_email_addr:', error);
7119
+ }
7120
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4607",
3
+ "version": "1.1.4608",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",