点赞点踩
更新时间:2025-03-06
接口描述
此接口支持对agent应用返回的对话内容进行评价(包括点赞、点踩及取消评价),并允许附加标签和评论文本,帮助进一步细化反馈数据。
权限说明
Authorization需要填写密钥。
接口定义
URL | /v2/app/conversation/feedback |
---|---|
Method | POST |
Content-Type | application/json |
Authorization | 请求签名(Bearer <AppBuilder API Key>) |
请求结构
Plain Text
1POST /v2/app/conversation/feedback HTTP/1.1
2HOST: qianfan.baidubce.com
3Authorization: Bearer <AppBuilder API Key>
4Content-Type: application/json
5
6{
7 "app_id": "d00fb80d-c5a8-45df-ad33-e9c03572c5ac",
8 "conversation_id": "76a25d49-5c0e-4979-83ea-2f9903945801",
9 "message_id": "2793aaf6-3cd9-42d4-b87e-0d9eb82c7e52",
10 "type": "downvote",
11 "flag": ["答非所问"],
12 "reason": "回答内容和问题不相关"
13}
请求参数
header参数
除公共头域外,无其它特殊头域。
请求body参数
字段 | 类型 | 必填 | 说明 |
---|---|---|---|
app_id | string | 是 | 应用id |
conversation_id | string | 是 | 对话id |
message_id | string | 是 | 对应的消息id |
type | string | 是 | 点赞点踩枚举值: cancel:取消评论 upvote:点赞 downvote:点踩 |
flag | Array[string] | 否 | 点踩原因枚举值: 答非所问 内容缺失 没有帮助 逻辑问题 偏见歧视 事实错误 |
reason | string | 否 | 对于点踩额外补充的原因。 |
响应参数
响应header参数
除公共头域外,无其它特殊头域。
响应body参数
字段 | 类型 | 必填 | 说明 |
---|---|---|---|
request_id | dict | 是 | 请求对应的request id |
code | string | 否 | 错误代码,参考错误码,当发生异常时返回 |
message | string | 否 | 错误消息,参考错误码,当发生异常时返回 |
请求curl示例
Plain Text
1curl --location 'https://qianfan.baidubce.com/v2/app/conversation/feedback' \
2--header 'Authorization: Bearer <AppBuilder API Key>' \
3--header 'Content-Type: application/json' \
4--data '{
5 "app_id": "d00fb80d-c5a8-45df-ad33-e9c03572c5ac",
6 "conversation_id": "76a25d49-5c0e-4979-83ea-2f9903945801",
7 "message_id": "2793aaf6-3cd9-42d4-b87e-0d9eb82c7e52",
8 "type": "downvote",
9 "flag": ["答非所问"],
10 "reason": "回答内容和问题不相关"
11}'
正确响应示例
Plain Text
1{
2 "request_id": "db50e6ed-ee0a-4d95-a385-6d57a05aed7b"
3}
错误响应示例
Plain Text
1{
2 "code": "InvalidParameter",
3 "message": "'conversation_id' must be uuid",
4 "request_id": "0a7c7833-544b-4e82-9dc7-8a1047179ff3"
5}