@rodrigobeber/patoai-dtos 4.7.53 → 4.7.54
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.
|
@@ -2,20 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.inferAgentGender = inferAgentGender;
|
|
4
4
|
exports.buildGenderTokens = buildGenderTokens;
|
|
5
|
-
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
'mercedes', 'lourdes', 'ruth', 'judith', 'liz', 'jasmin', 'yasmin',
|
|
10
|
-
'karen', 'caren', 'kelen', 'sol', 'flor',
|
|
11
|
-
]);
|
|
12
|
-
// Masculinos comuns que TERMINAM em 'a' (a regra do sufixo 'a' erraria).
|
|
13
|
-
const MASCULINE_EXCEPTIONS = new Set([
|
|
14
|
-
'luca', 'noa', 'juca', 'joca', 'nica', 'gilca',
|
|
15
|
-
]);
|
|
16
|
-
// Fallback heuristico nome->genero gramatical (pt-BR), usado quando o genero nao
|
|
17
|
-
// veio declarado (ex.: provisionamento do agente). A IA do wizard e a fonte primaria;
|
|
18
|
-
// isto so cobre o caso em que o campo veio ausente/invalido. Default 'm'.
|
|
5
|
+
// Fallback heuristico nome->genero gramatical (pt-BR), usado SO quando o genero nao
|
|
6
|
+
// veio declarado (ex.: provisionamento sem gender). A IA do wizard e a fonte primaria
|
|
7
|
+
// (gender e campo obrigatorio no output), entao isto raramente roda. Vies feminino:
|
|
8
|
+
// ~80% dos agentes tem nome feminino, entao na duvida -> 'f'.
|
|
19
9
|
function inferAgentGender(name) {
|
|
20
10
|
const first = (name || '')
|
|
21
11
|
.trim()
|
|
@@ -23,13 +13,11 @@ function inferAgentGender(name) {
|
|
|
23
13
|
.toLowerCase()
|
|
24
14
|
.normalize('NFD')
|
|
25
15
|
.replace(/[̀-ͯ]/g, '');
|
|
26
|
-
if (
|
|
27
|
-
return 'm';
|
|
28
|
-
if (MASCULINE_EXCEPTIONS.has(first))
|
|
29
|
-
return 'm';
|
|
30
|
-
if (FEMININE_EXCEPTIONS.has(first))
|
|
16
|
+
if (first.endsWith('a'))
|
|
31
17
|
return 'f';
|
|
32
|
-
|
|
18
|
+
if (first.endsWith('o'))
|
|
19
|
+
return 'm';
|
|
20
|
+
return 'f'; // vies feminino: na duvida, feminino
|
|
33
21
|
}
|
|
34
22
|
function buildGenderTokens(gender) {
|
|
35
23
|
const f = gender === 'f';
|
|
@@ -14,6 +14,8 @@ export interface WizardCollectedDto {
|
|
|
14
14
|
companyName?: string | null;
|
|
15
15
|
/** Nome desejado para o agente. */
|
|
16
16
|
agentName?: string | null;
|
|
17
|
+
/** Gênero gramatical do agentName ('m'/'f'), mostrado no resumo ao vivo; usuário pode corrigir no chat. */
|
|
18
|
+
gender?: AgentGender | null;
|
|
17
19
|
/** O que a empresa vende/oferta (produto/serviço principal), em poucas palavras. */
|
|
18
20
|
sells?: string | null;
|
|
19
21
|
/** Tipo/perfil de cliente (público-alvo), resumido. */
|