Chatbot: replies never carry an em dash (scrubbed to a comma)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+3
-1
@@ -325,7 +325,9 @@ function askAI(message, historyText, kbBlock) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const UNSURE_RE = /(not sure|do not know|don't know|cannot help|can't help|unable to help|no way for me|i (can|could) not (see|check|look)|contact support|reach support|support (ticket|desk)|\/support\b|my#help)/i;
|
const UNSURE_RE = /(not sure|do not know|don't know|cannot help|can't help|unable to help|no way for me|i (can|could) not (see|check|look)|contact support|reach support|support (ticket|desk)|\/support\b|my#help)/i;
|
||||||
async function answer(message, historyText) {
|
// every reply leaves without em dashes (Marty's voice rule; the model slips one in now and then, 2026-10-20)
|
||||||
|
async function answer(message, historyText) { const r = await answerRaw(message, historyText); if (r && typeof r.reply === 'string') r.reply = r.reply.replace(/\s*\u2014\s*/g, ', '); return r; }
|
||||||
|
async function answerRaw(message, historyText) {
|
||||||
const msg = String(message || '').trim();
|
const msg = String(message || '').trim();
|
||||||
if (!msg) return { error: 'Say something first.' };
|
if (!msg) return { error: 'Say something first.' };
|
||||||
// fast path: the knowledge base's instant answers (seeded from CANNED); the in-code list only if the KB store is down
|
// fast path: the knowledge base's instant answers (seeded from CANNED); the in-code list only if the KB store is down
|
||||||
|
|||||||
Reference in New Issue
Block a user