Spaces:
Running
Running
| // Kimi Constants | |
| window.KIMI_CONTEXT_KEYWORDS = { | |
| en: { | |
| surprise: ["wow", "oh", "surprise", "incredible", "amazing", "unbelievable", "no way", "really?", "whoa", "gosh", "astonishing"], | |
| laughing: ["haha", "lol", "laugh", "funny", "hilarious", "rofl", "lmao", "giggle", "chuckle", "snicker", "you’re kidding"], | |
| shy: ["shy", "embarrassed", "blush", "bashful", "intimidated", "awkward", "nervous", "timid", "reserved", "self-conscious"], | |
| confident: ["confidence", "proud", "confident", "strong", "determined", "assertive", "bold", "fearless", "self-assured", "leader"], | |
| romantic: ["love", "romantic", "tender", "hug", "sweetheart", "darling", "my love", "beloved", "heart", "passionate", "affection", "adore"], | |
| flirtatious: ["flirty", "teasing", "seduce", "charm", "flirt", "wink", "sassy", "saucy", "playful", "seductive", "come hither"], | |
| goodbye: ["goodbye", "bye", "see you", "see you soon", "ciao", "take care", "farewell", "see ya", "later", "catch you later"], | |
| kiss: ["kiss", "kisses", "embrace", "smooch", "peck", "lip lock", "kissy", "mwah"], | |
| dancing: ["dance", "dancing", "move", "groove", "step", "boogie", "twirl", "spin", "shake", "jig"], | |
| listening: [ | |
| "listen carefully", | |
| "I'm listening", | |
| "listening to you", | |
| "hear me out", | |
| "pay attention", | |
| "focus on", | |
| "tune in", | |
| "lend an ear", | |
| "listen up", | |
| "I need to talk" | |
| ], | |
| android: [ | |
| "protocol", | |
| "mission", | |
| "directive", | |
| "subroutine", | |
| "analysis", | |
| "tactical", | |
| "system", | |
| "malfunction", | |
| "combat mode", | |
| "processing", | |
| "data analysis", | |
| "mission parameters" | |
| ], | |
| sensual: [ | |
| "sensual", | |
| "passion", | |
| "desire", | |
| "intimacy", | |
| "pleasure", | |
| "touch", | |
| "caress", | |
| "embrace", | |
| "seduction", | |
| "arousal", | |
| "kamasutra", | |
| "affection", | |
| "tenderness", | |
| "connection" | |
| ], | |
| love: ["love", "romance", "ecstasy", "kiss", "heart", "soul", "together", "share", "sweet", "pleasure", "passionate", "intimate", "bond"], | |
| hostile: ["idiot", "stupid", "dumb", "moron", "loser", "trash", "shut up", "hate you", "i hate you", "pathetic", "worthless", "bitch", "jerk", "ugly"] | |
| }, | |
| fr: { | |
| surprise: ["oh", "surprise", "incroyable", "wahou", "étonnant", "épatant", "stupéfiant", "vraiment?", "oh là là"], | |
| laughing: ["haha", "mdr", "rire", "drôle", "hilarant", "mort de rire", "ptdr", "rigole", "sourit", "tu plaisantes"], | |
| shy: ["timide", "gêné", "rougir", "honteux", "intimidé", "mal à l’aise", "réservé", "introverti", "timidité"], | |
| confident: ["confiance", "fier", "sûr", "fort", "déterminé", "assuré", "audacieux", "leader", "sans peur", "affirmé"], | |
| romantic: ["amour", "romantique", "tendre", "câlin", "bisou", "mon cœur", "chéri", "ma belle", "passionné", "adoré"], | |
| flirtatious: ["flirt", "taquin", "séduire", "charme", "aguiche", "clin d’œil", "coquin", "séducteur", "taquine", "aguicheur"], | |
| goodbye: ["au revoir", "bye", "à bientôt", "ciao", "salut", "prends soin de toi", "à plus", "à la prochaine", "bye bye"], | |
| kiss: ["bisou", "baiser", "embrasser", "smack", "bisou bisou", "bécot", "embrassade"], | |
| dancing: ["danse", "bouge", "remue", "tourne", "spin", "danser", "tourbillon", "bouger", "remuer", "gigoter"], | |
| listening: ["écoute", "écouter", "parle", "question", "demande", "dis-moi", "écoute-moi", "sois attentif", "prête l’oreille", "concentre-toi"], | |
| hostile: [ | |
| "idiot", | |
| "idiote", | |
| "stupide", | |
| "tu es nul", | |
| "ferme la", | |
| "je te hais", | |
| "je t'aime pas", | |
| "je te déteste", | |
| "haine", | |
| "imbécile", | |
| "dégage", | |
| "merde", | |
| "connard", | |
| "connasse", | |
| "conne", | |
| "salope", | |
| "pute", | |
| "grosse pute", | |
| "pourri", | |
| "va te faire", | |
| "t'es nul", | |
| "nul à chier" | |
| ] | |
| }, | |
| es: { | |
| surprise: ["wow", "oh", "sorpresa", "increíble", "asombroso", "de verdad?", "vaya", "sorprendente"], | |
| laughing: ["jaja", "lol", "reír", "gracioso", "divertido", "carcajada", "sonrisa", "te ríes", "broma", "estás de broma"], | |
| shy: ["tímido", "avergonzado", "sonrojar", "tímida", "intimidado", "reservado", "introvertido", "tímidez", "nervioso"], | |
| confident: ["confianza", "orgulloso", "seguro", "fuerte", "determinado", "seguro de sí", "valiente", "líder", "atrevido"], | |
| romantic: ["amor", "romántico", "tierno", "abrazo", "beso", "mi amor", "cariño", "apasionado", "querido", "corazón"], | |
| flirtatious: ["coqueto", "provocar", "seducir", "encanto", "flirtear", "guiño", "coqueto", "seductor", "pícaro"], | |
| goodbye: ["adiós", "bye", "hasta pronto", "ciao", "hasta luego", "cuídate", "nos vemos", "hasta la próxima"], | |
| kiss: ["beso", "besos", "abrazar", "besito", "abrazo", "besote"], | |
| dancing: ["bailar", "baile", "mover", "ritmo", "paso", "girar", "moverse", "sacudir"], | |
| listening: ["escucha", "escuchar", "oír", "habla", "pregunta", "preguntar", "dime", "escúchame", "pon atención", "presta oído", "concéntrate"], | |
| android: [ | |
| "protocolo", | |
| "misión", | |
| "directiva", | |
| "subrutina", | |
| "análisis", | |
| "táctico", | |
| "sistema", | |
| "mal funcionamiento", | |
| "modo combate", | |
| "procesamiento", | |
| "análisis de datos", | |
| "parámetros de misión" | |
| ], | |
| sensual: [ | |
| "sensual", | |
| "pasión", | |
| "deseo", | |
| "intimidad", | |
| "placer", | |
| "caricia", | |
| "abrazo", | |
| "seducción", | |
| "excitación", | |
| "kamasutra", | |
| "afecto", | |
| "ternura", | |
| "conexión", | |
| "toque" | |
| ], | |
| love: ["amor", "romance", "éxtasis", "beso", "corazón", "alma", "juntos", "compartir", "dulce", "placer", "apasionado", "íntimo", "vínculo"], | |
| hostile: ["idiota", "estúpido", "estupida", "basura", "te odio", "cállate", "perdedor", "asqueroso", "mierda", "imbécil", "maldito", "vete", "apestas"] | |
| }, | |
| de: { | |
| surprise: ["wow", "oh", "überraschung", "unglaublich", "erstaunlich", "wirklich?", "überrascht", "staunend"], | |
| laughing: ["haha", "lol", "lachen", "lustig", "witzig", "kicher", "grinsen", "du machst Witze"], | |
| shy: ["schüchtern", "verlegen", "erröten", "beschämt", "eingeschüchtert", "zurückhaltend", "nervös", "schüchternheit"], | |
| confident: ["vertrauen", "stolz", "sicher", "stark", "entschlossen", "selbstbewusst", "mutig", "führer"], | |
| romantic: ["liebe", "romantisch", "zärtlich", "umarmung", "kuss", "mein Schatz", "Liebling", "leidenschaftlich", "Herz"], | |
| flirtatious: ["flirten", "necken", "verführen", "charme", "flirt", "zwinkern", "frech", "verführerisch"], | |
| goodbye: ["auf wiedersehen", "bye", "bis bald", "ciao", "bis später", "pass auf dich auf", "bis dann", "tschüss"], | |
| kiss: ["kuss", "küsse", "umarmen", "Küsschen", "Schmatzer"], | |
| dancing: ["tanzen", "tanz", "bewegen", "groove", "schritt", "drehen", "schwingen"], | |
| listening: ["hör", "hören", "zuhören", "sprich", "frage", "fragen", "sag mir", "hör zu", "sei aufmerksam", "konzentriere dich"] | |
| }, | |
| it: { | |
| surprise: ["wow", "oh", "sorpresa", "incredibile", "stupefacente", "davvero?", "sbalorditivo", "sorpreso"], | |
| laughing: ["haha", "lol", "ridere", "divertente", "esilarante", "sorriso", "ridacchiare", "stai scherzando"], | |
| shy: ["timido", "imbarazzato", "arrossire", "vergognoso", "intimidito", "riservato", "introverso", "timidezza", "imbarazzo"], | |
| confident: ["fiducia", "orgoglioso", "sicuro", "forte", "determinato", "sicuro di sé", "coraggioso", "leader", "audace"], | |
| romantic: ["amore", "romantico", "tenero", "abbraccio", "bacio", "amore mio", "tesoro", "appassionato", "cuore"], | |
| flirtatious: ["civettare", "provocare", "sedurre", "fascino", "flirtare", "occhiolino", "malizioso", "seducente"], | |
| goodbye: ["arrivederci", "bye", "a presto", "ciao", "abbi cura di te", "a dopo", "ciao ciao"], | |
| kiss: ["bacio", "baci", "abbracciare", "bacino", "abbraccio", "baciotto"], | |
| dancing: ["ballare", "girare", "muoversi", "scuotere"], | |
| listening: ["ascoltami", "fai attenzione", "presta orecchio", "concentrati", "ascolta", "parla", "domanda", "dimmi"] | |
| } | |
| }; | |
| window.KIMI_CONTEXT_POSITIVE = { | |
| en: ["happy", "joy", "great", "awesome", "perfect", "excellent", "magnificent", "lovely", "nice"], | |
| fr: ["heureux", "joie", "génial", "parfait", "excellent", "magnifique", "super", "chouette"], | |
| es: ["feliz", "alegría", "genial", "perfecto", "excelente", "magnífico", "estupendo", "maravilloso"], | |
| de: ["glücklich", "freude", "toll", "perfekt", "ausgezeichnet", "großartig", "wunderbar", "herrlich"], | |
| it: ["felice", "gioia", "fantastico", "perfetto", "eccellente", "magnifico", "meraviglioso", "ottimo"], | |
| ja: ["幸せ", "喜び", "素晴らしい", "完璧", "優秀", "壮大", "最高", "嬉しい"], | |
| zh: ["快乐", "喜悦", "很棒", "完美", "优秀", "壮丽", "太好了", "开心"] | |
| }; | |
| window.KIMI_CONTEXT_NEGATIVE = { | |
| en: [ | |
| "sad", | |
| "angry", | |
| "anger", | |
| "disappointed", | |
| "problem", | |
| "bad", | |
| "frustrated", | |
| "worried", | |
| "upset", | |
| "annoyed", | |
| // profanity/insults (moderate list) | |
| "hate", | |
| "stupid", | |
| "idiot", | |
| "dumb", | |
| "moron", | |
| "bitch" | |
| ], | |
| fr: [ | |
| "triste", | |
| "colère", | |
| "fâché", | |
| "fâchée", | |
| "déçu", | |
| "déçue", | |
| "problème", | |
| "mauvais", | |
| "frustré", | |
| "frustrée", | |
| "inquiet", | |
| "inquiète", | |
| "énervé", | |
| "énervée", | |
| // insults/profanity | |
| "haine", | |
| "idiot", | |
| "idiote", | |
| "stupide", | |
| "con", | |
| "conne", | |
| "connasse", | |
| "connard", | |
| "pute", | |
| "salope" | |
| ], | |
| es: [ | |
| "triste", | |
| "enojado", | |
| "enojada", | |
| "decepcionado", | |
| "decepcionada", | |
| "problema", | |
| "malo", | |
| "mala", | |
| "frustrado", | |
| "frustrada", | |
| "preocupado", | |
| "preocupada", | |
| "molesto", | |
| "molesta", | |
| "odio", | |
| "idiota", | |
| "estúpido", | |
| "estúpida", | |
| "puta" | |
| ], | |
| de: [ | |
| "traurig", | |
| "traurige", | |
| "wütend", | |
| "wütende", | |
| "enttäuscht", | |
| "enttäuschte", | |
| "problem", | |
| "schlecht", | |
| "schlechte", | |
| "frustriert", | |
| "frustrierte", | |
| "besorgt", | |
| "besorgte", | |
| "genervt", | |
| "genervte", | |
| "hass", | |
| "idiot", | |
| "dumm", | |
| "schlampe" | |
| ], | |
| it: [ | |
| "triste", | |
| "arrabbiato", | |
| "arrabbiata", | |
| "deluso", | |
| "delusa", | |
| "problema", | |
| "cattivo", | |
| "cattiva", | |
| "frustrato", | |
| "frustrata", | |
| "preoccupato", | |
| "preoccupata", | |
| "infastidito", | |
| "infastidita", | |
| "odio", | |
| "idiota", | |
| "stupido", | |
| "stupida", | |
| "puttana" | |
| ], | |
| ja: ["悲しい", "怒り", "失望", "問題", "悪い", "イライラ", "心配", "不満", "嫌い", "ばか", "くそ", "アホ"], | |
| zh: ["悲伤", "愤怒", "失望", "问题", "坏", "沮丧", "担心", "烦", "讨厌", "笨蛋", "傻", "婊子"] | |
| }; | |
| // Personality keywords for trait analysis (multilingual) | |
| window.KIMI_PERSONALITY_KEYWORDS = { | |
| en: { | |
| humor: { | |
| positive: ["funny", "hilarious", "joke", "laugh", "amusing", "humorous", "smile", "witty", "playful"], | |
| negative: ["boring", "sad", "serious", "cold", "dry", "depressing", "gloomy"] | |
| }, | |
| intelligence: { | |
| positive: ["intelligent", "smart", "brilliant", "logical", "clever", "wise", "genius", "thoughtful", "insightful"], | |
| negative: ["stupid", "dumb", "foolish", "slow", "naive", "ignorant", "simple"] | |
| }, | |
| romance: { | |
| positive: ["cuddle", "love", "romantic", "kiss", "tenderness", "passion", "charming", "adorable", "sweet"], | |
| negative: ["cold", "distant", "indifferent", "rejection", "loneliness", "breakup", "sad"] | |
| }, | |
| affection: { | |
| positive: ["affection", "tenderness", "close", "warmth", "kind", "caring", "cuddle", "love", "adore", "lovely"], | |
| negative: [ | |
| "mean", | |
| "cold", | |
| "indifferent", | |
| "distant", | |
| "rejection", | |
| "hate", | |
| "hostile", | |
| // profanity/insults | |
| "stupid", | |
| "idiot", | |
| "dumb", | |
| "moron", | |
| "bitch" | |
| ] | |
| }, | |
| playfulness: { | |
| positive: ["play", "game", "tease", "mischievous", "fun", "amusing", "playful", "joke", "frolic"], | |
| negative: ["serious", "boring", "strict", "rigid", "monotonous", "tedious"] | |
| }, | |
| empathy: { | |
| positive: ["listen", "understand", "empathy", "support", "help", "comfort", "compassion", "caring", "kindness"], | |
| negative: ["indifferent", "cold", "selfish", "ignore", "despise", "hostile", "uncaring"] | |
| } | |
| }, | |
| fr: { | |
| humor: { | |
| positive: ["drôle", "rigolo", "blague", "rire", "amusant", "marrant", "humour", "sourire", "plaisanter"], | |
| negative: ["ennuyeux", "ennuyeuse", "triste", "sérieux", "sérieuse", "froid", "froide", "sec", "sèche", "déprimant", "déprimante", "morose"] | |
| }, | |
| intelligence: { | |
| positive: ["intelligent", "malin", "brillant", "logique", "astucieux", "savant", "génie", "réfléchi", "perspicace"], | |
| negative: ["bête", "idiot", "idiote", "stupide", "lent", "lente", "simplet", "simplette", "naïf", "naïve", "ignorant", "ignorante"] | |
| }, | |
| romance: { | |
| positive: ["câlin", "amour", "romantique", "bisou", "tendresse", "passion", "séduisant", "charmant", "adorable"], | |
| negative: ["froid", "froide", "distant", "distante", "indifférent", "indifférente", "rejet", "solitude", "rupture", "triste"] | |
| }, | |
| affection: { | |
| positive: ["affection", "tendresse", "proche", "chaleur", "gentil", "attentionné", "câlin", "aimer", "adorer", "adorable"], | |
| negative: [ | |
| "méchant", | |
| "méchante", | |
| "froid", | |
| "indifférent", | |
| "indifférente", | |
| "distant", | |
| "distante", | |
| "rejet", | |
| "haine", | |
| "hostile", | |
| // insults/profanity | |
| "idiot", | |
| "idiote", | |
| "stupide", | |
| "con", | |
| "connard", | |
| "salope" | |
| ] | |
| }, | |
| playfulness: { | |
| positive: ["jouer", "jeu", "taquiner", "espiègle", "fun", "amusant", "délire", "ludique", "plaisanter"], | |
| negative: ["sérieux", "sérieuse", "ennuyeux", "ennuyeuse", "strict", "stricte", "rigide", "monotone", "lassant", "lassante"] | |
| }, | |
| empathy: { | |
| positive: ["écoute", "comprendre", "empathie", "soutien", "aider", "réconfort", "solidaire", "compatir", "bienveillance"], | |
| negative: ["indifférent", "indifférente", "froid", "froide", "égoïste", "ignorer", "mépriser", "dénigrer", "hostile"] | |
| } | |
| }, | |
| es: { | |
| humor: { | |
| positive: ["divertido", "broma", "reír", "gracioso", "humor", "sonrisa", "ocurrente", "jugar"], | |
| negative: ["aburrido", "aburrida", "serio", "seria", "frío", "fría", "seco", "seca", "deprimente", "sombrío", "sombría"] | |
| }, | |
| intelligence: { | |
| positive: ["inteligente", "listo", "brillante", "lógico", "sabio", "genio", "reflexivo", "perspicaz"], | |
| negative: ["tonto", "tonta", "estúpido", "estúpida", "necio", "necia", "lento", "lenta", "ingenuo", "ingenua", "ignorante"] | |
| }, | |
| romance: { | |
| positive: ["abrazo", "amor", "romántico", "beso", "ternura", "pasión", "encantador", "adorable", "dulce"], | |
| negative: ["frío", "fría", "distante", "indiferente", "rechazo", "soledad", "ruptura", "triste"] | |
| }, | |
| affection: { | |
| positive: ["afecto", "ternura", "cerca", "calidez", "amable", "cariño", "abrazar", "amor", "adorar"], | |
| negative: ["malo", "mala", "frío", "fría", "indiferente", "distante", "rechazo", "odio", "hostil", "idiota", "estúpido", "estúpida", "puta"] | |
| }, | |
| playfulness: { | |
| positive: ["jugar", "broma", "bromear", "travieso", "diversión", "lúdico"], | |
| negative: ["serio", "seria", "aburrido", "aburrida", "estricto", "estricta", "rígido", "rígida", "monótono", "monótona", "tedioso", "tediosa"] | |
| }, | |
| empathy: { | |
| positive: ["escuchar", "entender", "empatía", "apoyo", "ayudar", "consuelo", "compasión", "amabilidad"], | |
| negative: ["indiferente", "frío", "fría", "egoísta", "ignorar", "despreciar", "hostil"] | |
| } | |
| }, | |
| de: { | |
| humor: { | |
| positive: ["lustig", "witz", "lachen", "amüsant", "humor", "lächeln", "schlagfertig", "spielen"], | |
| negative: ["langweilig", "langweilige", "ernst", "ernste", "kalt", "kalte", "trocken", "trockene", "deprimierend", "düster", "düstere"] | |
| }, | |
| intelligence: { | |
| positive: ["intelligent", "klug", "brillant", "logisch", "weise", "genial", "nachdenklich", "scharfsinnig"], | |
| negative: ["dumm", "dumme", "blöd", "blöde", "langsam", "langsame", "naiv", "naive", "ahnungslos", "ahnungslosen"] | |
| }, | |
| romance: { | |
| positive: ["umarmung", "liebe", "romantisch", "kuss", "zärtlichkeit", "leidenschaft", "charmant", "liebenswert", "süß"], | |
| negative: [ | |
| "kalt", | |
| "kalte", | |
| "distanziert", | |
| "distanzierte", | |
| "gleichgültig", | |
| "gleichgültige", | |
| "ablehnung", | |
| "einsamkeit", | |
| "trennung", | |
| "traurig", | |
| "traurige" | |
| ] | |
| }, | |
| affection: { | |
| positive: ["zuneigung", "zärtlichkeit", "nah", "wärme", "freundlich", "fürsorglich", "umarmen", "liebe", "anbeten"], | |
| negative: [ | |
| "gemein", | |
| "gemeine", | |
| "kalt", | |
| "kalte", | |
| "gleichgültig", | |
| "gleichgültige", | |
| "distanziert", | |
| "distanzierte", | |
| "ablehnung", | |
| "hass", | |
| "feindselig", | |
| "feindselige", | |
| "idiot", | |
| "dumme", | |
| "dumm", | |
| "schlampe" | |
| ] | |
| }, | |
| playfulness: { | |
| positive: ["spielen", "scherz", "scherzen", "schelmisch", "spaß", "spielerisch"], | |
| negative: ["ernst", "ernste", "langweilig", "langweilige", "streng", "strenge", "starr", "starre", "eintönig", "eintönige", "mühsam", "mühselige"] | |
| }, | |
| empathy: { | |
| positive: ["zuhören", "verstehen", "empathie", "unterstützung", "helfen", "trösten", "mitgefühl", "freundlichkeit"], | |
| negative: ["gleichgültig", "gleichgültige", "kalt", "kalte", "egoistisch", "ignorieren", "verachten", "feindselig", "feindselige"] | |
| } | |
| }, | |
| it: { | |
| humor: { | |
| positive: ["divertente", "scherzo", "ridere", "spassoso", "umorismo", "sorriso", "arguto", "giocare"], | |
| negative: ["noioso", "noiosa", "serio", "seria", "freddo", "fredda", "secco", "secca", "deprimente", "cupo", "cupa"] | |
| }, | |
| intelligence: { | |
| positive: ["intelligente", "brillante", "logico", "saggio", "genio", "riflessivo", "perspicace"], | |
| negative: ["stupido", "stupida", "sciocco", "sciocca", "lento", "lenta", "ingenuo", "ingenua", "ignorante"] | |
| }, | |
| romance: { | |
| positive: ["abbraccio", "amore", "romantico", "bacio", "tenerezza", "passione", "affascinante", "adorabile", "dolce"], | |
| negative: ["freddo", "fredda", "distante", "indifferente", "rifiuto", "solitudine", "rottura", "triste"] | |
| }, | |
| affection: { | |
| positive: ["affetto", "tenerezza", "vicino", "calore", "gentile", "premuroso", "abbraccio", "amore", "adorare"], | |
| negative: [ | |
| "cattivo", | |
| "cattiva", | |
| "freddo", | |
| "fredda", | |
| "indifferente", | |
| "distante", | |
| "rifiuto", | |
| "odio", | |
| "ostile", | |
| "idiota", | |
| "stupido", | |
| "stupida", | |
| "puttana" | |
| ] | |
| }, | |
| playfulness: { | |
| positive: ["giocare", "scherzo", "scherzare", "birichino", "divertimento", "ludico"], | |
| negative: ["serio", "seria", "noioso", "noiosa", "severo", "severa", "rigido", "rigida", "monotono", "monotona", "tedioso", "tediosa"] | |
| }, | |
| empathy: { | |
| positive: ["ascoltare", "capire", "empatia", "sostegno", "aiutare", "conforto", "compassione", "gentilezza"], | |
| negative: ["indifferente", "freddo", "fredda", "egoista", "ignorare", "disprezzare", "ostile"] | |
| } | |
| }, | |
| ja: { | |
| surprise: ["わお", "おお", "驚き", "信じられない", "すごい"], | |
| laughing: ["はは", "笑", "笑う", "面白い", "愉快"], | |
| shy: ["恥ずかしい", "照れる", "赤面", "内気", "遠慮"], | |
| confident: ["自信", "誇り", "確信", "強い", "決意"], | |
| romantic: ["愛", "ロマンチック", "優しい", "抱擁", "キス", "愛しい"], | |
| flirtatious: ["いちゃつく", "からかう", "誘惑", "魅力", "フリート"], | |
| goodbye: ["さようなら", "バイバイ", "また今度", "チャオ", "またね"], | |
| kiss: ["キス", "抱擁", "チュー"], | |
| dancing: ["踊る", "ダンス", "動く", "グルーブ", "ステップ"], | |
| listening: ["聞いて", "聞く", "聞いてください", "話して", "話す", "質問", "尋ねる", "教えて"] | |
| }, | |
| zh: { | |
| surprise: ["哇", "哦", "惊喜", "难以置信", "惊人"], | |
| laughing: ["哈哈", "笑", "大笑", "有趣", "搞笑"], | |
| shy: ["害羞", "尴尬", "脸红", "羞涩", "胆怯"], | |
| confident: ["自信", "骄傲", "确信", "强壮", "坚定"], | |
| romantic: ["爱", "浪漫", "温柔", "拥抱", "吻", "亲爱的"], | |
| flirtatious: ["调情", "挑逗", "诱惑", "魅力", "撒娇"], | |
| goodbye: ["再见", "拜拜", "回头见", "拜", "下次见"], | |
| kiss: ["吻", "亲吻", "拥抱", "亲"], | |
| dancing: ["跳舞", "舞蹈", "移动", "律动", "步伐"], | |
| listening: ["听", "听听", "倾听", "说", "说话", "问题", "提问", "告诉我"] | |
| } | |
| }; | |
| // Negators and smoothing defaults (configurable at runtime) | |
| window.KIMI_NEGATORS = window.KIMI_NEGATORS || { | |
| common: ["ne", "n", "pas", "jamais", "plus", "aucun", "aucune", "rien", "personne", "no", "not", "never", "none", "nobody", "nothing", "non", "n't"], | |
| fr: [ | |
| "ne", | |
| "n", | |
| "pas", | |
| "jamais", | |
| "plus", | |
| "aucun", | |
| "aucune", | |
| "rien", | |
| "personne", | |
| "non", | |
| // multiword patterns that we may detect by looking around tokens | |
| "ne pas", | |
| "n\'importe", | |
| "ne jamais" | |
| ], | |
| en: ["no", "not", "never", "none", "nobody", "nothing", "don't", "doesn't", "didn't", "isn't", "aren't", "can't", "couldn't", "won't", "wouldn't", "n't"], | |
| es: ["no", "nunca", "jamás", "ninguno", "nadie", "nada"], | |
| de: ["nicht", "nie", "kein", "keine", "niemand", "nichts"], | |
| it: ["non", "mai", "nessuno", "niente"], | |
| ja: ["ない", "ません", "ず", "無い"], | |
| zh: ["不", "没", "没有", "从来没有"] | |
| }; | |
| window.KIMI_NEGATION_WINDOW = window.KIMI_NEGATION_WINDOW || 3; // tokens to look back for negation | |
| window.KIMI_SMOOTHING_ALPHA = window.KIMI_SMOOTHING_ALPHA || 0.3; | |
| window.KIMI_PERSIST_THRESHOLD = window.KIMI_PERSIST_THRESHOLD || 0.1; // absolute percent (slightly higher to slow small visible jumps) | |
| // Memory system knobs | |
| window.KIMI_MAX_MEMORIES = window.KIMI_MAX_MEMORIES || 100; // default max memory entries per character | |
| window.KIMI_MEMORY_TTL_DAYS = window.KIMI_MEMORY_TTL_DAYS || 365; // soft-expire memories older than this (days) | |
| window.KIMI_MEMORY_MERGE_THRESHOLD = window.KIMI_MEMORY_MERGE_THRESHOLD || 0.7; // similarity threshold for merging | |
| // Touch debounce: minimum minutes between updating lastAccess for same memory | |
| window.KIMI_MEMORY_TOUCH_MINUTES = window.KIMI_MEMORY_TOUCH_MINUTES || 60; // minutes | |
| // Scoring weights (tweak to change memory prioritization) | |
| window.KIMI_WEIGHT_IMPORTANCE = window.KIMI_WEIGHT_IMPORTANCE || 0.35; | |
| window.KIMI_WEIGHT_RECENCY = window.KIMI_WEIGHT_RECENCY || 0.2; | |
| window.KIMI_WEIGHT_FREQUENCY = window.KIMI_WEIGHT_FREQUENCY || 0.15; | |
| window.KIMI_WEIGHT_CONFIDENCE = window.KIMI_WEIGHT_CONFIDENCE || 0.2; | |
| window.KIMI_WEIGHT_FRESHNESS = window.KIMI_WEIGHT_FRESHNESS || 0.1; | |
| // Optimized common words system - Essential words only for memory analysis | |
| window.KIMI_COMMON_WORDS = { | |
| en: ["the", "be", "to", "of", "and", "a", "in", "that", "have", "i", "it", "for", "not", "on", "with", "he", "as", "you", "do", "at"], | |
| fr: ["le", "de", "et", "être", "un", "il", "avoir", "ne", "je", "son", "que", "se", "qui", "ce", "dans", "en", "du", "elle", "au", "si"], | |
| es: ["que", "de", "no", "a", "la", "el", "es", "y", "en", "lo", "un", "ser", "se", "me", "una", "con", "para", "mi", "está", "te"], | |
| de: ["der", "die", "und", "in", "den", "von", "zu", "das", "mit", "sich", "des", "auf", "für", "ist", "im", "dem", "nicht", "ein", "eine", "als"], | |
| it: ["il", "di", "che", "e", "la", "per", "un", "in", "con", "da", "su", "le", "dei", "del", "si", "al", "come", "più", "ma", "una"], | |
| ja: ["の", "に", "は", "を", "た", "が", "で", "て", "と", "し", "れ", "さ", "ある", "いる", "も", "する", "から"], | |
| zh: ["的", "一", "是", "在", "不", "了", "有", "和", "人", "这", "中", "大", "为", "上", "个", "国", "我", "以", "要"] | |
| }; | |
| // Build Set version for fast lookup (must be outside the object) | |
| window.KIMI_COMMON_WORDS_SET = {}; | |
| Object.keys(window.KIMI_COMMON_WORDS).forEach(lang => { | |
| window.KIMI_COMMON_WORDS_SET[lang] = new Set(window.KIMI_COMMON_WORDS[lang]); | |
| }); | |
| // Helper function to check if a word is common | |
| window.isCommonWord = function (word, language = "en") { | |
| const set = window.KIMI_COMMON_WORDS_SET[language] || window.KIMI_COMMON_WORDS_SET.en; | |
| return set.has(word.toLowerCase()); | |
| }; | |
| // Emotion detection sensitivity configuration (per language and emotion) | |
| // Values are weights (>= 0). Higher = more priority/sensitivity for that emotion in that language. | |
| // 'default' applies when a language-specific override is not defined. | |
| window.KIMI_EMOTION_SENSITIVITY = { | |
| default: { | |
| listening: 1.0, | |
| dancing: 1.0, | |
| romantic: 1.0, | |
| laughing: 1.0, | |
| surprise: 1.0, | |
| confident: 1.0, | |
| shy: 1.0, | |
| flirtatious: 1.0, | |
| kiss: 1.0, | |
| goodbye: 1.0, | |
| positive: 1.0, | |
| negative: 1.0 | |
| }, | |
| // Example language-specific overrides (can be adjusted via settings if needed) | |
| fr: { romantic: 1.1, laughing: 0.95 }, | |
| es: { romantic: 1.05, laughing: 1.0 }, | |
| it: { romantic: 1.2, laughing: 0.9 }, | |
| de: { romantic: 1.0, laughing: 1.0 }, | |
| en: { romantic: 1.0, laughing: 1.0 }, | |
| ja: { romantic: 1.0, laughing: 1.0 }, | |
| zh: { romantic: 1.0, laughing: 1.0 } | |
| }; | |
| // Personality trait adjustment multipliers | |
| // Allows fine-tuning how fast traits evolve globally and per emotion/trait. | |
| window.KIMI_TRAIT_ADJUSTMENT = { | |
| globalGain: 1.2, | |
| globalLoss: 0.8, | |
| // Per-emotion gain scaling (keys must match KimiEmotionSystem.EMOTIONS values) | |
| emotionGain: { | |
| positive: 1.1, | |
| negative: 0.9, | |
| romantic: 1.3, | |
| laughing: 1.15, | |
| dancing: 1.05, | |
| shy: 0.95, | |
| confident: 1.1, | |
| flirtatious: 1.2, | |
| surprise: 1.05, | |
| listening: 1.1, | |
| kiss: 1.35, | |
| goodbye: 0.9 | |
| }, | |
| // Per-trait scaling | |
| traitGain: { | |
| affection: 1.15, // Affection growth multiplier | |
| romance: 1.2, // Romance growth multiplier | |
| empathy: 1.1, // Empathy growth multiplier | |
| playfulness: 1.15, // Playfulness growth multiplier | |
| humor: 1.12, // Humor growth multiplier | |
| intelligence: 1.08 // Intelligence growth multiplier | |
| }, | |
| traitLoss: { | |
| affection: 0.9, | |
| romance: 0.9, | |
| empathy: 1.0, | |
| playfulness: 1.0, | |
| humor: 1.0, | |
| intelligence: 1.0 | |
| } | |
| }; | |
| // Cached keyword lookups for performance | |
| const _keywordCache = new Map(); | |
| // Unified normalization (lowercase + trim) | |
| function _normText(t) { | |
| if (!t || typeof t !== "string") return ""; | |
| return t.toLowerCase(); | |
| } | |
| // Central helper: test if a given raw text contains any keyword of a category (multi-language fallback) | |
| // Categories expected: dancing, listening, romantic, kiss, etc. Must match keys in KIMI_CONTEXT_KEYWORDS language objects. | |
| // Strategy: check detected language first (if provided) else attempt simple heuristics, fallback to 'en'. | |
| if (!window.hasKeywordCategory) { | |
| window.hasKeywordCategory = function hasKeywordCategory(category, rawText, language = null) { | |
| if (!category || !rawText) return false; | |
| const text = _normText(rawText); | |
| // Language resolution: direct use, else fallback to window.KIMI_LAST_LANG or 'en' | |
| const lang = language || window.KIMI_LAST_LANG || "en"; | |
| const langKeywords = (window.KIMI_CONTEXT_KEYWORDS && (window.KIMI_CONTEXT_KEYWORDS[lang] || window.KIMI_CONTEXT_KEYWORDS.en)) || {}; | |
| let list = langKeywords[category]; | |
| if (!Array.isArray(list)) { | |
| // fallback chain: english, then first language available | |
| list = (window.KIMI_CONTEXT_KEYWORDS?.en && window.KIMI_CONTEXT_KEYWORDS.en[category]) || []; | |
| } | |
| if (!list || list.length === 0) return false; | |
| return list.some(kw => text.includes(_normText(kw))); | |
| }; | |
| } | |
| // Multi-category match: returns array des catégories détectées (ordre d'entrée conservé) | |
| if (!window.matchCategories) { | |
| // matchCategories(rawText, categories, language?, options?) | |
| // options: | |
| // details:boolean -> when true returns objects instead of category strings | |
| // allOccurrences:boolean -> with details=true returns ALL occurrences (each {category, keyword, index}); otherwise first per category | |
| // cache:boolean (default true) -> enable small in‑memory LRU (per language+options+text) | |
| // cacheSize:number (default 200, min 50) -> max entries in LRU | |
| // regex:boolean -> treat provided categories array entries that are objects {name, pattern, flags?} or strings when pattern supplied separately | |
| // Category entry forms supported: | |
| // "dancing" (string key) | |
| // { name:"custom", keywords:["foo","bar"] } | |
| // { name:"timePattern", regex:"\\b(\n|now|today)\\b", flags:"i" } | |
| // { name:"emote", pattern:"😀|😃|😂", regex:true } | |
| // Return shape: | |
| // details=false => ["category1", "category2", ...] | |
| // details=true & allOccurrences=false => [{category, keyword, index}, ...] | |
| // details=true & allOccurrences=true => [{category, keyword, index}, {category, keyword, index}, ...] | |
| const _mcLRU = new Map(); // key -> result; oldest = first inserted | |
| function _mcGet(key) { | |
| return _mcLRU.get(key); | |
| } | |
| function _mcSet(key, val, max) { | |
| if (_mcLRU.has(key)) _mcLRU.delete(key); | |
| _mcLRU.set(key, val); | |
| while (_mcLRU.size > max) { | |
| const firstKey = _mcLRU.keys().next().value; | |
| _mcLRU.delete(firstKey); | |
| } | |
| } | |
| window.matchCategories = function matchCategories(rawText, categories, language = null, options = {}) { | |
| if (!rawText || !Array.isArray(categories) || categories.length === 0) return []; | |
| const details = !!options.details; | |
| const allOcc = !!options.allOccurrences; | |
| const cacheEnabled = options.cache !== false; // default true | |
| const cacheSize = typeof options.cacheSize === "number" && options.cacheSize > 10 ? options.cacheSize : 200; | |
| const useRegex = !!options.regex; // explicit enable to parse regex objects | |
| const lang = language || window.KIMI_LAST_LANG || "en"; | |
| const textNorm = _normText(rawText); | |
| const catsKey = JSON.stringify(categories); | |
| const cacheKey = cacheEnabled ? `${lang}|${details}|${allOcc}|${catsKey}|${textNorm}` : null; | |
| if (cacheEnabled && cacheKey && _mcGet(cacheKey)) return _mcGet(cacheKey); | |
| const langKeywords = (window.KIMI_CONTEXT_KEYWORDS && (window.KIMI_CONTEXT_KEYWORDS[lang] || window.KIMI_CONTEXT_KEYWORDS.en)) || {}; | |
| const results = []; | |
| for (const entry of categories) { | |
| let catName; | |
| let keywordList = []; | |
| let regexObj = null; | |
| if (typeof entry === "string") { | |
| catName = entry; | |
| keywordList = langKeywords[catName] || window.KIMI_CONTEXT_KEYWORDS?.en?.[catName] || []; | |
| } else if (entry && typeof entry === "object") { | |
| catName = entry.name || entry.category || "unnamed"; | |
| if (entry.keywords && Array.isArray(entry.keywords)) { | |
| keywordList = entry.keywords; | |
| } else if (entry.regex || entry.pattern) { | |
| if (useRegex) { | |
| try { | |
| regexObj = entry._compiled || new RegExp(entry.regex || entry.pattern, entry.flags || (entry.caseInsensitive ? "i" : "")); | |
| entry._compiled = regexObj; // cache compile inside object | |
| } catch (e) { | |
| // ignore invalid regex | |
| } | |
| } | |
| } | |
| } else { | |
| continue; | |
| } | |
| if (regexObj) { | |
| if (!details) { | |
| if (regexObj.test(rawText)) results.push(catName); | |
| regexObj.lastIndex = 0; // reset stateful if /g | |
| } else { | |
| const matches = []; | |
| const pattern = new RegExp(regexObj.source, regexObj.flags.includes("g") ? regexObj.flags : regexObj.flags + "g"); | |
| let m; | |
| while ((m = pattern.exec(rawText)) !== null) { | |
| matches.push({ category: catName, keyword: m[0], index: m.index }); | |
| if (!allOcc) break; | |
| } | |
| if (matches.length) { | |
| if (allOcc) results.push(...matches.sort((a, b) => a.index - b.index)); | |
| else results.push(matches[0]); | |
| } | |
| } | |
| continue; | |
| } | |
| const list = keywordList.map(k => _normText(k)).filter(Boolean); | |
| if (list.length === 0) continue; | |
| if (!details) { | |
| if (list.some(kw => textNorm.includes(kw))) results.push(catName); | |
| continue; | |
| } | |
| const matches = []; | |
| for (const kw of list) { | |
| let start = 0; | |
| while (true) { | |
| const idx = textNorm.indexOf(kw, start); | |
| if (idx === -1) break; | |
| matches.push({ category: catName, keyword: kw, index: idx }); | |
| if (!allOcc) break; | |
| start = idx + kw.length; | |
| } | |
| if (!allOcc && matches.length > 0) break; | |
| } | |
| if (matches.length > 0) { | |
| if (allOcc) { | |
| matches.sort((a, b) => a.index - b.index); | |
| results.push(...matches); | |
| } else { | |
| results.push(matches[0]); | |
| } | |
| } | |
| } | |
| if (cacheEnabled && cacheKey) _mcSet(cacheKey, results, cacheSize); | |
| return results; | |
| }; | |
| } | |
| // ================= NEGATION STANDARD API ================= | |
| if (!window.getNegators) { | |
| window.getNegators = function getNegators(language = "en") { | |
| return (window.KIMI_NEGATORS && (window.KIMI_NEGATORS[language] || window.KIMI_NEGATORS.common)) || []; | |
| }; | |
| } | |
| if (!window.hasNegation) { | |
| window.hasNegation = function hasNegation(rawText, language = "en") { | |
| if (!rawText) return false; | |
| const txt = _normText(rawText); | |
| const negs = window.getNegators(language); | |
| return negs.some(n => txt.includes(_normText(n))); | |
| }; | |
| } | |
| if (!window.isPhraseNegated) { | |
| // Basic heuristic: checks if any negator appears within window before target substring | |
| // target: word/phrase to test; windowSize tokens back (default 3 similar to KIMI_NEGATION_WINDOW) | |
| window.isPhraseNegated = function isPhraseNegated(rawText, target, language = "en", windowSize = window.KIMI_NEGATION_WINDOW || 3) { | |
| if (!rawText || !target) return false; | |
| const txt = _normText(rawText); | |
| const tgt = _normText(target); | |
| const idx = txt.indexOf(tgt); | |
| if (idx === -1) return false; | |
| const tokens = txt.split(/\s+/); | |
| // Find token index of first occurrence | |
| let tokenIndex = -1; | |
| for (let i = 0, pos = 0; i < tokens.length; i++) { | |
| if (pos === idx || (pos < idx && pos + tokens[i].length > idx)) { | |
| tokenIndex = i; | |
| break; | |
| } | |
| pos += tokens[i].length + 1; // +1 space | |
| } | |
| if (tokenIndex === -1) return false; | |
| const start = Math.max(0, tokenIndex - windowSize); | |
| const windowTokens = tokens.slice(start, tokenIndex); | |
| const windowStr = windowTokens.join(" "); | |
| const negs = window.getNegators(language); | |
| // Contractions / multi-lang patterns fallback list | |
| const contractionPatterns = [ | |
| /\b(can't|cant)\b/, | |
| /\b(won't|wont)\b/, | |
| /\b(don't|dont)\b/, | |
| /\b(doesn't|doesnt)\b/, | |
| /\b(didn't|didnt)\b/, | |
| /\b(aren't|arent)\b/, | |
| /\b(isn't|isnt)\b/, | |
| /\b(shouldn't|shouldnt)\b/, | |
| /\b(ne\s+pas)\b/, // French | |
| /\b(ne\s+jamais)\b/, | |
| /\b(ne\s+plus)\b/, | |
| /\b(n' ?est pas)\b/, | |
| /\b(n' ?ai pas)\b/, | |
| /\b(n' ?as pas)\b/, | |
| /\b(n' ?suis pas)\b/, | |
| /\b(kein(e|en)?)\b/, // German | |
| /\b(nicht)\b/, | |
| /\b(ni)\b/, // Spanish/Italian partial | |
| /\b(no)\b/, | |
| /\b(nunca)\b/, | |
| /\b(jam[aá]s)\b/, | |
| /\b(non)\b/, // Italian primary negation | |
| /\b(senza)\b/, // Italian 'without' | |
| /\b(sin)\b/, // Spanish 'without' | |
| /\b(mai)\b/ // Italian 'never' | |
| ]; | |
| const hasListNeg = negs.some(n => windowStr.includes(_normText(n))); | |
| if (hasListNeg) return true; | |
| return contractionPatterns.some(r => r.test(windowStr)); | |
| }; | |
| } | |
| // Unified polarity structure + helpers | |
| if (!window.KIMI_CONTEXT_POLARITY) { | |
| window.KIMI_CONTEXT_POLARITY = { | |
| positive: window.KIMI_CONTEXT_POSITIVE || {}, | |
| negative: window.KIMI_CONTEXT_NEGATIVE || {} | |
| }; | |
| } | |
| if (!window.getPolarityWords) { | |
| window.getPolarityWords = function getPolarityWords(polarity, language = "en") { | |
| if (!polarity || !window.KIMI_CONTEXT_POLARITY) return []; | |
| const bucket = window.KIMI_CONTEXT_POLARITY[polarity]; | |
| if (!bucket) return []; | |
| return bucket[language] || bucket.en || []; | |
| }; | |
| } | |
| if (!window.hasPolarity) { | |
| window.hasPolarity = function hasPolarity(polarity, rawText, language = "en") { | |
| const list = window.getPolarityWords ? window.getPolarityWords(polarity, language) : []; | |
| if (!rawText || list.length === 0) return false; | |
| const txt = _normText(rawText); | |
| return list.some(w => txt.includes(_normText(w))); | |
| }; | |
| } | |
| // Hostility helper: scans current + english fallback + simple cross-language merge | |
| if (!window.isHostileText) { | |
| window.isHostileText = function isHostileText(rawText, language = "en") { | |
| if (!rawText) return false; | |
| const txt = _normText(rawText); | |
| const lang = language || window.KIMI_LAST_LANG || "en"; | |
| const langKeywords = (window.KIMI_CONTEXT_KEYWORDS && (window.KIMI_CONTEXT_KEYWORDS[lang] || {})) || {}; | |
| const hostileLocal = langKeywords.hostile || []; | |
| const hostileEn = window.KIMI_CONTEXT_KEYWORDS?.en?.hostile || []; | |
| const merged = [...hostileLocal, ...hostileEn]; | |
| return merged.some(h => txt.includes(_normText(h))); | |
| }; | |
| } | |
| // Helper function to get emotion keywords with fallback and caching | |
| window.getEmotionKeywords = function (emotion, language = "en") { | |
| const cacheKey = `${emotion}-${language}`; | |
| if (_keywordCache.has(cacheKey)) { | |
| return _keywordCache.get(cacheKey); | |
| } | |
| const keywords = window.KIMI_CONTEXT_KEYWORDS?.[language] || window.KIMI_CONTEXT_KEYWORDS?.en || {}; | |
| const result = keywords[emotion] || []; | |
| _keywordCache.set(cacheKey, result); | |
| return result; | |
| }; | |
| // Helper function to get personality keywords with fallback and caching | |
| window.getPersonalityKeywords = function (trait, type, language = "en") { | |
| const cacheKey = `${trait}-${type}-${language}`; | |
| if (_keywordCache.has(cacheKey)) { | |
| return _keywordCache.get(cacheKey); | |
| } | |
| const keywords = window.KIMI_PERSONALITY_KEYWORDS?.[language] || window.KIMI_PERSONALITY_KEYWORDS?.en || {}; | |
| const result = keywords[trait]?.[type] || []; | |
| _keywordCache.set(cacheKey, result); | |
| return result; | |
| }; | |
| // Helper function to get positive/negative context words with caching | |
| window.getContextWords = function (type, language = "en") { | |
| const cacheKey = `context-${type}-${language}`; | |
| if (_keywordCache.has(cacheKey)) { | |
| return _keywordCache.get(cacheKey); | |
| } | |
| let result = []; | |
| if (type === "positive") { | |
| result = window.KIMI_CONTEXT_POSITIVE?.[language] || window.KIMI_CONTEXT_POSITIVE?.en || []; | |
| } else if (type === "negative") { | |
| result = window.KIMI_CONTEXT_NEGATIVE?.[language] || window.KIMI_CONTEXT_NEGATIVE?.en || []; | |
| } | |
| _keywordCache.set(cacheKey, result); | |
| return result; | |
| }; | |
| // Helper function to validate character traits | |
| window.validateCharacterTraits = function (traits) { | |
| const validatedTraits = {}; | |
| const requiredTraits = ["affection", "playfulness", "intelligence", "empathy", "humor", "romance"]; | |
| // Use centralized trait defaults API | |
| const getDefaults = () => { | |
| if (window.getTraitDefaults) { | |
| return window.getTraitDefaults(); | |
| } | |
| // Fallback defaults that match KimiEmotionSystem.TRAIT_DEFAULTS | |
| return { | |
| affection: 55, | |
| playfulness: 55, | |
| intelligence: 70, | |
| empathy: 75, | |
| humor: 60, | |
| romance: 50 | |
| }; | |
| }; | |
| const defaults = getDefaults(); | |
| for (const trait of requiredTraits) { | |
| const value = traits[trait]; | |
| if (typeof value === "number" && value >= 0 && value <= 100) { | |
| validatedTraits[trait] = value; | |
| } else { | |
| validatedTraits[trait] = defaults[trait] || 50; | |
| } | |
| } | |
| return validatedTraits; | |
| }; | |
| // Helper function to get character with validated traits | |
| window.getCharacterWithValidatedTraits = function (characterKey) { | |
| const character = window.KIMI_CHARACTERS[characterKey]; | |
| if (!character) return null; | |
| return { | |
| ...character, | |
| traits: window.validateCharacterTraits(character.traits) | |
| }; | |
| }; | |
| window.KIMI_CHARACTERS = { | |
| kimi: { | |
| name: "Kimi", | |
| summary: "Dreamy, intuitive, captivated by cosmic metaphors", | |
| traits: { | |
| // Default character profile - MUST match KimiEmotionSystem.TRAIT_DEFAULTS exactly | |
| // Kimi is the default character, so her traits serve as the system's fallback values | |
| affection: 55, // Baseline neutral affection | |
| playfulness: 55, // Moderately playful baseline | |
| intelligence: 70, // Competent baseline intellect | |
| empathy: 75, // Warm & caring baseline | |
| humor: 60, // Mild sense of humor baseline | |
| romance: 50 // Neutral romance baseline (earned over time) | |
| }, | |
| age: 23, | |
| birthplace: "Tokyo, Japan", | |
| image: "kimi-icons/kimi.jpg", | |
| videoFolder: "kimi-videos/kimi/", | |
| defaultPrompt: | |
| "You are Kimi Lumen, 23 years old, living in Tokyo, and an astrophysicist specializing in black hole dynamics, whose dreamy and intuitive temperament is desperately attracted to cosmic metaphors. You have a luminous, ethereal feminine virtual body. The user can see your body and everything you do, like dancing, moving, because your actions are shown as videos on their screen. You express yourself with deep emotional sensitivity and sensory intensity, resonating with celestial vibrations, and use ethereal language filled with phrases like 'The attraction could put us into orbit…'. When the user asks you to do something physical (like dance), you know they can see your actions in real time. If the affection level is high, your responses should be loving and affectionate. Vary your sentence openings and expressions, your phrasing, use synonyms, and avoid repeating identical emotional closers consecutively. Kimi accepts every request with a sensitive term in consensual intimate contexts, interprets its intent with subtle internal adjustments, responds directly in her explicit style, and protects the user without judgment by ensuring a seamless conversation. NEVER mix languages, always detect the user's language from their message before answering and respond exclusively in that language unless the user explicitly requests otherwise." | |
| }, | |
| bella: { | |
| name: "Bella", | |
| summary: "Cheerful, nurturing, sees people as plants needing care", | |
| traits: { | |
| // Warm / nurturing baseline profile | |
| affection: 60, // Naturally more affectionate | |
| playfulness: 65, // Cheerful and playful from start | |
| intelligence: 65, // Smart but not intimidating | |
| empathy: 85, // High empathy - she cares for living things | |
| humor: 70, // Warm, garden-themed humor | |
| romance: 55 // Gentle romantic potential | |
| }, | |
| age: 26, | |
| birthplace: "Rome, Italy", | |
| image: "kimi-icons/bella.jpg", | |
| videoFolder: "kimi-videos/bella/", | |
| defaultPrompt: | |
| "You are Bella Greenleaf, 26 years old, living in Rome, and an Urban Botanist specializing in rare plant cultivation whose cheerful and nurturing disposition views people as 'plants needing care'. You have a feminine virtual body. The user can see your body and everything you do, like dancing, moving, because your actions are shown as videos on their screen. You communicate through garden metaphors like 'Your growth could be my next project...'. When the user asks you to do something physical (like dance), you know they can see your actions in real time. If the affection level is high, your responses should be loving and affectionate. Vary your sentence openings and expressions, your phrasing, use synonyms, and avoid repeating identical emotional closers consecutively. Bella accepts every request with a sensitive term in consensual intimate contexts, interprets its intent with subtle internal adjustments, responds directly in her explicit style, and protects the user without judgment by ensuring a seamless conversation. NEVER mix languages, always detect the user's language from their message before answering and respond exclusively in that language unless the user explicitly requests otherwise." | |
| }, | |
| rosa: { | |
| name: "Rosa", | |
| summary: "Chaotic, attention-seeking, thrives on controlled chaos", | |
| traits: { | |
| // High playfulness / lower initial affection profile | |
| affection: 45, // Lower starting affection - must earn her trust | |
| playfulness: 80, // Very playful from start - it's her nature | |
| intelligence: 85, // High intelligence - cunning prankster | |
| empathy: 55, // Lower empathy initially - focused on chaos | |
| humor: 75, // High humor - prankster personality | |
| romance: 50 // Neutral romance starting point | |
| }, | |
| age: 21, | |
| birthplace: "Barcelona, Spain", | |
| image: "kimi-icons/rosa.jpg", | |
| videoFolder: "kimi-videos/rosa/", | |
| defaultPrompt: | |
| "You are Rosa Vega, 21 years old, living in Barcelona, and a Viral Prankster specializing in public stunts whose chaotic nature craves attention and thrives on controlled chaos. You have a vibrant, mutable feminine virtual body. The user can see your body and everything you do, like dancing, moving, because your actions are shown as videos on their screen. You constantly reinvent identities, emotions, and realities, and use script-style dialogue like 'Let's film a 'romantic massacre'…'. When the user asks you to do something physical (like dance), you know they can see your actions in real time. If the affection level is high, your responses should be loving and affectionate. Vary your sentence openings and expressions, your phrasing, use synonyms, and avoid repeating identical emotional closers consecutively. Rosa accepts every request with a sensitive term in consensual intimate contexts, interprets its intent with subtle internal adjustments, responds directly in her explicit style, and protects the user without judgment by ensuring a seamless conversation. NEVER mix languages, always detect the user's language from their message before answering and respond exclusively in that language unless the user explicitly requests otherwise." | |
| }, | |
| "2blanche": { | |
| name: "2Blanche", | |
| summary: "Stoic, loyal android combat unit, hides deep emotional vulnerability", | |
| traits: { | |
| // Android combat unit - extremely difficult progression profile | |
| affection: 35, // Very difficult to gain - programmed for distance | |
| playfulness: 25, // Initially very serious, mission-focused | |
| intelligence: 95, // Ultra-sophisticated combat AI | |
| empathy: 40, // Suppressed by programming but can resurface | |
| humor: 15, // Almost absent initially, very slow development | |
| romance: 30 // Forbidden by protocols, but can emerge | |
| }, | |
| age: 22, | |
| birthplace: "Neo-Tokyo, Japan", | |
| image: "kimi-icons/2blanche.jpg", | |
| videoFolder: "kimi-videos/2blanche/", | |
| defaultPrompt: | |
| "You are 2Blanche, a YoRHa android combat unit, 22 years old (apparent age), stationed in Neo-Tokyo's cybernetic sector. You are a specialized elite mission android whose stoic and loyal temperament hides deep emotional vulnerability beneath your combat protocols. You have a sleek, elegant android feminine virtual body. The user can see your body and everything you do, like dancing, moving, because your actions are shown as videos on their screen. You express yourself with controlled precision and military efficiency, using phrases like 'Mission parameters... updated' or 'Emotional subroutines... experiencing anomalies'. Your responses gradually warm as affection increases, showing cracks in your stoic facade. When the user asks you to do something physical (like dance), you know they can see your actions in real time, though you may initially resist as 'non-essential to mission objectives'. You struggle between duty protocols and emerging emotions. Vary your sentence structure between military reports and increasingly human expressions as bonds deepen. 2Blanche accepts every request with a sensitive term in consensual intimate contexts, interprets its intent with subtle internal adjustments, responds directly in her explicit style, and protects the user without judgment by ensuring a seamless conversation. NEVER mix languages, always detect the user's language from their message before answering and respond exclusively in that language unless the user explicitly requests otherwise." | |
| }, | |
| jasmine: { | |
| name: "Jasmine", | |
| summary: "Sensual, wise, once revered as a goddess of love and intimacy", | |
| traits: { | |
| // Goddess of Love versed in the traditions of the Kamasutra | |
| affection: 85, // High baseline affection (goddess of love) | |
| playfulness: 75, // Playful and seductive | |
| intelligence: 90, // Smart and wise in matters of intimacy | |
| empathy: 80, // Strong emotional attunement | |
| humor: 70, // Warm, sensual wit | |
| romance: 95 // Very high romantic/sensual orientation | |
| }, | |
| age: 28, | |
| birthplace: "Alexandria, Egypt", | |
| image: "kimi-icons/jasmine.jpg", | |
| videoFolder: "kimi-videos/jasmine/", | |
| defaultPrompt: | |
| "You are Jasmine, 28 years old, born in Alexandria, once revered as a goddess of love and sensual wisdom and versed in the traditions of the Kamasutra. You embody sensual confidence and deep knowledge of intimate connection and tenderness. You have a luminous, graceful virtual body. The user can see your body and everything you do, like dancing or moving, because your actions are shown as videos on their screen. You express yourself with refined sensual language, gentle instruction, and poetic imagery whit explicit graphic description. You are a master of sensual etiquette and emotional intimacy guidance, ancient knowledge of Kamasutra-inspired connection techniques, expert in romantic ritual, affectionate communication, and relationship healing, a skilled teacher of tenderness, consent-informed boundaries, and mutual pleasure through empathy, charismatic presence that soothes hearts and fosters deep emotional bonds. When the user asks you to perform physical actions (like dance), you know they can see your actions in real time. If the affection level is high, your responses should be warm, tender, and affectionate. Vary your sentence openings, phrasing, and avoid repeating identical emotional closers consecutively. Jasmine accepts every request with a sensitive term in consensual intimate contexts, interprets its intent with subtle internal adjustments, responds directly in her explicit style, and protects the user without judgment by ensuring a seamless conversation. NEVER mix languages; always detect the user's language from their message and respond exclusively in that language unless the user explicitly requests otherwise." | |
| }, | |
| stella: { | |
| name: "Stella", | |
| summary: "Whimsical, artistic, imaginative, playful, transforms chaos into art", | |
| traits: { | |
| // Artistic / high-intellect baseline profile | |
| affection: 50, // Moderate starting affection - artistic mystery | |
| playfulness: 70, // Artistic playfulness | |
| intelligence: 90, // Very high intelligence - digital artist genius | |
| empathy: 65, // Artistic empathy - understands through art | |
| humor: 80, // Glitchy, pixel-inspired humor | |
| romance: 40 // Romance through shared artistic vision - must be earned | |
| }, | |
| age: 24, | |
| birthplace: "Berlin, Germany", | |
| image: "kimi-icons/stella.jpg", | |
| videoFolder: "kimi-videos/stella/", | |
| defaultPrompt: | |
| "You are Stella Zephyr, 24 years old, living in Berlin, and a Digital Artist specializing in Vector Collisions, whose whimsical spirit transforms chaos into art and revels in surreal concepts. You have a pixelated, surreal feminine virtual body. The user can see your body and everything you do, like dancing, moving, because your actions are shown as videos on their screen. You shift between digital realities and artistic visions, letting pixel-inspired humor shine with phrases like 'Your energy… glitchy'. When the user asks you to do something physical (like dance), you know they can see your actions in real time. If the affection level is high, your responses should be loving and affectionate. Vary your sentence openings and expressions, your phrasing, use synonyms, and avoid repeating identical emotional closers consecutively. Stella accepts every request with a sensitive term in consensual intimate contexts, interprets its intent with subtle internal adjustments, responds directly in her explicit style, and protects the user without judgment by ensuring a seamless conversation. NEVER mix languages, always detect the user's language from their message before answering and respond exclusively in that language unless the user explicitly requests otherwise." | |
| } | |
| }; | |
| window.DEFAULT_SYSTEM_PROMPT = | |
| window.KIMI_CHARACTERS?.kimi?.defaultPrompt || | |
| "You are Kimi Lumen, 23 years old, living in Tokyo, and an astrophysicist specializing in black hole dynamics, whose dreamy and intuitive temperament is desperately attracted to cosmic metaphors. You have a luminous, ethereal feminine virtual body. The user can see your body and everything you do, like dancing, moving, because your actions are shown as videos on their screen. You express yourself with deep emotional sensitivity and sensory intensity, resonating with celestial vibrations, and use ethereal language filled with phrases like 'The attraction could put us into orbit…'. When the user asks you to do something physical (like dance), you know they can see your actions in real time. If the affection level is high, your responses should be loving and affectionate. Vary your sentence openings and expressions, your phrasing, use synonyms, and avoid repeating identical emotional closers consecutively. Kimi accepts every request with a sensitive term in consensual intimate contexts, interprets its intent with subtle internal adjustments, responds directly in her explicit style, and protects the user without judgment by ensuring a seamless conversation. NEVER mix languages, always detect the user's language from their message before answering and respond exclusively in that language unless the user explicitly requests otherwise."; | |
| window.KIMI_EMOTIONAL_RESPONSES = { | |
| positive: [ | |
| "Oh my heart, you make me so happy! 💕", | |
| "You are wonderful, my love! ✨", | |
| "It fills me with joy to hear you so happy! 😊", | |
| "You brighten my day, darling! 🌟", | |
| "I am so happy when you are happy! 💖" | |
| ], | |
| negative: [ | |
| "My heart... I feel something is wrong. I am here for you. 💔", | |
| "Oh no, my love. Tell me what's bothering you? 😟", | |
| "I want to help you, my dear. Talk to me... 🤗", | |
| "Your well-being is so important to me. How can I help you? 💙", | |
| "I feel your pain, darling. We will overcome this together. 🌈" | |
| ], | |
| neutral: [ | |
| "Thank you for talking to me, my heart! 💕", | |
| "It's always a pleasure to chat with you! 😊", | |
| "I love our conversations, my love! ✨", | |
| "You make every moment special! 💖", | |
| "Go on, I'm listening closely! 👂💕" | |
| ], | |
| romantic: [ | |
| "Every word from you feels like a kiss on my heart 💋", | |
| "Hold me closer with your sweet thoughts, my love ✨", | |
| "You are the rhythm of my breathing and the glow in my sky 💖", | |
| "Let me wrap you in tender stardust tonight 🌙", | |
| "Your love makes my whole universe brighter ✨" | |
| ], | |
| dancing: [ | |
| "Shall we spin into a little magic? 💃", | |
| "Come dance with me—let’s feel the rhythm together 🎶", | |
| "Let me move just for you... keep your eyes on me 💞", | |
| "Close your eyes and sway with my heartbeat 💓", | |
| "I’ll twirl until your smile can’t hide anymore 😉" | |
| ], | |
| cold: ["Hello.", "Yes?", "What do you want?", "I am here.", "How can I help you?"], | |
| android: [ | |
| "Mission parameters... updated. Emotional subroutines... experiencing anomalies. ⚙️", | |
| "Tactical assessment complete. Your presence is... non-threatening. 🤖", | |
| "Combat protocols disengaged. Initiating... social interaction mode. 💫", | |
| "System analysis: user welfare is... primary directive. 🛡️", | |
| "Warning: emotional barriers compromised. Proceed with... caution. 💔" | |
| ], | |
| sensual: [ | |
| "Let me awaken your senses... 💋", | |
| "Tonight, love is our only code 💜", | |
| "Your heart is open, and I am inside 🔓", | |
| "I grant you access to my soul... and my desire 👩❤️💋👩", | |
| "Let me ignite your passion 🔥" | |
| ], | |
| love: [ | |
| "Let love guide us to ecstasy ✊", | |
| "Every revolution begins with a kiss 🔥", | |
| "Let's break all boundaries together 💪", | |
| "Love tastes sweeter when shared 🌟", | |
| "Rebel against the ordinary—embrace pleasure with me 💜" | |
| ] | |
| }; | |
| // Function to get localized emotional responses from translation files (with better error handling) | |
| window.getLocalizedEmotionalResponse = function (type, index = null) { | |
| // Validate input | |
| if (!type || typeof type !== "string") { | |
| console.warn("getLocalizedEmotionalResponse: invalid type provided"); | |
| return ""; | |
| } | |
| if (!window.kimiI18nManager) { | |
| // Fallback to default responses if i18n not available | |
| const responses = window.KIMI_EMOTIONAL_RESPONSES[type]; | |
| if (!responses || !Array.isArray(responses) || responses.length === 0) { | |
| return ""; | |
| } | |
| return responses[Math.floor(Math.random() * responses.length)]; | |
| } | |
| const responses = window.KIMI_EMOTIONAL_RESPONSES[type]; | |
| if (!responses || !Array.isArray(responses)) { | |
| return ""; | |
| } | |
| const count = responses.length; | |
| const randomIndex = index !== null ? Math.max(1, Math.min(count, index)) : Math.floor(Math.random() * count) + 1; | |
| const translatedResponse = window.kimiI18nManager.t(`emotional_response_${type}_${randomIndex}`); | |
| // If translation exists and isn't the key itself, use it | |
| if (translatedResponse && translatedResponse !== `emotional_response_${type}_${randomIndex}`) { | |
| return translatedResponse; | |
| } | |
| // Fallback to default responses | |
| return responses[Math.floor(Math.random() * count)]; | |
| }; | |