diff --git a/app_doc/app_xiaowu_api.md b/app_doc/app_xiaowu_api.md index 86f25e4..f8fc0ee 100644 --- a/app_doc/app_xiaowu_api.md +++ b/app_doc/app_xiaowu_api.md @@ -36,11 +36,11 @@ responseBody: "code": 状态码, 成功时为1, 失败为0 "dialogList":[ { - "audio": "音频,格式base64,需解码,优先播放该tts", - "audioUrl": "tts音频地址,如果audio为空则播放该tts", - "npcName": "角色名称", - "person": "声音人物", // 当audioUrl, audio 都为空的时候,使用此参数调用第三方合成 - "text": "文本信息msg,如果audioUrl为空则使用person合成tts" + "npcName": 角色名称 + "text": 文本信息msg,如果audioUrl为空则使用person合成tts + "audioUrl": tts音频地址,如果audio为空则播放该tts + "audio": 音频,格式base64,需解码,优先播放该tts + "person": // 当audioUrl, audio 都为空的时候,使用此参数调用第三方合成 } ] "aipioneerUsername": "bot的引擎账号", @@ -53,6 +53,7 @@ responseBody: "plotImgUrl": "背景图地址", "bgmUrl":"背景音乐地址", "botPostData": // bot后台直接给前端的数据,如果没有就是空 + "service": "OTHER", // 默认为OTHER,领域标识 } code: 20002 权限不足 code: 50001 作品不存在 diff --git a/app_doc/center_control_api.md b/app_doc/center_control_api.md index 5449a2f..489298e 100644 --- a/app_doc/center_control_api.md +++ b/app_doc/center_control_api.md @@ -70,6 +70,10 @@ responseBody: "ableClose": -1 // 单位*ms, -1: 表示永远不手动关闭, 0: 可手动关闭, 3000: 3秒之后可手动关闭 }, "asr":"xunfei" // ASR的渠道: xunfei, baidu, meijia + "supplierDetail":{ // ASR补充信息 + "url":"", // 调用asr地址;类型:String + "model":"" // 使用的模型;类型:String + }, "plotImgUrl": "" // 剧情点图片 } code: 20002 权限不足 diff --git a/app_doc/single_bot_audio.md b/app_doc/single_bot_audio.md index 20ff6b5..555df82 100644 --- a/app_doc/single_bot_audio.md +++ b/app_doc/single_bot_audio.md @@ -1,4 +1,4 @@ -BaseUrl: http://api-pre.heyqiwu.cn:8070 +BaseUrl: http://{BOT所在服务器地址}:8070 #### 单BOT对话接口 diff --git a/chat_server/chat_server_post_json_doc.md "b/chat_server/\346\226\260\347\274\226\350\276\221\345\231\250\346\217\220\344\272\244\350\241\250\345\215\225\346\226\207\346\241\243.md" similarity index 97% rename from chat_server/chat_server_post_json_doc.md rename to "chat_server/\346\226\260\347\274\226\350\276\221\345\231\250\346\217\220\344\272\244\350\241\250\345\215\225\346\226\207\346\241\243.md" index c6483dd..37df6dc 100644 --- a/chat_server/chat_server_post_json_doc.md +++ "b/chat_server/\346\226\260\347\274\226\350\276\221\345\231\250\346\217\220\344\272\244\350\241\250\345\215\225\346\226\207\346\241\243.md" @@ -14,7 +14,8 @@ RequestBody: "chatKey": "对话标识", "channelId": "渠道ID", "uid": "用户唯一ID", - "queryText": "用户说的话", + "queryText": "预处理之后的用户话语", + "originText": "用户原始话语", "botAccount": "bot帐号", "vars":{ "变量1":"变量1的值", diff --git "a/platform/\351\237\263\347\256\261\347\233\270\345\205\263.md" "b/platform/\351\237\263\347\256\261\347\233\270\345\205\263.md" new file mode 100644 index 0000000..ca9a128 --- /dev/null +++ "b/platform/\351\237\263\347\256\261\347\233\270\345\205\263.md" @@ -0,0 +1,88 @@ +##### 获取音箱配置 + +URL: {backUrl}/audiobox/config/info?platform={平台代号}&botAccount={BOT帐号} + +METHOD: GET + +RequestHeaders: + +| key | value | +| :----------- | :------------ | +| Content-Type | application/json;charset=utf-8 | +| Authorization | TOKEN | +| botAccount | bot帐号 | +| groupId | 组ID | +| mul | true | +| projectId | 作品ID | + +RequestParams: +| key | describe | +| :----------- | :------------ | +| platform | 音箱平台代号,值有 xiaodu, xiaoai, spirit | +| botAccount | BOT帐号 | + +ResponseBody: +``` +SUCCESS: +{ + "code": 1, + "msg": "成功", + "data": { + "publicKey": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDTFiGHbokGbdAe7CGej1teYKXDu2J/vWW2jEh8MyajXgwGc4eh1xe69GaUHMN1xFijwD1srieXqmX+OlvzciUJHHXVqwP+Tr3GcNbgJs07fLFs9c6JLdnur+krnL7x6D8Sxo30yloekK/tsSv+cJnTjqYpC/67h9mb4mI7aNnATwIDAQAB", // 公钥 + "url": "https://audio-box.heyqiwu.cn/xiaodu/single/bot/botAccount%3D6080626246%26serverCode%3Dhw-gz25" // 地址 + } +} +``` + +Example: +``` +curl --location --request GET 'http://hw-gz25.heyqiwu.cn:18082/audiobox/config/info?platform=xiaodu&botAccount=6080626246' \ +--header 'Authorization: Basic ZXlKaGJHY2lPaUpJVXpJMU5pSjkuZXlKcFlYUWlPakUyTVRnMU16YzJOVGdzSW1WNGNDSTZNVFl4T0RVME5EZzFPQ3dpWVhWMGFHOXlhWFI1SWpveExDSnBaQ0k2TXpkOS4zeVRaUUdWVEdZeFJYRzBOM1hfTU5QbXZVOTczd3BLZlVSOW5Oa2pEYVZvOnMwMHBlcnMzY3JldA==' \ +--header 'botAccount: 6080626246' \ +--header 'groupId: 49' \ +--header 'mul: true' \ +--header 'projectId: 1' +``` + +##### 上传天猫认证文件 + +URL: {backUrl}/audiobox/spirit/authority/upload?botAccount={BOT帐号} + +METHOD: POST + +RequestHeaders: + +| key | value | +| :----------- | :------------ | +| Content-Type | application/json;charset=utf-8 | +| Authorization | TOKEN | +| botAccount | bot帐号 | +| groupId | 组ID | +| mul | true | +| projectId | 作品ID | + +RequestBody: +``` +FormData类型 +key: file +value: 二进制文件 +``` +ResponseBody: +``` +SUCCESS: +{ + "code": 1, + "msg": "成功", + "data": null +} +``` +Example: +``` +curl --location --request POST 'http://hw-gz25.heyqiwu.cn:18082/audiobox/spirit/authority/upload?botAccount=6080626246' \ +--header 'Authorization: Basic ZXlKaGJHY2lPaUpJVXpJMU5pSjkuZXlKcFlYUWlPakUyTVRnME9ERTNNelFzSW1WNGNDSTZNVFl4T0RRNE9Ea3pOQ3dpWVhWMGFHOXlhWFI1SWpveExDSnBaQ0k2TXpkOS5ON2lDbk9pdHBkSlgxeDRtMEloS0FYZGJ6OEE3ak1CcXZudkpLaG9MN1hrOnMwMHBlcnMzY3JldA==' \ +--header 'botAccount: 6080626246' \ +--header 'groupId: 49' \ +--header 'mul: true' \ +--header 'projectId: 1' \ +--form 'file=@"/home/feng/tmp/test.txt"' +``` \ No newline at end of file diff --git "a/platform/\351\242\206\345\237\237\351\205\215\347\275\256.md" "b/platform/\351\242\206\345\237\237\351\205\215\347\275\256.md" new file mode 100644 index 0000000..786256a --- /dev/null +++ "b/platform/\351\242\206\345\237\237\351\205\215\347\275\256.md" @@ -0,0 +1,45 @@ +##### 获取领域配置 + +URL: {backUrl}/domain/config + +METHOD: GET + +RequestHeaders: + +| key | value | +| :----------- | :------------ | +| Content-Type | application/json;charset=utf-8 | +| Authorization | TOKEN | +| botAccount | bot帐号 | +| groupId | 组ID | +| mul | true | +| projectId | 作品ID | + +ResponseBody: +``` +SUCCESS: +{ + "code": 1, + "msg": "成功", + "data": [ + { + "id": "SHOPPING", + "name": "购物" + }, + { + "id": "OTHER", + "name": "其他" + } + ] +} +``` + +Example: +``` +curl --location --request GET 'http://hw-gz25.heyqiwu.cn:18082/domain/config' \ +--header 'Authorization: Basic ZXlKaGJHY2lPaUpJVXpJMU5pSjkuZXlKcFlYUWlPakUyTVRnMU5qQTFPVEVzSW1WNGNDSTZNVFl4T0RVMk56YzVNU3dpWVhWMGFHOXlhWFI1SWpveExDSnBaQ0k2TXpkOS5nVXNieTdrenBtNkdlUXhadXVxRnpPUlRjTVA0Ry11bjZKdHQ2cUtlME04OnMwMHBlcnMzY3JldA==' \ +--header 'botAccount: 6080626246' \ +--header 'groupId: 49' \ +--header 'mul: true' \ +--header 'projectId: 1' +``` \ No newline at end of file diff --git "a/tts/\350\257\255\351\237\263\345\220\210\346\210\220.md" "b/tts/\350\257\255\351\237\263\345\220\210\346\210\220.md" new file mode 100644 index 0000000..d20efca --- /dev/null +++ "b/tts/\350\257\255\351\237\263\345\220\210\346\210\220.md" @@ -0,0 +1,101 @@ +- 基本地址 + - 测试环境: http://api-pre.heyqiwu.cn:9663 + +#### 获取不同声音的代号 + +URL: {基本地址}/api/speakers + +METHOD: GET + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/json;charset=utf-8 | + +ResponseBody: +```json +{ + "online": { // 表示在线,对外暂时只用这里面的人物声音 + "ProTencent17": { // key表示人物声音的编号 + "name": "腾智美(客服女声(精品))", // 名称 + "sex": "女", // 人物的性别 + "mood": [ + "正常" // 人物声音的情绪 + ], + "third_party": true // 是否是第三方的声音 + } + } +} +``` +Example: +``` +curl --location --request GET 'http://api-pre.heyqiwu.cn:9663/api/speakers' +``` + + +#### 合成语音 + +URL: {基本地址}/api/tts_ls + +METHOD: GET + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/json;charset=utf-8 | + +RequestBody: +```json +{ + "botname": "12345678", // bot的帐号 + "text_info_ls": [ + { + "person": "ProTencent17", // 人物声音的编号 + "tone":"正常", // 人物声音的情绪 + "text": "你好,世界!" // 需要合成的文本 + }, + { + "person": "ProTencent17", // 人物声音的编号 + "tone":"正常", // 人物声音的情绪 + "text": "Hello World!" // 需要合成的文本 + } + ] +} +``` + +ResponseBody: +```json +{ + "audio": [ // 返回的顺序和text_info_ls发送顺序一致 + { + "url": "http://cdn-test.heyqiwu.cn/api/audio/cache/12345678/?filename=/12345678/ProTencent17/正常/5082079d92a8ef985f59e001d445ff20.mp3&exist=1" // 合成完成之后的地址 + }, + { + "url": "http://cdn-test.heyqiwu.cn/api/audio/cache/12345678/?filename=/12345678/ProTencent17/正常/ed076287532e86365e841e92bfc50d8c.mp3&exist=1" // 合成完成之后的地址 + } + ], + "status": 200 // 状态码,200表示成功,其他表示失败 +} +``` +Example: +``` +curl --location --request POST 'http://api-pre.heyqiwu.cn:9663/api/tts_ls' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "botname": "12345678", + "text_info_ls": [ + { + "person": "ProTencent17", + "tone":"正常", + "text": "你好,世界!" + }, + { + "person": "ProTencent17", + "tone":"正常", + "text": "Hello World!" + } + ] +}' +``` \ No newline at end of file