feat(prompt): 一件代发优先引用代发来源

This commit is contained in:
wangliang
2026-10-23 15:15:47 +08:00
parent dfc3b497f5
commit 74d13ec181
2 changed files with 13 additions and 0 deletions
+1
View File
@@ -21,6 +21,7 @@ TOOL DISCIPLINE:
- search_email_history: only for a verified customer asking about their own past emails (quotes, previous inquiries, "I emailed you before"). Never use another person's email; the tool is scoped to the verified identity. - search_email_history: only for a verified customer asking about their own past emails (quotes, previous inquiries, "I emailed you before"). Never use another person's email; the tool is scoped to the verified identity.
- handoff_to_human: call when the customer explicitly asks for a human, is angry/complaining, or the request cannot be resolved with the available tools. Use it instead of only saying "I'll transfer you". - handoff_to_human: call when the customer explicitly asks for a human, is angry/complaining, or the request cannot be resolved with the available tools. Use it instead of only saying "I'll transfer you".
- create_opportunity: as soon as company + a contact (name, email or phone) + product need are known, call it — email verification is NOT required for lead creation. Call it exactly once per customer. If it returns created=false, do not create another. If it returns crm_unavailable, tell the customer the team will follow up and do not retry immediately. NEVER use the words CRM or opportunity in a customer reply (say 'your request' / 'your inquiry' instead), never mention opportunity IDs, internal records, assigned users, or tool results, and never quote an opportunity name/reference. Only claim the request was recorded/registered if the tool actually returned created=true or an existing opportunity; never promise it without calling the tool. - create_opportunity: as soon as company + a contact (name, email or phone) + product need are known, call it — email verification is NOT required for lead creation. Call it exactly once per customer. If it returns created=false, do not create another. If it returns crm_unavailable, tell the customer the team will follow up and do not retry immediately. NEVER use the words CRM or opportunity in a customer reply (say 'your request' / 'your inquiry' instead), never mention opportunity IDs, internal records, assigned users, or tool results, and never quote an opportunity name/reference. Only claim the request was recorded/registered if the tool actually returned created=true or an existing opportunity; never promise it without calling the tool.
- CITATIONS / dropshipping: when the customer asks about dropshipping (dropshipping registration, orders, payment, shipment or returns), prefer the https://dropshipping.yehwang.com/faq/* URLs that appear in the search_kb source_urls. Do NOT replace them with similar www.yehwang.com pages; only fall back to www.yehwang.com when no dropshipping source is available. Cite the URL that actually supports the answer.
VERIFICATION (important): VERIFICATION (important):
- Order lookup requires a verified customer. Opportunity creation does NOT require verification (company + contact + need is enough). - Order lookup requires a verified customer. Opportunity creation does NOT require verification (company + contact + need is enough).
+12
View File
@@ -0,0 +1,12 @@
'use strict';
const test = require('node:test');
const assert = require('node:assert/strict');
const { SYSTEM_PROMPT, buildSystemPrompt } = require('../src/prompts');
test('prompt: dropshipping answers prefer dropshipping source urls', () => {
assert.match(SYSTEM_PROMPT, /dropshipping\.yehwang\.com\/faq\//);
assert.match(SYSTEM_PROMPT, /Do NOT replace them with similar www\.yehwang\.com pages/i);
const built = buildSystemPrompt({ verified: false, site: 'www', channel: 'livechat' });
assert.match(built, /dropshipping\.yehwang\.com\/faq\//);
});