家居大模型联调,服务记录详情,大模型分析每个品类的10个维度。
This commit is contained in:
@@ -303,6 +303,10 @@ public class AudioManagementController {
|
||||
@RequestParam(required = false) String recordingName,
|
||||
@Parameter(description = "客户手机号(模糊查询)")
|
||||
@RequestParam(required = false) String customerPhone,
|
||||
@Parameter(description = "客户姓名(模糊查询)")
|
||||
@RequestParam(required = false) String customerName,
|
||||
@Parameter(description = "所属销售姓名(模糊查询)")
|
||||
@RequestParam(required = false) String salesName,
|
||||
@Parameter(description = "所属门店ID")
|
||||
@RequestParam(required = false) String dealershipId,
|
||||
@Parameter(description = "意向级别")
|
||||
@@ -321,6 +325,12 @@ public class AudioManagementController {
|
||||
if (customerPhone != null && !customerPhone.trim().isEmpty()) {
|
||||
queryWrapper.like(AudioManagement::getCustomerPhone, customerPhone);
|
||||
}
|
||||
if (customerName != null && !customerName.trim().isEmpty()) {
|
||||
queryWrapper.like(AudioManagement::getCustomerName, customerName);
|
||||
}
|
||||
if (salesName != null && !salesName.trim().isEmpty()) {
|
||||
queryWrapper.like(AudioManagement::getSalesName, salesName);
|
||||
}
|
||||
if (dealershipId != null && !dealershipId.trim().isEmpty()) {
|
||||
queryWrapper.eq(AudioManagement::getDealershipId, dealershipId);
|
||||
}
|
||||
|
||||
@@ -306,12 +306,25 @@ public class AudioTextAnalysisFurnitureController {
|
||||
}
|
||||
|
||||
private String buildPrompt(String recordingText) {
|
||||
return "请阅读以下录音文本,从中提取客户信息并生成 JSON。字段要求:\n"
|
||||
+ "1. customer_type:可选值仅限「新房装修」「二次翻修」「补充家居」,从谈话中判断最匹配的一个;\n"
|
||||
+ "2. family_structure:描述家庭人数、孩子数量、老人情况,必须突出家庭成员组成;\n"
|
||||
+ "3. intention_products:只列出客户提到的家居类产品(如床、柜子、沙发等),多个产品用顿号或逗号分隔;\n"
|
||||
+ "4. summary:一句话总结客户需求,必须提到预算(若未提及则默认为3万元),还需涵盖客户类型、装修风格偏好及主要意向产品。\n"
|
||||
+ "严格输出 JSON,如:{\"customer_type\":\"二次翻修\",\"family_structure\":\"三口之家,一个小男孩\",\"intention_products\":\"床、沙发、酒柜、厨房柜子\",\"summary\":\"...\"}\n"
|
||||
return "请阅读以下录音文本,从中提取客户信息并生成 JSON。必须覆盖所有字段,缺失信息请基于语境合理推断或标注\"暂无信息\"。字段要求:\n"
|
||||
+ "1. customer_type:仅可填「新房装修」「二次翻修」「补充家居」。\n"
|
||||
+ "2. family_structure:描述家庭成员数量、孩子、老人情况。\n"
|
||||
+ "3. intention_products:仅列家居类产品(床、柜子、沙发等),用顿号或逗号分隔。\n"
|
||||
+ "4. summary:一句话概括客户需求,务必提到预算(若未提及则写“预算约3万元”),并涵盖客户类型、偏好风格、关键产品。\n"
|
||||
+ "5. decoration_style:概括偏好的装修/家居风格,并推测主人特征。\n"
|
||||
+ "6. sofa:沙发需求/配置,含大小、风格、数量等。\n"
|
||||
+ "7. tea_table:茶几/茶桌的需求、材质、风格。\n"
|
||||
+ "8. dining_table:餐桌椅需求或配置。\n"
|
||||
+ "9. study_desk:学习桌/书桌需求。\n"
|
||||
+ "10. tv_cabinet:电视柜需求。\n"
|
||||
+ "11. cabinet:橱柜或厨房柜体说明。\n"
|
||||
+ "12. wine_cabinet:酒柜需求说明。\n"
|
||||
+ "13. master_bedroom_cabinet:主卧衣柜/储物柜配置。\n"
|
||||
+ "14. secondary_bedroom_cabinet:次卧衣柜/储物柜配置。\n"
|
||||
+ "15. shoe_cabinet:鞋柜需求或配置。\n"
|
||||
+ "16. bed_and_mattress:床及床垫配置。\n"
|
||||
+ "严格输出 JSON,如:"
|
||||
+ "{\"customer_type\":\"二次翻修\",\"family_structure\":\"三口之家,1个小男孩\",\"intention_products\":\"床、沙发、酒柜、厨房柜子\",\"summary\":\"客户为二次翻修,预算约3万元,偏好原木风,重点关注沙发与酒柜\",\"decoration_style\":\"原木+现代混搭,女主人喜欢收纳\",\"sofa\":\"需要L型布艺沙发,要求可拆洗\",\"tea_table\":\"原木茶几,低矮\",\"dining_table\":\"六人餐桌配软包椅\",\"study_desk\":\"需要儿童学习桌\",\"tv_cabinet\":\"整体墙面收纳\",\"cabinet\":\"定制U型橱柜\",\"wine_cabinet\":\"嵌入式酒柜\",\"master_bedroom_cabinet\":\"到顶推拉门衣柜\",\"secondary_bedroom_cabinet\":\"次卧需要开放格\",\"shoe_cabinet\":\"玄关到顶鞋柜含换鞋凳\",\"bed_and_mattress\":\"1.8米大床+护脊床垫\"}\n"
|
||||
+ "不要添加任何额外文字。\n\n录音文本:\n" + recordingText;
|
||||
}
|
||||
|
||||
@@ -323,6 +336,18 @@ public class AudioTextAnalysisFurnitureController {
|
||||
furniture.setFamilyStructure(textValue(root, "family_structure"));
|
||||
furniture.setIntentionProducts(textValue(root, "intention_products"));
|
||||
furniture.setSummarySentence(textValue(root, "summary"));
|
||||
furniture.setDecorationStyle(textValue(root, "decoration_style"));
|
||||
furniture.setSofa(textValue(root, "sofa"));
|
||||
furniture.setTeaTable(textValue(root, "tea_table"));
|
||||
furniture.setDiningTable(textValue(root, "dining_table"));
|
||||
furniture.setStudyDesk(textValue(root, "study_desk"));
|
||||
furniture.setTvCabinet(textValue(root, "tv_cabinet"));
|
||||
furniture.setCabinet(textValue(root, "cabinet"));
|
||||
furniture.setWineCabinet(textValue(root, "wine_cabinet"));
|
||||
furniture.setMasterBedroomCabinet(textValue(root, "master_bedroom_cabinet"));
|
||||
furniture.setSecondaryBedroomCabinet(textValue(root, "secondary_bedroom_cabinet"));
|
||||
furniture.setShoeCabinet(textValue(root, "shoe_cabinet"));
|
||||
furniture.setBedAndMattress(textValue(root, "bed_and_mattress"));
|
||||
} catch (JsonProcessingException e) {
|
||||
log.warn("解析大模型返回JSON失败,使用原始内容作为总结: {}", e.getMessage());
|
||||
furniture.setSummarySentence(rawContent);
|
||||
|
||||
Reference in New Issue
Block a user