DM应答答案格式
描述
当前应答出答案,答案展示与渲染没有固定格式渲染,都是返回各个地方的答案对应对象,由前端自己解析对应答案与格式,没有对应答案格式,存在下面问题:
- 答案渲染与后端答案对象耦合
- 后端答案对象修改影响前端答案,扩展性差
答案区分
- 一般答案(包含:文本,图片,音频):用于展示普通答案
- 列表答案:列表答案显示,当前主要为引擎返回
- 用户引导答案:重点推荐答案,普通推荐答案,图片引导
- 重点推荐答案位于出的答案下方
- 普通推荐答案位于输入框上方
- 图片引导位于答案下方(可选择隐藏)
- 情感识别结果:xma专用结果
答案实际格式
答案对象DmResAnswerDTO
| 参数 |
类型 |
说明 |
| answerType |
Integer |
答案类别,算法接口返回 |
| answerSource |
Integer |
答案来源 |
| sessionId |
String |
会话id |
| questionId |
String |
对应的问题id |
| questionType |
Integer |
对应的问题类型 |
| dmResSingleAnswerList |
List<DmResSingleAnswer> |
一般答案 |
| metadataListDto |
DmResListAnswer |
列表答案,继承DmResSingleAnswer |
| dmResGuideAnswer |
DmResGuideAnswer |
用户引导答案 |
| sentimentDTO |
SentimentDTO |
情感识别答案 |
| turnButtonDTO |
List<TurnButtonDTO> |
转人工、核身、留言等按钮信息 |
| nodeKey |
String |
执行结果节点key-节点标识数据(当扩展信息或语音使用) |
| classifyName |
String |
答案的分类,kms出答案时配置 |
| classificationId |
Integer |
答案的分类ID,kms出答案时配置 |
| intentionRecognition |
String |
意图识别结果,kms出答案时配置 |
| repositoryId |
Integer |
知识库ID,kms出答案时配置 |
| repositoryType |
Integer |
知识库类型,kms出答案时配置 |
| repositoryName |
String |
知识库名称,kms出答案时配置 |
| answerDataType |
String |
答案类型SIMPLE,LIST(SIMPLE时渲染普通答案,LIST渲染列表答案) |
| answerVersion |
Integer |
答案版本号,当前为2 |
| extendParam |
Map |
扩展数据,当前无数据 |
DmResSingleAnswer
| 参数 |
类型 |
说明 |
| type |
Integer |
答案类型 1:文本,2:图片,3:音频 |
| answerTipDatas |
List |
提示答案信息 |
| answerTip |
String |
答案提示信息 |
| answerData |
String |
实际答案数据 |
| evaluationStatus |
Boolean |
是否展示评价按钮 |
| template |
String |
答案模板--引擎出答案时,语音使用 |
| dmResAnswerMetadataList |
List<DmResAnswerMetadata> |
答案元数据--引擎出答案时,语音使用 |
| 参数 |
类型 |
说明 |
| metadataCode |
String |
元数据CODE |
| value |
String |
元数据对应值 |
| typeRemark |
String |
元数据类型MARK |
DmResListAnswer
| 参数 |
类型 |
说明 |
| viewType |
String |
列表类型(默认READ_ONLY):"READ_ONLY":只读列表,"LIST_HREF_CLICK":超链接点击列表,"HREF_CLICK_WCONTENT":超链接点,选列表-带答案,"CHECK_BOX":多选列表,"CARD_CLICK":卡片选择,"BUTTON_CLICK":按钮选择 |
| description |
String |
列表描述信息(备用) |
| listAnswerDataList |
List<DmResListAnswerData> |
数据列表实际数据 |
DmResListAnswerData
| 参数 |
类型 |
说明 |
| seqNo |
Integer |
下标, 前端依据下标顺序解析, 默认从1开始 |
| interactName |
String |
交互key名称 |
| interactValue |
String |
交互key值 |
| viewText |
String |
显示的文本 |
| extraViewText |
String |
额外的显示文(重百使用) |
| backText |
String |
下一步的交互文本(重百使用) |
| dataMap |
Map |
展示样式为CARD_CLICK选择时,卡片数据 |
| originalTemplate |
String |
原始话术模板(语音使用) |
| metadataRetList |
List<DmResAnswerMetadata> |
元数据变量列表(语音使用) |
DmResGuideAnswer
DmResSpecialRecommend
| 参数 |
类型 |
说明 |
| specialTip |
String |
重点推荐,展示的提示,例如:你是不是想咨询? |
| recommendAnswers |
List<DmResRecommendAnswer> |
推荐答案列表 |
DmResNormalRecommend
DmResPictureGuid
DmResRecommendAnswer
| 参数 |
类型 |
说明 |
| recommendType |
Integer |
推荐类型 开头语推荐,下一意图推荐, 模糊反问推荐, faq推荐, 关联问题推荐 |
| recomendSource |
Integer |
推荐来源 1:问答定制;2:分类;3:重百问答推荐 |
| classificationId |
Integer |
分类ID |
| classificationName |
String |
分类名 |
| standardQuestion |
String |
标准问(展示) |
| repositoryId |
Long |
知识库ID |
| knowledgeBaseType |
Integer |
知识库类型 |
| faqAnswer |
String |
FAQ答案 |
| locationId |
Integer |
位置ID,位置排序(从1开始) |
| extendParam |
Map |
扩展数据,当前重百会使用 |
DmResPictureRecommendAnswer
| 参数 |
类型 |
说明 |
| recommendType |
Integer |
推荐类型 开头语推荐,下一意图推荐, 模糊反问推荐, faq推荐, 关联问题推荐 |
| classificationId |
Integer |
分类ID |
| classificationName |
String |
分类名 |
| standardQuestion |
String |
标准问(展示) |
| repositoryId |
Long |
知识库ID |
| knowledgeBaseType |
Integer |
知识库类型 |
| faqAnswer |
String |
FAQ答案 |
| locationId |
Integer |
位置ID,位置排序(从1开始) |
| title |
String |
引导展示标题 |
| redirectUrl |
String |
引导点击链接 |
| picture |
String |
引导图片 |
SentimentDTO
| 参数 |
类型 |
说明 |
| sentiment |
String |
情感 |
| emojiCode |
String |
表情code |
| sentence |
String |
情感话术 |
| isCover |
Boolean |
是否情感话术覆盖分类答案 |
| 参数 |
类型 |
说明 |
| name |
String |
当前按钮显示名称 |
| linkUrl |
String |
当前按钮跳转URL |
| openType |
String |
当前按钮跳转方式 iframe/href/innerIM |
| additionalText |
String |
当前按钮下方附加文本 |
| beforeActionUrl |
String |
当前按钮跳转前执行的url |
FAQ: