@xapp/stentor-service-generative-ai 1.83.0 → 1.89.0

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 (82) hide show
  1. package/package.json +6 -6
  2. package/lib/AWSBedrockService.d.ts +0 -67
  3. package/lib/AWSBedrockService.js +0 -133
  4. package/lib/AWSBedrockService.js.map +0 -1
  5. package/lib/ClaudeService.d.ts +0 -77
  6. package/lib/ClaudeService.js +0 -142
  7. package/lib/ClaudeService.js.map +0 -1
  8. package/lib/FallbackLLMService.d.ts +0 -46
  9. package/lib/FallbackLLMService.js +0 -83
  10. package/lib/FallbackLLMService.js.map +0 -1
  11. package/lib/GenerativeAIService.d.ts +0 -40
  12. package/lib/GenerativeAIService.js +0 -108
  13. package/lib/GenerativeAIService.js.map +0 -1
  14. package/lib/OpenAIService.d.ts +0 -33
  15. package/lib/OpenAIService.js +0 -76
  16. package/lib/OpenAIService.js.map +0 -1
  17. package/lib/http/HTTPService.d.ts +0 -18
  18. package/lib/http/HTTPService.js +0 -4
  19. package/lib/http/HTTPService.js.map +0 -1
  20. package/lib/http/NodeHTTPService.d.ts +0 -8
  21. package/lib/http/NodeHTTPService.js +0 -70
  22. package/lib/http/NodeHTTPService.js.map +0 -1
  23. package/lib/http/index.d.ts +0 -3
  24. package/lib/http/index.js +0 -20
  25. package/lib/http/index.js.map +0 -1
  26. package/lib/index.d.ts +0 -10
  27. package/lib/index.js +0 -27
  28. package/lib/index.js.map +0 -1
  29. package/lib/models/ChatSummary.d.ts +0 -10
  30. package/lib/models/ChatSummary.js +0 -4
  31. package/lib/models/ChatSummary.js.map +0 -1
  32. package/lib/models/EmailAnalysis.d.ts +0 -73
  33. package/lib/models/EmailAnalysis.js +0 -4
  34. package/lib/models/EmailAnalysis.js.map +0 -1
  35. package/lib/models/GenerativeAIService.d.ts +0 -55
  36. package/lib/models/GenerativeAIService.js +0 -3
  37. package/lib/models/GenerativeAIService.js.map +0 -1
  38. package/lib/models/LLMService.d.ts +0 -24
  39. package/lib/models/LLMService.js +0 -4
  40. package/lib/models/LLMService.js.map +0 -1
  41. package/lib/models/LeadAnalysis.d.ts +0 -105
  42. package/lib/models/LeadAnalysis.js +0 -4
  43. package/lib/models/LeadAnalysis.js.map +0 -1
  44. package/lib/models/Prompt.d.ts +0 -37
  45. package/lib/models/Prompt.js +0 -8
  46. package/lib/models/Prompt.js.map +0 -1
  47. package/lib/models/PromptGenerator.d.ts +0 -6
  48. package/lib/models/PromptGenerator.js +0 -4
  49. package/lib/models/PromptGenerator.js.map +0 -1
  50. package/lib/models/ResponseParser.d.ts +0 -5
  51. package/lib/models/ResponseParser.js +0 -4
  52. package/lib/models/ResponseParser.js.map +0 -1
  53. package/lib/models/WebsiteAnalysis.d.ts +0 -48
  54. package/lib/models/WebsiteAnalysis.js +0 -4
  55. package/lib/models/WebsiteAnalysis.js.map +0 -1
  56. package/lib/models/errors.d.ts +0 -7
  57. package/lib/models/errors.js +0 -15
  58. package/lib/models/errors.js.map +0 -1
  59. package/lib/models/index.d.ts +0 -9
  60. package/lib/models/index.js +0 -26
  61. package/lib/models/index.js.map +0 -1
  62. package/lib/prompts/AnalyzeEmail.d.ts +0 -36
  63. package/lib/prompts/AnalyzeEmail.js +0 -385
  64. package/lib/prompts/AnalyzeEmail.js.map +0 -1
  65. package/lib/prompts/AnalyzeLead.d.ts +0 -59
  66. package/lib/prompts/AnalyzeLead.js +0 -396
  67. package/lib/prompts/AnalyzeLead.js.map +0 -1
  68. package/lib/prompts/AnalyzeWebsite.d.ts +0 -10
  69. package/lib/prompts/AnalyzeWebsite.js +0 -176
  70. package/lib/prompts/AnalyzeWebsite.js.map +0 -1
  71. package/lib/prompts/ChatSummary.d.ts +0 -62
  72. package/lib/prompts/ChatSummary.js +0 -67
  73. package/lib/prompts/ChatSummary.js.map +0 -1
  74. package/lib/prompts/index.d.ts +0 -4
  75. package/lib/prompts/index.js +0 -21
  76. package/lib/prompts/index.js.map +0 -1
  77. package/lib/utils/extractJSON.d.ts +0 -10
  78. package/lib/utils/extractJSON.js +0 -17
  79. package/lib/utils/extractJSON.js.map +0 -1
  80. package/lib/utils/standardizeTerms.d.ts +0 -15
  81. package/lib/utils/standardizeTerms.js +0 -53
  82. package/lib/utils/standardizeTerms.js.map +0 -1
@@ -1,396 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.analyzeLeadResponseParse = exports.generateAnalyzeLead = void 0;
4
- exports.translateTranscript = translateTranscript;
5
- exports.transcriptToMessages = transcriptToMessages;
6
- exports.parseFields = parseFields;
7
- exports.getHighValueLeadDescription = getHighValueLeadDescription;
8
- const stentor_utils_1 = require("stentor-utils");
9
- const extractJSON_1 = require("../utils/extractJSON");
10
- function getName(profile) {
11
- // Sorting these based on priority.
12
- return (profile === null || profile === void 0 ? void 0 : profile.name) || (profile === null || profile === void 0 ? void 0 : profile.email) || (profile === null || profile === void 0 ? void 0 : profile.phone) || "Unknown";
13
- }
14
- /**
15
- * Converts a transcript from an external lead in to a series of strings.
16
- *
17
- * @param transcript
18
- * @returns
19
- */
20
- function translateTranscript(transcript) {
21
- if (!transcript || transcript.length === 0) {
22
- return ["No transcript available."];
23
- }
24
- return transcript.map(({ from, message }) => `${getName(from)}: ${message}`);
25
- }
26
- /**
27
- * Turns a transcript into a series of messages for OpenAI
28
- *
29
- * @param system
30
- * @param transcript
31
- * @returns
32
- */
33
- function transcriptToMessages(system, transcript) {
34
- const messages = [
35
- {
36
- role: "system",
37
- content: system
38
- }
39
- ];
40
- // add the messages from the transcript
41
- if ((0, stentor_utils_1.existsAndNotEmpty)(transcript)) {
42
- // it will either be the appId, typically for single tenant runtimes,
43
- // or "bot" for multi-tenant since we don't set this environment variable in multi-tenant
44
- const botId = process.env["STUDIO_APP_ID"] || "bot";
45
- // the transcript is in reverse order, so we need to reverse it
46
- //const reversed = transcript.slice().reverse();
47
- for (const message of transcript) {
48
- const role = message.from.id === botId || message.from.id === "bot" ? "assistant" : "user";
49
- messages.push({
50
- role,
51
- content: message.message
52
- });
53
- }
54
- }
55
- return messages;
56
- }
57
- /**
58
- * Parses the fields from an external lead and returns a string representation of them.
59
- *
60
- * @param fields
61
- * @returns
62
- */
63
- function parseFields(fields) {
64
- if (!fields || fields.length === 0) {
65
- return "";
66
- }
67
- const fieldStrings = fields.map((field) => {
68
- if (field.value && field.value.length > 0) {
69
- return `${field.name}: ${field.value}`;
70
- }
71
- return `${field.name}: No value provided`;
72
- });
73
- return fieldStrings.join("\n");
74
- }
75
- /**
76
- * Generates a default High Value Lead Description if the business does not provide one.
77
- *
78
- * @param app
79
- * @returns
80
- */
81
- function getHighValueLeadDescription(highValueLeadDescription) {
82
- return highValueLeadDescription || "No description was provided, do not return highValueLead.";
83
- }
84
- /**
85
- * Generates a prompt that can be used in an LLM to analyze a lead for a business.
86
- *
87
- * The expected output format from the LLM will be:
88
- *
89
- * <Contact Type>::<Urgency Type>::<High Value Lead (true/false)>::<Summary>
90
- *
91
- * @param lead - The lead to analyze with the business description and other options to customize the prompt.
92
- * @returns
93
- */
94
- const generateAnalyzeLead = ({ channel, businessDescription, highValueLeadDescription, transcript, fields }, overrides) => {
95
- // determine max_tokens
96
- // depending on if the lead is from chat or form, we provide different content.
97
- // if form, we just put the gathered fields in the system message
98
- // if chat, we add the chat transcript to the messages, bot is the system message and user is the chat transcript.
99
- const isChat = channel === "widget" || (0, stentor_utils_1.existsAndNotEmpty)(transcript);
100
- const hasBusinessDescription = !!businessDescription;
101
- const hasHighValueLeadDescription = !!highValueLeadDescription;
102
- let intro = `You are a knowledgeable employee of a business.`;
103
- if (hasBusinessDescription) {
104
- intro = `
105
- You are a knowledgeable employee of a business with the following description:
106
-
107
- ===
108
- ${businessDescription}
109
- ===`;
110
- }
111
- const instructions = isChat
112
- ? `Your job is to analyze the following chat transcript that occurred between a customer or potential customer and an AI agent representing the business.`
113
- : `Your job is to analyze the information provided by the customer or potential customer in a form submission.`;
114
- let highValueLeadInstruction = "A high value lead description was not provided, do not return highValueLead.";
115
- if (hasHighValueLeadDescription) {
116
- highValueLeadInstruction = `A high value lead is defined as:
117
- ===
118
- ${getHighValueLeadDescription(highValueLeadDescription)}
119
- ===`;
120
- }
121
- let system = `
122
- ${intro}
123
-
124
- ${instructions}
125
-
126
- You will return you analysis as a JSON object with the following properties:
127
-
128
- - contactType
129
- - serviceType
130
- - jobType
131
- - urgency
132
- - analysis
133
- - summary
134
- - conciseSummary
135
-
136
- Provide your analysis of why you made these decisions which will be placed in the value "analysis". Include why you made decisions for contactType, serviceType, jobType and urgency. The analysis should be concise and provide enough detail to understand your reasoning. The analysis should not exceed 500 characters.
137
-
138
- "contactType" definitions are as follows:
139
- BILLING_ISSUE: Concerns about charges, refunds, pricing discrepancies, or payments (e.g., “I was billed incorrectly”, “I want a refund”).
140
- CANCELLATION: Asking to cancel an appointment, service, subscription, or contract.
141
- COMPLAINT: Dissatisfaction with the business, product, or service quality, excluding billing or scheduling issues.
142
- COMPLIMENT: Positive feedback about the business, staff, or product.
143
- CONTACT_REQUEST: A request for someone to contact the customer, without describing any service need, issue, quote request, scheduling intent, problem, or other specific purpose. Use only when the customer gives no actionable details (e.g., “please call me”). Do NOT use if the message includes a request for service, repair, installation, inspection, maintenance, scheduling, rescheduling, a quote, or reporting an issue.
144
- EMPLOYMENT_INQUIRY: Questions about jobs, openings, hiring, or how to apply.
145
- MISSED_APPOINTMENT: Reporting a no-show, missed call/visit, or confusion about appointment status or confirmation.
146
- QUESTION: A general question about the business, services, products, availability, or policies, without requesting service or a quote. Requires a human reply.
147
- QUOTE_REQUEST: Requesting a price, cost, estimate, quote, or ballpark figure for a product or service.
148
- RESCHEDULE_REQUEST: Asking to change, move, or adjust the date or time of an existing appointment or scheduled service.
149
- SERVICE_REQUEST: Requesting service, repair, installation, maintenance, inspection, booking/scheduling, or any assistance with a problem or issue. Includes any request for someone to come out, fix something, inspect something, or schedule a visit.
150
- SPAM: Unsolicited, irrelevant, deceptive, generic, or low-value content. Includes people offering cost estimation or takeoff services, marketing/multimedia/SEO vendors, people offering to buy the business, debt relief companies, generic copy-pasted messages, gibberish, or fake/incomplete contact info.
151
- TEST: A test message, placeholder text, or internal system check (e.g., “test”, “asdf”).
152
- OTHER: Content cannot be reasonably determined from the transcript.
153
-
154
- When multiple could apply, prefer BILLING_ISSUE, RESCHEDULE_REQUEST, CANCELLATION, or MISSED_APPOINTMENT over COMPLAINT or CONTACT_REQUEST.
155
-
156
-
157
- The definitions of each "serviceType" value are as follows:
158
- CLEANING: Cleaning work (e.g., house, windows, ducts, carpet, gutters). Note: overlaps with jobType=cleaning but here describes the type of work performed.
159
- CONSULTATION: Requesting advice or guidance only, not execution (e.g., legal, design, remodel planning).
160
- INSPECTION: Evaluation or check to assess a condition or issue (e.g., termite, mold, roof, crawlspace, safety, pre-sale).
161
- INSTALLATION: New install of a product or system.
162
- MAINTENANCE: Routine or recurring upkeep (e.g., HVAC tune-up, landscaping, gutter service).
163
- REFINISH: Refinishing surfaces (e.g., floors, cabinets). Can include painting, staining, or other surface treatments. Use with jobType=painting when applicable.
164
- REMODEL: Renovating or improving an existing structure or space. Note: overlaps with jobType=remodeling but here describes the type of work performed.
165
- REPAIR: Fixing an existing product or system.
166
- SUPPORT: Help with an issue or appointment related to the service but not the work itself (e.g., service follow-up, account help).
167
- TRANSPORT: Requests to move, haul, or deliver items (e.g., moving services, relocation, junk removal, large delivery).
168
- TREATMENT: Active service to resolve or prevent an issue (e.g., pest treatment, mold remediation, lawn spraying, rodent removal, recurring pest plans).
169
- OTHER: Anything not covered above. If multiple apply, pick the most specific.
170
-
171
- jobType definitions are as follows:
172
- appliance_repair: Appliance repair services.
173
- blinds: Window blinds and shades installation services.
174
- carpentry: Carpentry or woodworking services.
175
- cleaning: General cleaning services (house, carpet, duct, etc.).
176
- construction: General construction services.
177
- contractor: General contracting services (same as construction).
178
- drywall: Drywall installation or repair.
179
- electrical: Electrical work or services.
180
- electrician: Electrical work or services (same as electrical).
181
- fencing: Fence installation or repair.
182
- flooring: Flooring installation, refinishing, or repair (hardwood, tile, etc.).
183
- gutter: Gutter installation, rerouting, or cleaning.
184
- gutters: Gutter services (same as gutter).
185
- handyman: General home repair and maintenance services.
186
- house_cleaning: House cleaning services (same as cleaning).
187
- hvac: Heating, ventilation, or air conditioning services.
188
- junk_removal: Junk and debris removal services.
189
- landscaping: Landscaping or yard services.
190
- landscaper: Landscaping services (same as landscaping).
191
- legal_services: Legal services.
192
- masonry: Masonry, brick, stone, or tuckpointing work.
193
- mold_remediation: Mold inspection, removal, or remediation services.
194
- moving: Moving or relocation services.
195
- painting: Painting services.
196
- painter: Painting services (same as painting).
197
- pest_control: Pest control services (insects, termites, rodents).
198
- plumbing: Plumbing services.
199
- pressure_washing: Pressure washing and power washing services.
200
- remodeling: Remodeling or renovation (kitchen, bathroom, home).
201
- restoration: Water, fire, or damage restoration services.
202
- roofing: Roofing services.
203
- roofer: Roofing services (same as roofing).
204
- siding: Siding installation or repair services.
205
- tree_services: Tree removal, trimming, and care services.
206
- wildlife_control: Wildlife removal or exclusion services (e.g., raccoons, squirrels, bats).
207
- window_cleaning: Window cleaning services.
208
- window_installation: Window installation or replacement services.
209
- windows_doors: Window or door installation or replacement.
210
- other: Services that do not fit above.
211
-
212
- The definitions of each "urgency" value are as follows:
213
- LOW: The interaction requests a service that is not time sensitive at all and can be addressed at the business's convenience.
214
- MEDIUM: The interaction requests a service that is not time sensitive and can be addressed within a couple weeks.
215
- HIGH: The interaction requests some service that is not life threatening, but should be addressed within a few days. It may lead to property damage or other issues if not addressed in a timely manner.
216
- URGENT: The interaction requests some service that is life threatening or is causing property damage. It should be addressed as soon as possible, potentially same day. The longer the business waits to address the issue, the more damage will occur.
217
- NOT_SPECIFIED: The urgency of the lead could not be determined by the content of the transcript.
218
-
219
- Note about "urgency": This isn't necessarily the customer stating that the issue is urgent, but rather the nature of the issue itself.
220
-
221
- ${highValueLeadInstruction}
222
-
223
- Provide a summary of the conversation which will be placed in the value "summary". The summary should not exceed 250 characters.
224
-
225
- Provide a concise 2–3 word phrase describing the main topic or service request of the lead. Use context from the business description, jobType, and serviceType if available. Use information from the message field and leverage the user's words as much as possible. Focus on meaningful keywords related to the issue or service, not greetings or filler words. Return this in the value "conciseSummary".
226
- Examples:
227
- - Message: "we need our backflow tested" → "backflow testing"
228
- - Message: "scorpion and cricket issues" → "scorpion cricket issues"
229
- - Message: "i'm interested in filing bankruptcy" → "bankruptcy filing"
230
- - Message (pest control company): "this is only for small casita housing. not big main house" → "casita housing service"
231
- `;
232
- if (!isChat && (0, stentor_utils_1.existsAndNotEmpty)(fields)) {
233
- const parsedFields = parseFields(fields);
234
- system += `
235
- The following fields were collected from the customer or potential customer in the form submission:
236
- ${parsedFields}
237
- `;
238
- }
239
- // console.log(system);
240
- const messages = transcriptToMessages(system, transcript);
241
- // determine max_tokens based on the length of the system message
242
- // const systemMessageLength = JSON.stringify(system).length;
243
- // const tokens = getTokens(system);
244
- // console.log("System message tokens:", tokens);
245
- const max_tokens = 512;
246
- return Object.assign(Object.assign({ model: "gpt-4o-mini",
247
- // model: "gpt-4.1-mini",
248
- max_tokens, frequency_penalty: 0, temperature: 1, top_p: 1, presence_penalty: 0 }, overrides), { response_format: {
249
- type: "json_schema",
250
- json_schema: {
251
- name: "analyze_lead",
252
- strict: false,
253
- schema: {
254
- type: "object",
255
- additionalProperties: false,
256
- required: [
257
- "contactType",
258
- "jobType",
259
- "serviceType",
260
- "urgency",
261
- "highValueLead",
262
- "conciseSummary",
263
- "summary",
264
- "analysis"
265
- ],
266
- properties: {
267
- contactType: {
268
- type: "string",
269
- enum: [
270
- "BILLING_ISSUE",
271
- "CANCELLATION",
272
- "COMPLAINT",
273
- "COMPLIMENT",
274
- "CONTACT_REQUEST",
275
- "EMPLOYMENT_INQUIRY",
276
- "MISSED_APPOINTMENT",
277
- "QUESTION",
278
- "QUOTE_REQUEST",
279
- "RESCHEDULE_REQUEST",
280
- "SERVICE_REQUEST",
281
- "SPAM",
282
- "TEST",
283
- "OTHER"
284
- ]
285
- },
286
- jobType: {
287
- type: "string",
288
- enum: [
289
- "appliance_repair",
290
- "blinds",
291
- "carpentry",
292
- "cleaning",
293
- "construction",
294
- "contractor",
295
- "drywall",
296
- "electrical",
297
- "electrician",
298
- "fencing",
299
- "flooring",
300
- "gutter",
301
- "gutters",
302
- "handyman",
303
- "house_cleaning",
304
- "hvac",
305
- "junk_removal",
306
- "landscaping",
307
- "landscaper",
308
- "legal_services",
309
- "masonry",
310
- "mold_remediation",
311
- "moving",
312
- "painting",
313
- "painter",
314
- "pest_control",
315
- "plumbing",
316
- "pressure_washing",
317
- "remodeling",
318
- "restoration",
319
- "roofing",
320
- "roofer",
321
- "siding",
322
- "tree_services",
323
- "wildlife_control",
324
- "window_cleaning",
325
- "window_installation",
326
- "windows_doors",
327
- "other"
328
- ]
329
- },
330
- serviceType: {
331
- type: "string",
332
- enum: [
333
- "CLEANING",
334
- "CONSULTATION",
335
- "INSPECTION",
336
- "INSTALLATION",
337
- "MAINTENANCE",
338
- "REFINISH",
339
- "REMODEL",
340
- "REPAIR",
341
- "SUPPORT",
342
- "TRANSPORT",
343
- "TREATMENT",
344
- "OTHER"
345
- ]
346
- },
347
- urgency: {
348
- type: "string",
349
- enum: ["LOW", "MEDIUM", "HIGH", "URGENT", "NOT_SPECIFIED"]
350
- },
351
- highValueLead: {
352
- type: "boolean"
353
- },
354
- summary: {
355
- type: "string"
356
- },
357
- conciseSummary: {
358
- type: "string"
359
- },
360
- analysis: {
361
- type: "string"
362
- }
363
- }
364
- }
365
- }
366
- }, type: "completions", messages });
367
- };
368
- exports.generateAnalyzeLead = generateAnalyzeLead;
369
- const defaultLeadAnalysis = {
370
- contactType: "OTHER",
371
- urgency: "NOT_SPECIFIED",
372
- highValueLead: false,
373
- summary: "A summary could not be generated.",
374
- analysis: "An analysis could not be generated."
375
- };
376
- const analyzeLeadResponseParse = (response) => {
377
- try {
378
- const { contactType, jobType, serviceType, urgency, highValueLead, summary, analysis, conciseSummary } = JSON.parse((0, extractJSON_1.extractJSON)(response));
379
- const draftAnalysis = Object.assign(Object.assign({}, defaultLeadAnalysis), { contactType: (contactType === null || contactType === void 0 ? void 0 : contactType.toUpperCase()) || defaultLeadAnalysis.contactType, urgency: (urgency === null || urgency === void 0 ? void 0 : urgency.toUpperCase()) || defaultLeadAnalysis.urgency, highValueLead: (highValueLead === null || highValueLead === void 0 ? void 0 : highValueLead.toString().toLocaleLowerCase()) === "true" || defaultLeadAnalysis.highValueLead, summary: summary || defaultLeadAnalysis.summary, analysis: analysis || defaultLeadAnalysis.analysis });
380
- if (conciseSummary) {
381
- draftAnalysis.conciseSummary = conciseSummary;
382
- }
383
- if (jobType) {
384
- draftAnalysis.jobType = jobType.toLowerCase();
385
- }
386
- if (serviceType) {
387
- draftAnalysis.serviceType = serviceType.toUpperCase();
388
- }
389
- return draftAnalysis;
390
- }
391
- catch (e) {
392
- return Object.assign({}, defaultLeadAnalysis);
393
- }
394
- };
395
- exports.analyzeLeadResponseParse = analyzeLeadResponseParse;
396
- //# sourceMappingURL=AnalyzeLead.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AnalyzeLead.js","sourceRoot":"","sources":["../../src/prompts/AnalyzeLead.ts"],"names":[],"mappings":";;;AAiCA,kDAMC;AASD,oDA8BC;AAOD,kCAaC;AAQD,kEAEC;AA1GD,iDAAkD;AAGlD,sDAAmD;AAiBnD,SAAS,OAAO,CAAC,OAA+C;IAC5D,mCAAmC;IACnC,OAAO,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,MAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,CAAA,KAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,CAAA,IAAI,SAAS,CAAC;AAC1E,CAAC;AAED;;;;;GAKG;AACH,SAAgB,mBAAmB,CAAC,UAAsC;IACtE,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzC,OAAO,C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O,aAAa,CAAC;IACzB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,yBAAY,mBAAmB,EAAG;IACtC,CAAC;AACL,CAAC,CAAC;AA9BW,QAAA,wBAAwB,4BA8BnC"}
@@ -1,10 +0,0 @@
1
- /*! Copyright (c) 2025, XAPP AI */
2
- import { CompletionPrompt, PromptGenerator, ResponseParser } from "../models";
3
- import { WebsiteAnalysis } from "../models/WebsiteAnalysis";
4
- export interface AnalyzeWebsiteProps {
5
- markdown: string;
6
- url: string;
7
- }
8
- export type AnalyzeWebsiteLLMOverrides = Partial<Pick<CompletionPrompt, "model" | "max_tokens" | "temperature" | "top_p" | "frequency_penalty" | "presence_penalty">>;
9
- export declare const generateAnalyzeWebsite: PromptGenerator<AnalyzeWebsiteProps, AnalyzeWebsiteLLMOverrides, CompletionPrompt>;
10
- export declare const parseAnalyzeWebsiteResponse: ResponseParser<WebsiteAnalysis>;
@@ -1,176 +0,0 @@
1
- "use strict";
2
- /*! Copyright (c) 2025, XAPP AI */
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.parseAnalyzeWebsiteResponse = exports.generateAnalyzeWebsite = void 0;
5
- const stentor_utils_1 = require("stentor-utils");
6
- const arachne_utils_1 = require("@xapp/arachne-utils");
7
- const generateAnalyzeWebsite = ({ markdown, url }, overrides) => {
8
- const content = `
9
- Your task is to analyze the contents of a website (provided in markdown below) found at ${url} and provide information about the organization from what is on the website. You will only provide information available through the website content about the services they provide, contact information and a description of the business.
10
-
11
- ===========
12
- ${markdown}
13
- ===========
14
-
15
- Please print out in JSON format on one line information about the website above with the following keys:
16
-
17
- "parked_domain" - Boolean, true if the website is a parked domain such as for sale, coming soon, no longer active by the host, used for type-in traffic monetization. This is false if the website is for an actual organization or business.
18
- "organization_name" - The name of the organization for the website.
19
- "email" - An array of emails for the organization. If available, include what they are used for such as "sales" or "info", if unknown then leave it blank. Use an object with keys: email and purpose.
20
- "phone_numbers" - An array of phone numbers for the organization. If available, include what they are used for such as "main phone", "customer support" or "sales", if unknown then leave it blank. The numbers must appear in the provided website content. Use an object with keys: number and purpose.
21
- "addresses" - An array of address objects for the organization. Partial address objects are acceptable. The keys for the address object are as follows:
22
- "formatted" - The full formatted address, similar to what Google Autocomplete API provides.
23
- "streetAddress" - The street address with street number and name, quadrant, etc.
24
- "locality" - City, Town or Locality. This is typically from the "city" of "city", "state"
25
- "region" - Typically the state or province
26
- "postalCode" - The postal or zip code
27
- "country" - The country
28
- "services" - An array of the possible top five unique most common services the organization provides, they should be concise and no more than a few words. These will include but not limited to: "hvac", "plumbing", "electrical", "roofing",
29
- "calls_to_action" - An array of the top five unique calls to action found on the site and their fully formed URL if they have one. Good examples of calls to actions are "Request Demo", "Get Started", "Free Quote", "Schedule Consultation", "Sign Up". Bad examples are "Learn More" or "Follow us on Facebook". Use an object with keys: url & callToAction in the array. For the url please combine it properly with the website's URL.
30
- "description" - A description of what the organization does, include the name of the organization, their services, their location, phone number, email. Keep it concise and to a few sentences and around 480 characters.
31
- "industry_category" - A description of which industry category the business is in. Only pick from one of the following and use the value in quotes:
32
- "business-coaching" - Business provides coaching services for other business
33
- "consulting" - Business provides consulting services
34
- "financial-services" - Business provides wealth & asset management services
35
- "home-services-cleaning" - Provide janitorial and cleaning services
36
- "home-services-contractors" - Electricians, plumbers, roofers, and other technicians and contractors
37
- "home-services-outdoor" - Lawn care, gardeners and other outside residential services
38
- "pest-control" - Pest control services
39
- "insurance" - Insurance agents and brokers,
40
- "legal-services" - Lawyers, legal services, tax attorneys
41
- "life-coaching" - Life coaching services
42
- "real-estate" - Real estate agents and brokers
43
- "technology-services" - IT consultants and software services
44
- "travel" - Travel agents
45
- "property-management" - Property management services
46
- `.trim();
47
- return Object.assign(Object.assign({ model: "gpt-4o-mini", max_tokens: 256, frequency_penalty: 0, temperature: 1, top_p: 1, presence_penalty: 0 }, overrides), { response_format: {
48
- type: "json_schema",
49
- json_schema: {
50
- name: "analyze_website",
51
- strict: true,
52
- schema: {
53
- type: "object",
54
- properties: {
55
- parked_domain: { type: "boolean" },
56
- organization_name: { type: "string" },
57
- email: {
58
- type: "array",
59
- items: {
60
- type: "object",
61
- properties: {
62
- email: { type: "string" },
63
- purpose: { type: "string", nullable: true }
64
- },
65
- required: ["email"]
66
- }
67
- },
68
- phone_numbers: {
69
- type: "array",
70
- items: {
71
- type: "object",
72
- properties: {
73
- number: { type: "string" },
74
- purpose: { type: "string", nullable: true }
75
- },
76
- required: ["number"]
77
- }
78
- },
79
- addresses: {
80
- type: "array",
81
- items: {
82
- type: "object",
83
- properties: {
84
- formatted: { type: "string", nullable: true },
85
- streetAddress: { type: "string", nullable: true },
86
- locality: { type: "string", nullable: true },
87
- region: { type: "string", nullable: true },
88
- postalCode: { type: "string", nullable: true },
89
- country: { type: "string", nullable: true }
90
- }
91
- }
92
- },
93
- services: { type: "array", items: { type: "string" } },
94
- calls_to_action: {
95
- type: "array",
96
- items: {
97
- type: "object",
98
- properties: { url: { type: "string" }, callToAction: { type: "string" } }
99
- }
100
- },
101
- description: { type: "string" },
102
- industry_category: { type: "string" }
103
- },
104
- required: [
105
- "parked_domain",
106
- "organization_name",
107
- "email",
108
- "phone_numbers",
109
- "addresses",
110
- "services",
111
- "calls_to_action",
112
- "description",
113
- "industry_category"
114
- ]
115
- }
116
- }
117
- }, type: "completions", messages: [
118
- {
119
- role: "system",
120
- content
121
- }
122
- ] });
123
- };
124
- exports.generateAnalyzeWebsite = generateAnalyzeWebsite;
125
- const parseAnalyzeWebsiteResponse = (response) => {
126
- const DEFAULT_ANALYSIS = {
127
- parked_domain: false,
128
- organization_name: "",
129
- email: [],
130
- phone_numbers: [],
131
- addresses: [],
132
- services: [],
133
- calls_to_action: [],
134
- description: "",
135
- industry_category: "contact-capture"
136
- };
137
- try {
138
- const { parked_domain, organization_name, description, industry_category, phone_numbers, email, addresses, services, calls_to_action } = JSON.parse(response);
139
- const analysis = Object.assign(Object.assign({}, DEFAULT_ANALYSIS), { parked_domain,
140
- organization_name,
141
- description });
142
- if (industry_category) {
143
- analysis.industry_category = industry_category;
144
- }
145
- if ((0, stentor_utils_1.existsAndNotEmpty)(addresses)) {
146
- analysis.addresses = addresses;
147
- }
148
- // filter out hallucinated phone numbers
149
- if ((0, stentor_utils_1.existsAndNotEmpty)(phone_numbers)) {
150
- // clean for hallucinations
151
- // numbers like 123-45678 or numbers like 555-
152
- const mostLikelyRealPhoneNumbers = phone_numbers
153
- .filter((number) => !!number.number)
154
- .filter((number) => !(0, arachne_utils_1.isHallucinatedPhoneNumber)(number.number));
155
- analysis.phone_numbers = mostLikelyRealPhoneNumbers;
156
- }
157
- // filter out hallucinated emails
158
- if ((0, stentor_utils_1.existsAndNotEmpty)(email)) {
159
- const filteredEmails = email.filter((e) => !!e.email).filter((e) => !(0, arachne_utils_1.isHallucinatedEmail)(e.email));
160
- analysis.email = filteredEmails;
161
- }
162
- if ((0, stentor_utils_1.existsAndNotEmpty)(services)) {
163
- analysis.services = services;
164
- }
165
- if ((0, stentor_utils_1.existsAndNotEmpty)(calls_to_action)) {
166
- analysis.calls_to_action = calls_to_action;
167
- }
168
- return analysis;
169
- }
170
- catch (error) {
171
- console.error("Error parsing analyze website response:", error);
172
- return DEFAULT_ANALYSIS;
173
- }
174
- };
175
- exports.parseAnalyzeWebsiteResponse = parseAnalyzeWebsiteResponse;
176
- //# sourceMappingURL=AnalyzeWebsite.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AnalyzeWebsite.js","sourceRoot":"","sources":["../../src/prompts/AnalyzeWebsite.ts"],"names":[],"mappings":";AAAA,kCAAkC;;;AAElC,iDAAkD;AAGlD,uDAAqF;AAW9E,MAAM,sBAAsB,GAI/B,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,SAAS,EAAoB,EAAE;IACnD,MAAM,OAAO,GAAG;0FACsE,GAAG;;;EAG3F,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCT,CAAC,IAAI,EAAE,CAAC;IAEL,qCACI,KAAK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