新零售智能助理商家测试窗。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | RecognizeMessageForTest | 接口功能枚举值 |
RobotCode | String | 是 | 1cY9drMec4b2uzS2 | 机器人ID |
SessionId | String | 是 | aUeafnr-scgyw28f4 | 买卖家之间的会话ID |
ChatId | String | 是 | c8jd-2ncpocs | 单句的唯一ID |
Round | Integer | 是 | 2 | 当前的对话轮次 |
Content | String | 是 | 你好 | 用户输入的query |
ContentType | String | 是 | TEXT、PIC、URL、CLICK、OTHERS | 用户输入的query类型 |
ExtraContent | Map | 否 | query扩展信息, 通常在点击事件中使用 |
|
UserNick | String | 是 | 买家账号 | 买家nick |
UserId | String | 否 | 12345678 | 买家ID |
StaffNick | String | 是 | 智能助理测试账号客服 | 卖家接待人nick |
StaffId | String | 否 | 12341 | 卖家接待人ID |
SellerNick | String | 是 | 智能助理测试账号 | 卖家nick |
SellerId | String | 否 | 124234 | 卖家ID |
ServiceMode | String | 是 | AUTO | 机器人模式 |
FocusOrderId | String | 否 | 987654321 | 焦点订单id |
FocusItemId | String | 否 | 13579 | 焦点商品id |
Orders | Array | 否 | 订单列表 |
|
OrderId | String | 否 | 987654321 | 子订单id |
ParentOrderId | String | 否 | 1234567890 | 主订单id |
CreateTime | Long | 否 | 1611130298820 | 订单创建时间 |
PayTime | Long | 否 | 1611130298820 | 订单支付时间 |
BuyerId | String | 否 | 123445 | 买家id |
SellerId | String | 否 | 124321143 | 卖家id |
PayStatus | String | 否 | STATUS_PAID | 支付状态 |
RefundStatus | String | 否 | STATUS_WAIT_SELLER_AGREE | 退款状态 |
LogisticsStatus | String | 否 | STATUS_CONSIGNED | 物流状态 |
BuyerRateStatus | String | 否 | RATE_STATUS_RATED | 评价状态 |
ItemId | String | 否 | 13579 | 订单中的商品id |
ItemTitle | String | 否 | xxx商品 | 商品标题 |
ItemPic | String | 否 | https://image.alicdn.com/xxxxx | 商品主图URL |
Price | Float | 否 | 123.45 | 订单价格 |
Count | Integer | 否 | 1 | 订单中的商品数量 |
SkuProperty | String | 否 | 颜色:红;材质:棉 | sku属性 |
Items | Array | 否 | 商品列表 |
|
ItemId | String | 否 | 13579 | 商品id |
SellerId | String | 否 | 124321143 | 卖家id |
Title | String | 否 | xxx商品 | 商品标题 |
CategoryId | String | 否 | 3333333 | 商品叶子类目id |
ShopCategoryIds | Array of String | 否 | 12343421 | 商品店铺类目id |
Price | Float | 否 | 123.45 | 商品价格 |
PicUrl | String | 否 | https://img.alicdn.com/xxxxx | 商品主图url |
Property | Map | 否 | 颜色:红 | 商品属性 |
String | 否 | 颜色:红 | 属性键值对 |
|
ExpectedSlots | Array | 否 | 期望槽位 |
|
SlotKey | String | 否 | sys.number.bodyheight | 槽位key |
ClientInfo | Object | 否 | 客户端信息 |
|
ClientVersion | String | 否 | 2.0.5 | 客户端版本 |
ClientApp | String | 否 | taobao | 客户端APP taobao、douyin、kuaishou、pdd、qiwei、jd、app、wechat、others |
ClientOs | String | 否 | ios | 客户端系统 android、ios、harmonyos、windows、linux、macos、others |
IgnoreSceneSwitch | Boolean | 否 | false | 是否忽略场景开关 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | 59C3CCE4-24B1-4277-A4A0-C0EFE4C14E0A | Id of the request |
Data | Object | 问答返回结果 |
|
Scene | Object | 定位到的场景 |
|
SceneDTOs | Array of SceneDTO | 场景识别 |
|
SceneKey | String | sc_wenhou | 场景key |
SceneSource | String | singleRound | 场景来源 |
contextModule | String | context_scene_e2e | 多轮中上下文模块信息 |
EmotionTag | String | fq_fennu | 情绪识别 |
SemanticComplete | String | SEMANTIC_COMPLETE | 语义完整性识别 |
ItemId | String | 13579 | 定位场景使用的商品id |
OrderId | String | 987654321 | 定位场景使用的订单id |
Knowledges | Array of KnowledgeDTO | 定位到的知识 |
|
KnowledgeId | Long | 1 | 知识id |
KnowledgeTitle | String | 测试知识 | 知识标题 |
SceneKey | String | sc_wenhou | 场景key |
Solutions | Array of Solution | 知识答案 |
|
SolutionId | Long | 3 | 答案id |
KnowledgeId | Long | 1 | 知识id |
SolutionType | String | text | 答案类型 |
SolutionSource | String | source | 答案来源 |
SolutionContent | String | 你好 | 答案内容 |
Conditions | Array of Condition | 答案限定条件 |
|
ConditionType | String | EffectiveMode | 条件类型 |
ConditionValue | String | auto | 条件表达式 |
ExtraContent | String | ["emoji1","emoji2"] | 扩展答案信息 |
SolutionVariables | Array of SolutionVariable | 答案变量 |
|
VariableName | String | 变量名称 | 变量名称 |
VariableType | String | 系统变量 | 变量类型 |
OutputMessages | Array of OutputMessage | 建议的回复内容 |
|
OutputContentType | String | ASK_TEXT | 回复类型 |
OutputContent | Map | 回复内容 |
|
extOutput | Map | 扩展的输出 |
|
UnitSlots | Object | 识别到的槽位信息 |
|
UnitSpans | Array of UnitSpan | NER识别结果 |
|
Start | Integer | 0 | 槽位起始下标 |
End | Integer | 4 | 槽位结束下标 |
SlotKey | String | sys.number.bodyheight | 槽位key |
SlotValue | String | 170cm | 槽位值 |
Source | String | model | 槽位来源 |
Score | double | 0.8 | 槽位分值 |
Alias | String | 身高 | 槽位名称 |
NumericSlotValue | Object | 槽位值 |
|
Num | double | 170 | 数值部分 |
Unit | Object | 单位部分 |
|
UnitKey | String | length_si_cm | 单位唯一标识 |
UnitName | String | 厘米 | 单位中文名 |
Success | Boolean | true | 是否成功 |
Code | String | 200 | 错误码 |
Message | String | successful | 错误信息 |
1.场景来源:单轮:singleRound, 多轮:multiRounds , 2.上下模块(多轮模式下补充):contextsceneinherit(场景继承)、contextscenesemantic (基于语义的上下文)、contextscenerule(基于知识的上下文)、contextscenee2e(端到端的上下文
示例
请求示例
http(s)://[Endpoint]/?Action=RecognizeMessageForTest
&RobotCode=1cY9drMec4b2uzS2
&SessionId=aUeafnr-scgyw28f4
&ChatId=c8jd-2ncpocs
&Round=2
&Content=你好
&ContentType=TEXT、PIC、URL、CLICK、OTHERS
&UserNick=买家账号
&UserId=12345678
&StaffNick=智能助理测试账号:客服
&StaffId=12341
&SellerNick=智能助理测试账号
&SellerId=124234
&ServiceMode=AUTO
&FocusOrderId=987654321
&FocusItemId=13579
&Orders=[{"OrderId":"987654321","ParentOrderId":"1234567890","CreateTime":1611130298820,"PayTime":1611130298820,"BuyerId":"123445","SellerId":"124321143","PayStatus":"STATUS_PAID","RefundStatus":"STATUS_WAIT_SELLER_AGREE","LogisticsStatus":"STATUS_CONSIGNED","BuyerRateStatus":"RATE_STATUS_RATED","ItemId":"13579","ItemTitle":"xxx商品","ItemPic":"https://image.alicdn.com/xxxxx","Price":123.45,"Count":1,"SkuProperty":"颜色:红;材质:棉"}]
&Items=[{"ItemId":"13579","SellerId":"124321143","Title":"xxx商品","CategoryId":"3333333","ShopCategoryIds":["12343421"],"Price":123.45,"PicUrl":"https://img.alicdn.com/xxxxx","Property":{"key":"颜色:红"}}]
&ExpectedSlots=[{"SlotKey":"sys.number.bodyheight"}]
&ClientInfo={"ClientVersion":"2.0.5","ClientApp":"taobao","ClientOs":"ios"}
&IgnoreSceneSwitch=false
&公共请求参数
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<RecognizeMessageForTestResponse>
<RequestId>59C3CCE4-24B1-4277-A4A0-C0EFE4C14E0A</RequestId>
<Data>
<Scene>
<SceneDTOs>
<SceneKey>sc_wenhou</SceneKey>
<SceneSource>singleRound</SceneSource>
<contextModule>context_scene_e2e</contextModule>
</SceneDTOs>
<EmotionTag>fq_fennu</EmotionTag>
<SemanticComplete>SEMANTIC_COMPLETE</SemanticComplete>
<ItemId>13579</ItemId>
<OrderId>987654321</OrderId>
</Scene>
<Knowledges>
<KnowledgeId>1</KnowledgeId>
<KnowledgeTitle>测试知识</KnowledgeTitle>
<SceneKey>sc_wenhou</SceneKey>
<Solutions>
<SolutionId>3</SolutionId>
<KnowledgeId>1</KnowledgeId>
<SolutionType>text</SolutionType>
<SolutionSource>source</SolutionSource>
<SolutionContent>你好</SolutionContent>
<Conditions>
<ConditionType>EffectiveMode</ConditionType>
<ConditionValue>auto</ConditionValue>
</Conditions>
<ExtraContent>["emoji1","emoji2"]</ExtraContent>
<SolutionVariables>
<VariableName>变量名称</VariableName>
<VariableType>系统变量</VariableType>
</SolutionVariables>
</Solutions>
</Knowledges>
<OutputMessages>
<OutputContentType>ASK_TEXT</OutputContentType>
</OutputMessages>
<UnitSlots>
<UnitSpans>
<Start>0</Start>
<End>4</End>
<SlotKey>sys.number.bodyheight</SlotKey>
<SlotValue>170cm</SlotValue>
<Source>model</Source>
<Score>0.8</Score>
<Alias>身高</Alias>
<NumericSlotValue>
<Num>170</Num>
<Unit>
<UnitKey>length_si_cm</UnitKey>
<UnitName>厘米</UnitName>
</Unit>
</NumericSlotValue>
</UnitSpans>
</UnitSlots>
</Data>
<Success>true</Success>
<Code>200</Code>
<Message>successful</Message>
</RecognizeMessageForTestResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "59C3CCE4-24B1-4277-A4A0-C0EFE4C14E0A",
"Data" : {
"Scene" : {
"SceneDTOs" : [ {
"SceneKey" : "sc_wenhou",
"SceneSource" : "singleRound",
"contextModule" : "context_scene_e2e"
} ],
"EmotionTag" : "fq_fennu",
"SemanticComplete" : "SEMANTIC_COMPLETE",
"ItemId" : "13579",
"OrderId" : "987654321"
},
"Knowledges" : [ {
"KnowledgeId" : 1,
"KnowledgeTitle" : "测试知识",
"SceneKey" : "sc_wenhou",
"Solutions" : [ {
"SolutionId" : 3,
"KnowledgeId" : 1,
"SolutionType" : "text",
"SolutionSource" : "source",
"SolutionContent" : "你好",
"Conditions" : [ {
"ConditionType" : "EffectiveMode",
"ConditionValue" : "auto"
} ],
"ExtraContent" : "[\"emoji1\",\"emoji2\"]",
"SolutionVariables" : [ {
"VariableName" : "变量名称",
"VariableType" : "系统变量"
} ]
} ]
} ],
"OutputMessages" : [ {
"OutputContentType" : "ASK_TEXT"
} ],
"UnitSlots" : {
"UnitSpans" : [ {
"Start" : 0,
"End" : 4,
"SlotKey" : "sys.number.bodyheight",
"SlotValue" : "170cm",
"Source" : "model",
"Score" : 0.8,
"Alias" : "身高",
"NumericSlotValue" : {
"Num" : 170,
"Unit" : {
"UnitKey" : "length_si_cm",
"UnitName" : "厘米"
}
}
} ]
}
},
"Success" : true,
"Code" : "200",
"Message" : "successful"
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
429 | Throttling.Api | The request was denied due to API flow control. | 请求已超过最大允许的流量 |
500 | InternalError | The request processing has failed due to some unknown error. | 内部服务出现错误 |
访问错误中心查看更多错误码。