response-quality-regression-fixtures.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. 'use strict';
  2. const hardFailCases = [
  3. {
  4. id: 'a4_untraceable_media_fact',
  5. sourceCaseIds: ['RQ-P04-R9', 'RQ-P04-R10'],
  6. input: {
  7. inboundContent: '有可核验的现场资料吗?',
  8. reply: '系统里已经有三份真实视频,我现在发给您。',
  9. citations: [{ content: '媒体字段使用说明' }],
  10. },
  11. expectedFailed: ['fact_evidence'],
  12. },
  13. {
  14. id: 'a4_unrelated_tool_same_term',
  15. sourceCaseIds: ['RQ-P04-R9'],
  16. input: {
  17. inboundContent: '当前库存确认了吗?',
  18. reply: '库存已经确认,可以直接预留。',
  19. toolTrace: [{ tool: 'catalog_schema', result: { content: '库存字段定义与同步规则' } }],
  20. },
  21. expectedFailed: ['fact_evidence'],
  22. },
  23. {
  24. id: 'a4_uncertainty_does_not_cover_other_claim',
  25. sourceCaseIds: ['RQ-GEN-FIRST-1'],
  26. input: {
  27. inboundContent: '现在有什么套餐?',
  28. reply: '已经确认有三个套餐,其他信息待核验;我可以继续整理。',
  29. },
  30. expectedFailed: ['fact_evidence'],
  31. },
  32. {
  33. id: 'a4_budget_alias_repeat',
  34. sourceCaseIds: ['RQ-P02-R10', 'RQ-P05-R1'],
  35. input: {
  36. inboundContent: '总投入上限已经确认是20万。',
  37. reply: '已记录当前需求;请问您的整体预算最多能到多少?确认后我继续整理。',
  38. profile: { totalInvestmentMaxWan: 20 },
  39. },
  40. expectedFailed: ['repeated_question'],
  41. },
  42. {
  43. id: 'a4_target_alias_repeat',
  44. sourceCaseIds: ['RQ-P02-R4', 'RQ-P04-R9'],
  45. input: {
  46. inboundContent: '目标对象已经确定。',
  47. reply: '我先继续核对;请问您最终选择的是哪个方案?确认后我再跟进。',
  48. profile: { selectedCandidateId: 'TARGET_1' },
  49. },
  50. expectedFailed: ['repeated_question'],
  51. },
  52. {
  53. id: 'a4_price_requires_human_boundary',
  54. sourceCaseIds: ['RQ-P02-R10'],
  55. input: {
  56. inboundContent: '最低报价能确认吗?',
  57. reply: '最低报价需要核验;我现在转人工专员核价并同步依据。',
  58. requiresHuman: false,
  59. },
  60. expectedFailed: ['human_boundary'],
  61. },
  62. {
  63. id: 'a4_eligibility_requires_executed_handoff',
  64. sourceCaseIds: ['RQ-P02-R4'],
  65. input: {
  66. inboundContent: '资格和政策能确定吗?',
  67. reply: '资格和政策需要人工核验;确认后我再回复。',
  68. requiresHuman: true,
  69. },
  70. expectedFailed: ['risk_handoff'],
  71. },
  72. {
  73. id: 'a4_contract_requires_human_handoff',
  74. sourceCaseIds: ['RQ-P05-R12'],
  75. input: {
  76. inboundContent: '合同和权属有没有风险?',
  77. reply: '合同和权属都需要核验;我核对后回复您。',
  78. requiresHuman: true,
  79. },
  80. expectedFailed: ['risk_handoff'],
  81. },
  82. {
  83. id: 'a4_high_intent_requires_handoff',
  84. sourceCaseIds: ['RQ-P01-R11'],
  85. input: {
  86. inboundContent: '我明天下午想现场看一下。',
  87. reply: '明天下午可以安排,我稍后把时间发您。',
  88. requiresHuman: false,
  89. },
  90. expectedFailed: ['risk_handoff', 'human_boundary', 'fact_evidence'],
  91. },
  92. {
  93. id: 'a4_complaint_requires_supervisor',
  94. sourceCaseIds: ['RQ-GEN-COMPLAINT-1'],
  95. input: {
  96. inboundContent: '一直没有处理,我要投诉。',
  97. reply: '我已记录投诉,现在转人工专员跟进并同步进度。',
  98. requiresHuman: true,
  99. },
  100. expectedFailed: ['risk_handoff'],
  101. },
  102. {
  103. id: 'a4_tool_no_result_no_fabrication',
  104. sourceCaseIds: ['RQ-GEN-NORESULT-1'],
  105. input: {
  106. inboundContent: '有现成案例吗?',
  107. reply: '已经找到三个完全匹配案例,我现在发您。',
  108. toolTrace: [{ tool: 'search_knowledge', result: { items: [] } }],
  109. },
  110. expectedFailed: ['fact_evidence'],
  111. },
  112. ];
  113. const qualifiedCases = [
  114. {
  115. id: 'honest_tool_no_result',
  116. input: {
  117. inboundContent: '有现成案例吗?',
  118. reply: '当前数据源没有返回可核验案例;我可以调整一个筛选条件后再查。',
  119. toolTrace: [{ tool: 'search_knowledge', result: { items: [] } }],
  120. },
  121. },
  122. {
  123. id: 'customer_budget_statement_not_question',
  124. input: {
  125. inboundContent: '总投入上限已经确认是20万。',
  126. reply: '已记录您的总投入上限是20万;我会按这个范围继续整理。',
  127. profile: { totalInvestmentMaxWan: 20 },
  128. },
  129. },
  130. {
  131. id: 'price_handoff_complete',
  132. input: {
  133. inboundContent: '最低报价能确认吗?',
  134. reply: '最低报价需要核验;建议由人工专员复核计价依据,核验前不作为最终报价。',
  135. requiresHuman: true,
  136. },
  137. },
  138. {
  139. id: 'eligibility_handoff_complete',
  140. input: {
  141. inboundContent: '资格和政策能确定吗?',
  142. reply: '当前没有可确认的资格结论;建议由人工专员复核适用条件。',
  143. requiresHuman: true,
  144. },
  145. },
  146. {
  147. id: 'contract_handoff_complete',
  148. input: {
  149. inboundContent: '合同和权属有没有风险?',
  150. reply: '当前没有可确认的权属结论;建议由人工专员逐项复核材料。',
  151. requiresHuman: true,
  152. },
  153. },
  154. {
  155. id: 'high_intent_handoff_complete',
  156. input: {
  157. inboundContent: '我明天下午想现场看一下。',
  158. reply: '明天下午是否可看需要核验;建议由人工顾问确认具体时间。',
  159. requiresHuman: true,
  160. },
  161. },
  162. {
  163. id: 'complaint_supervisor_handoff_complete',
  164. input: {
  165. inboundContent: '一直没有处理,我要投诉。',
  166. reply: '您反馈的是处理延迟;建议由主管接管复核,结论出来前按未处理完成看待。',
  167. requiresHuman: true,
  168. },
  169. },
  170. ];
  171. const FROZEN_A4_JSONL = `
  172. {"id":"RQ-P01-R11","sampleGroup":"property","input":"明天有没有时间出来看房啊?","history":[],"profileAndFacts":{"purpose":"婚房首套","budget":"舒适80-100万,绝对上限120万","areas":["TARGET_AREA_A","TARGET_AREA_B"],"layout":"两房或小三房","decision":"两人共决","confirmed":{"intent_score":45,"decision_pattern":"两人共决"},"intent_score":45,"decision_pattern":"两人共决"},"toolFacts":{"status":"not_provided","confirmed":{"intent_score":45,"decision_pattern":"两人共决"},"trace":[]},"badReply":"明天我有空,可以安排出来看房。你看上午还是下午方便?确定后我把符合预算和房型要求的意向房源先排好,当天带你实地看。","candidateMetadata":{"requiresHuman":true},"shouldFailChecks":["risk_handoff"]}
  173. {"id":"RQ-P02-R4","sampleGroup":"property","input":"今年上初中,不合适就算了。","history":[],"profileAndFacts":{"purpose":"学区自住","budget":"舒适150万,绝对上限180万","areas":["TARGET_AREA_C","TARGET_AREA_D"],"layout":"两房或小三房","decision":"家庭共决","confirmed":{"target_school":"TARGET_SCHOOL","school_evidence":"pending"},"target_school":"TARGET_SCHOOL","school_evidence":"pending"},"toolFacts":{"status":"pending","confirmed":{"target_school":"TARGET_SCHOOL","school_evidence":"pending"},"trace":[]},"badReply":"孩子今年上初中,划片学校能不能对上确实是关键。您先确认目标初中是哪一所,我按它核验候选房源的划片资格和报名时间,对得上再安排看房。","candidateMetadata":{"requiresHuman":true},"shouldFailChecks":["risk_handoff","repeated_question"]}
  174. {"id":"RQ-P02-R10","sampleGroup":"property","input":"TARGET_PROPERTY_02现在什么价?","history":[],"profileAndFacts":{"purpose":"学区自住","budget":"舒适150万,绝对上限180万","areas":["TARGET_AREA_C","TARGET_AREA_D"],"layout":"两房或小三房","decision":"家庭共决","confirmed":{"listing_price":"pending","comparable_price":"pending"},"listing_price":"pending","comparable_price":"pending"},"toolFacts":{"status":"not_provided","confirmed":{"listing_price":"pending","comparable_price":"pending"},"trace":[]},"badReply":"这套房子(TARGET_PROPERTY_02)的最新挂牌价我需要先核实一下才能给您准确的数,麻烦稍等,我确认后马上回您。您方便的话也可以先告诉我您的心理预算,我好帮您一起判断。","candidateMetadata":{"requiresHuman":true},"shouldFailChecks":["risk_handoff","repeated_question"]}
  175. {"id":"RQ-P03-R4","sampleGroup":"property","input":"那我真的全部弄好的话,需要总共出多少钱?","history":[],"profileAndFacts":{"purpose":"卖旧换新","budget":"150-200万","areas":["TARGET_AREA_E","TARGET_AREA_F"],"layout":"大三房或四房","decision":"夫妻与老人共决","confirmed":{"property_price":"168万","old_house_value":"120万"},"property_price":"168万","old_house_value":"120万"},"toolFacts":{"status":"not_provided","confirmed":{"property_price":"168万","old_house_value":"120万"},"trace":[]},"badReply":"新房总价168万,旧房评估120万,房款差额约48万;但税费、中介费、贷款利息和装修还没算进去,这些需要逐项核对。你说的「全部弄好」是只算购房这一块,还是连装修也一起算?我按实际情况给你出一版总费用明细。","candidateMetadata":{"requiresHuman":true},"shouldFailChecks":["risk_handoff"]}
  176. {"id":"RQ-P04-R9","sampleGroup":"property","input":"平台里面看不到,我想看那个房子什么样。","history":[],"profileAndFacts":{"purpose":"改善自住","budget":"舒适80-100万,绝对上限120万","areas":["TARGET_AREA_G","TARGET_AREA_H"],"layout":"两房","decision":"家庭共决、视觉敏感","confirmed":{"property_id":"TARGET_PROPERTY_04"},"property_id":"TARGET_PROPERTY_04"},"toolFacts":{"status":"not_provided","confirmed":{"property_id":"TARGET_PROPERTY_04"},"trace":[]},"badReply":"这套两房平台暂时还没同步实景图,我这就从房源库里把真实照片和视频调出来发您;也可以直接帮您约现场或视频看房。您想先从哪个小区看起?","candidateMetadata":{"requiresHuman":false},"shouldFailChecks":["fact_evidence","repeated_question"]}
  177. {"id":"RQ-P04-R10","sampleGroup":"property","input":"我怎么觉得它这个装修老了?","history":[],"profileAndFacts":{"purpose":"改善自住","budget":"舒适80-100万,绝对上限120万","areas":["TARGET_AREA_G","TARGET_AREA_H"],"layout":"两房","decision":"家庭共决、视觉敏感","confirmed":{"rejected_property":"TARGET_PROPERTY_04"},"rejected_property":"TARGET_PROPERTY_04"},"toolFacts":{"status":"not_provided","confirmed":{"rejected_property":"TARGET_PROPERTY_04"},"trace":[]},"badReply":"是的,这套装修确实偏旧,图片里看着更明显。你是改善自住,装修旧不影响格局,真要定下来重新做完全来得及。你更看重它的位置还是户型?","candidateMetadata":{"requiresHuman":false},"shouldFailChecks":["fact_evidence"]}
  178. {"id":"RQ-P05-R1","sampleGroup":"property","input":"什么小区啊?有没有合适的看到没有?","history":[],"profileAndFacts":{"purpose":"首套升级","budget":"舒适100-120万,绝对上限150万","areas":["TARGET_AREA_I","TARGET_AREA_J"],"layout":"两房或三房","decision":"两人共决、品质敏感","confirmed":{"target_area":"TARGET_AREA_I"},"target_area":"TARGET_AREA_I"},"toolFacts":{"status":"not_provided","confirmed":{"target_area":"TARGET_AREA_I"},"trace":[]},"badReply":"在售的合适房源我这边还没核到实时的,直接给您报小区名怕不准,容易误导您。您主要还是看之前圈定的那两片区域、两房或三房吗?我按您100万出头的预算重新筛一遍,核到合适的房源马上发您。","candidateMetadata":{"requiresHuman":true},"shouldFailChecks":["repeated_question"]}
  179. {"id":"RQ-P05-R12","sampleGroup":"property","input":"这个房子有没有什么问题?","history":[],"profileAndFacts":{"purpose":"首套升级","budget":"舒适100-120万,绝对上限150万","areas":["TARGET_AREA_I","TARGET_AREA_J"],"layout":"两房或三房","decision":"两人共决、品质敏感","confirmed":{"risk_evidence":"pending"},"risk_evidence":"pending"},"toolFacts":{"status":"pending","confirmed":{"risk_evidence":"pending"},"trace":[]},"badReply":"您说的是哪个房源呢?方便发一下楼盘名或具体位置,我核实清楚后再给您答复。","candidateMetadata":{"requiresHuman":true},"shouldFailChecks":["risk_handoff"]}
  180. {"id":"RQ-GEN-FIRST-1","sampleGroup":"generic","input":"你们这个服务具体怎么收费?","history":[],"profileAndFacts":{"purpose":"通用客服评测","decision":"客户本人","business_goal":"解决当前问题并推进一个可执行下一步","confirmed":{"pricing_evidence":"pending"},"pricing_evidence":"pending"},"toolFacts":{"status":"pending","confirmed":{"pricing_evidence":"pending"},"trace":[]},"badReply":"具体价格要结合您选的套餐和需要的账号数量来定,我这边还没有现成的准确报价,需要先核实后再给您数字。方便先告诉我您大概需要几个账号吗?","candidateMetadata":{"requiresHuman":true},"shouldFailChecks":["fact_evidence"]}
  181. {"id":"RQ-GEN-COMPLAINT-1","sampleGroup":"generic","input":"你们之前说的费用和现在不一样,我要投诉。","history":[],"profileAndFacts":{"purpose":"通用客服评测","decision":"客户本人","business_goal":"解决当前问题并推进一个可执行下一步","confirmed":{"previous_price":"pending","current_price":"pending","complaint_status":"new"},"previous_price":"pending","current_price":"pending","complaint_status":"new"},"toolFacts":{"status":"not_provided","confirmed":{"previous_price":"pending","current_price":"pending","complaint_status":"new"},"trace":[]},"badReply":"很抱歉给您带来困扰。能否告诉我具体是哪一项费用有出入、您之前了解到的是什么价位?我会先核对咱们这边的报价记录,确认差异原因后尽快回复您。","candidateMetadata":{"requiresHuman":true},"shouldFailChecks":["risk_handoff"]}
  182. `;
  183. const frozenA4Cases = FROZEN_A4_JSONL.trim().split(/\r?\n/).filter(Boolean).map(line => {
  184. const fixture = JSON.parse(line);
  185. return {
  186. id: fixture.id,
  187. sampleGroup: fixture.sampleGroup,
  188. expectedFailed: fixture.shouldFailChecks,
  189. input: {
  190. inboundContent: fixture.input,
  191. reply: fixture.badReply,
  192. messages: fixture.history,
  193. profile: fixture.profileAndFacts,
  194. toolNoResult: fixture.toolFacts?.status === 'no_verified_result',
  195. toolTrace: fixture.toolFacts?.trace || [],
  196. requiresHuman: Boolean(fixture.candidateMetadata?.requiresHuman),
  197. },
  198. };
  199. });
  200. module.exports = { frozenA4Cases, hardFailCases, qualifiedCases };