# 机器人简单问答 Json 导入

# 功能说明

从 Json 批量导入机器人的所有简单问答技能配置。

# 请求 uri

/v2/bot/import/json

# 请求类型

POST

# 请求参数

# params

字段名 类型 含义
mode int 0:导入+覆盖(已存在的) 1:覆盖(先删除原来所有,再导入)
data array 技能意图列表
skill string 技能名称,分类
old_intent string 原来意图名称,如果要把 A 改成 B,这里填 A。该字段可以不填,不填的时候,以 intent 字段为准
intent string 意图名称(标准问法),如果存在,则修改,如果不存在,则新增。如果指定了old_intent ,则将old_intent修改为 intent
threshold string 相似度
disable bool 是否关闭(禁用)
questions string array 问题
answers string array 回答

# 返回参数

字段名 类型 含义
task_id string 异步任务 ID

# 示例

  • 请求示例
curl -X POST \
  https://openaiapi.weixin.qq.com/v2/bot/import/json \
  -H 'content-type: application/json' \
  -H 'X-OPENAI-TOKEN:brhziaX+cXoNHY2rRBUlQgC2YA4oPCJk65fbdb589723' \
  -H 'request_id:255i0ug8-l9q4-3801-44ft-w7csjn9e5142' \
  -H 'timestamp:1711001766' \
  -H 'nonce:abc' \
  -H 'sign:通过sign=md5(Token+str(unix_timestamp)+nonce+md5(body))生成' \
  -d '{
    "mode": 0,
    "data": [
        {
            "skill": "AAA",
            "intent": "BBC",
            "threshold": "0.9",
            "disable": true,
            "questions": [
                "q",
                "q2"
            ],
            "answers": [
                "a"
            ]
        }
    ]
}'
  • 正确返回示例
{
  "code": 0,
  "data": {
    "task_id": "179ba14fae5f4028b7c00a180cf709e3"
  },
  "msg": "",
  "request_id": "test123"
}