Skip to content

Commit b744787

Browse files
committed
调整页面结构
1 parent c4d58df commit b744787

File tree

8 files changed

+173
-130
lines changed

8 files changed

+173
-130
lines changed

docs/.vitepress/theme/constrants/route.ts

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export enum Chapters {
1818
xrobot = "/xrobot/",
1919
xrobot_device = "/xrobot/device/",
2020
xrobot_api = "/xrobot/api/",
21+
xrobot_qa = "/xrobot/qa/",
2122
}
2223

2324
// 判断一个link是否是章节link
@@ -40,9 +41,10 @@ const items_xrobot_api = [
4041
{
4142
text: "API参考",
4243
items: [
43-
// { text: "章节目录", link: "" },
44-
{ text: "绑定设备", link: "api" },
45-
{ text: "音色克隆", link: "voice-clone" },
44+
{ text: "用户API", link: "user" },
45+
{ text: "智能体API", link: "agent" },
46+
{ text: "设备API", link: "device" },
47+
{ text: "音色克隆API", link: "voice-clone" },
4648
].map((item) => apply_prefix(item, Chapters.xrobot_api)),
4749
collapsed: false,
4850
link: Chapters.xrobot_api,
@@ -53,7 +55,6 @@ const items_xrobot_device = [
5355
{
5456
text: "设备指南",
5557
items: [
56-
// { text: "章节目录", link: "" },
5758
{ text: "设备使用指南", link: "device-intro" },
5859
{ text: "设备绑定", link: "device-bind" },
5960
{ text: "设备服务通信协议", link: "device-protocol" },
@@ -65,11 +66,23 @@ const items_xrobot_device = [
6566
// 子章节
6667
];
6768

69+
const items_xrobot_qa = [
70+
{
71+
text: "常见问题",
72+
items: [
73+
{ text: "Q & A", link: "qa" },
74+
].map((item) => apply_prefix(item, Chapters.xrobot_qa)),
75+
link: Chapters.xrobot_qa,
76+
collapsed: false,
77+
},
78+
// 子章节
79+
];
80+
6881
// xrobot章节整体
6982
const items_xrobot = [
7083
{
7184
text: "Xrobot",
72-
items: [...items_xrobot_api, ...items_xrobot_device],
85+
items: [...items_xrobot_api, ...items_xrobot_device, ...items_xrobot_qa],
7386
link: Chapters.xrobot,
7487
collapsed: false,
7588
},
@@ -91,4 +104,5 @@ export const ChapterItems: Record<Chapters, ChapterItem[]> = {
91104
...items_xrobot_device,
92105
],
93106
[Chapters.xrobot_api]: [gobackItem(Chapters.xrobot), ...items_xrobot_api],
107+
[Chapters.xrobot_qa]: [gobackItem(Chapters.xrobot), ...items_xrobot_qa],
94108
};

docs/index.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
layout: home
44

55
hero:
6-
name: "Xrobot 文档中心"
6+
name: "灵矽文档中心"
77
text: "Xrobot Docs"
88
# tagline: ddddddddddddddddddddddddd
99
actions:
@@ -13,6 +13,9 @@ hero:
1313
- theme: brand
1414
text: API参考
1515
link: /xrobot/api/
16+
- theme: brand
17+
text: 常见问题
18+
link: /xrobot/qa/
1619
- theme: alt
1720
text: 去体验-七牛小智
1821
link: https://xrobo.qiniu.com/#/home
Lines changed: 6 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,9 @@
11
---
2-
title: 通过 API 来绑定设备
2+
title: 智能体API
33
---
44

5-
## 1. 用户注册
65

7-
```plain
8-
请求:
9-
POST https://xrobo.qiniu.com/xiaozhi/user/register
10-
Content-Type: application/json
11-
{
12-
"username": "",
13-
"password": "",
14-
"captcha": "etnjx", 【下面的方法获取】
15-
"mobileCaptcha": "", 【否】
16-
"captchaId": "" 【uuid:cfa94872-48b6-425b-8e6a-17b912b6b6f4"】
17-
}
18-
响应:
19-
{
20-
"code": 0,
21-
"msg": "",
22-
"data": {}
23-
}
24-
25-
```
26-
27-
```
28-
// 如何获取 captcha
29-
GET https://xrobo.qiniu.com/xiaozhi/user/captcha?uuid=cfa94872-48b6-425b-8e6a-17b912b6b6f4 [uuid 随机生成]
30-
```
31-
32-
响应:
33-
<img src="../device/imgs/device-bind/4.captcha-eg.png" class="img-center">
34-
35-
## 2. 用户登录
36-
37-
```
38-
39-
请求:
40-
POST https://xrobo.qiniuapi.com/xiaozhi/user/login
41-
Content-Type: application/json
42-
{
43-
areaCode: "+86"
44-
captcha: "xxxxx"
45-
captchaId: "d4224c42-a0a2-4e38-87a5-edc3ad03c014"
46-
mobile: ""
47-
password: "xxxx"
48-
username: "xxx"
49-
}
50-
响应:
51-
{
52-
"code": 0,
53-
"msg": "success",
54-
"data": {
55-
"token": "4fxxxxxxxxxxxxxxxxxxxxxxx", 【后续创建 agent 等操作,需要带上 token】
56-
"expire": 43200,
57-
"clientHash": "xxxxxx"
58-
}
59-
}
60-
61-
```
62-
63-
## 3. 创建智能体
6+
## 1. 创建智能体
647

658
```
669
@@ -80,65 +23,9 @@ authorization Bearer 4fxxxxxxxxxxxxxxxxxxxxxxx
8023
8124
```
8225

83-
## 4. 设备绑定【设备激活码】
8426

85-
```
8627

87-
请求:
88-
POST https://xrobo.qiniu.com/xiaozhi/device/bind/dfbea67edc2340708a03084d5b578387/605192 【605192 就是激活码】
89-
Content-Type: application/json
90-
authorization Bearer 4fxxxxxxxxxxxxxxxxxxxxxxx
91-
{
92-
93-
}
94-
响应:
95-
{
96-
"code":0,"msg":"success","data":null
97-
}
98-
```
99-
100-
## 5. 设备绑定【设备 MAC 地址】
101-
102-
```
103-
请求:
104-
POST https://xrobo.qiniu.com/xiaozhi/device/preregister
105-
Content-Type: application/json
106-
authorization Bearer 4fxxxxxxxxxxxxxxxxxxxxxxx
107-
{
108-
109-
agent_id: "dfbea67edc2340708a03084d5b578387"
110-
mac_addresses: ["0e:8e:18:32:ec:22"] 【设备 mac 地址】
111-
serial_numbers: []
112-
}
113-
响应:
114-
{
115-
"success_count":0,
116-
"failed":[{"value":"0e:8e:18:32:ec:22","reason":"已存在"}] 【错误响应】
117-
}
118-
```
119-
120-
## 6. 通话
121-
122-
[七牛云灵芯平台-设备服务通信协议](../device/device-protocol.md)
123-
124-
## 7. 解除绑定
125-
126-
```
127-
请求:
128-
POST https://xrobo.qiniu.com/xiaozhi/device/unbind
129-
Content-Type: application/json
130-
authorization Bearer 4fxxxxxxxxxxxxxxxxxxxxxxx
131-
{
132-
deviceId: "8c:bf:ea:8f:38:28"
133-
}
134-
响应:
135-
{
136-
"code":0,"msg":"success","data":null
137-
}
138-
139-
```
140-
141-
## 8. 获取智能体列表
28+
## 2. 获取智能体列表
14229

14330
```
14431
@@ -172,7 +59,7 @@ authorization Bearer 4fxxxxxxxxxxxxxxxxxxxxxxx
17259
17360
```
17461

175-
## 9. 保存智能体配置
62+
## 3. 保存智能体配置
17663

17764
```
17865
@@ -208,7 +95,7 @@ vllmModelId: "VLLM_ChatGLMVLLM"
20895
20996
```
21097

211-
## 10. 删除智能体
98+
## 4. 删除智能体
21299

213100
```
214101
@@ -226,8 +113,4 @@ authorization Bearer 4fxxxxxxxxxxxxxxxxxxxxxxx
226113
"data":null
227114
}
228115
229-
```
230-
231-
## 11. 声音复刻
232-
233-
[声音复刻](./voice-clone.md)
116+
```

docs/xrobot/api/device.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
title: 设备API
3+
---
4+
5+
6+
## 1. 设备绑定【设备激活码】
7+
8+
```
9+
10+
请求:
11+
POST https://xrobo.qiniu.com/xiaozhi/device/bind/dfbea67edc2340708a03084d5b578387/605192 【605192 就是激活码】
12+
Content-Type: application/json
13+
authorization Bearer 4fxxxxxxxxxxxxxxxxxxxxxxx
14+
{
15+
16+
}
17+
响应:
18+
{
19+
"code":0,"msg":"success","data":null
20+
}
21+
```
22+
23+
## 2. 设备绑定【设备 MAC 地址】
24+
25+
```
26+
请求:
27+
POST https://xrobo.qiniu.com/xiaozhi/device/preregister
28+
Content-Type: application/json
29+
authorization Bearer 4fxxxxxxxxxxxxxxxxxxxxxxx
30+
{
31+
32+
agent_id: "dfbea67edc2340708a03084d5b578387"
33+
mac_addresses: ["0e:8e:18:32:ec:22"] 【设备 mac 地址】
34+
serial_numbers: []
35+
}
36+
响应:
37+
{
38+
"success_count":0,
39+
"failed":[{"value":"0e:8e:18:32:ec:22","reason":"已存在"}] 【错误响应】
40+
}
41+
```
42+
43+
44+
## 3. 解除绑定
45+
46+
```
47+
请求:
48+
POST https://xrobo.qiniu.com/xiaozhi/device/unbind
49+
Content-Type: application/json
50+
authorization Bearer 4fxxxxxxxxxxxxxxxxxxxxxxx
51+
{
52+
deviceId: "8c:bf:ea:8f:38:28"
53+
}
54+
响应:
55+
{
56+
"code":0,"msg":"success","data":null
57+
}
58+
59+
```

docs/xrobot/api/user.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
title: 用户API
3+
---
4+
5+
## 1. 用户注册
6+
7+
```plain
8+
请求:
9+
POST https://xrobo.qiniu.com/xiaozhi/user/register
10+
Content-Type: application/json
11+
{
12+
"username": "",
13+
"password": "",
14+
"captcha": "etnjx", 【下面的方法获取】
15+
"mobileCaptcha": "", 【否】
16+
"captchaId": "" 【uuid:cfa94872-48b6-425b-8e6a-17b912b6b6f4"】
17+
}
18+
响应:
19+
{
20+
"code": 0,
21+
"msg": "",
22+
"data": {}
23+
}
24+
25+
```
26+
27+
```
28+
// 如何获取 captcha
29+
GET https://xrobo.qiniu.com/xiaozhi/user/captcha?uuid=cfa94872-48b6-425b-8e6a-17b912b6b6f4 [uuid 随机生成]
30+
```
31+
32+
响应:
33+
<img src="../device/imgs/device-bind/4.captcha-eg.png" class="img-center">
34+
35+
## 2. 用户登录
36+
37+
```
38+
39+
请求:
40+
POST https://xrobo.qiniuapi.com/xiaozhi/user/login
41+
Content-Type: application/json
42+
{
43+
areaCode: "+86"
44+
captcha: "xxxxx"
45+
captchaId: "d4224c42-a0a2-4e38-87a5-edc3ad03c014"
46+
mobile: ""
47+
password: "xxxx"
48+
username: "xxx"
49+
}
50+
响应:
51+
{
52+
"code": 0,
53+
"msg": "success",
54+
"data": {
55+
"token": "4fxxxxxxxxxxxxxxxxxxxxxxx", 【后续创建 agent 等操作,需要带上 token】
56+
"expire": 43200,
57+
"clientHash": "xxxxxx"
58+
}
59+
}
60+
61+
```
62+
63+
## 3. 声音复刻
64+
65+
[声音复刻](./voice-clone.md)

docs/xrobot/api/voice-clone.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 音色克隆
2+
title: 音色克隆API
33
---
44

55
## 接口基本信息

docs/xrobot/qa/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<script setup>
2+
import { Chapters } from "../../.vitepress/theme/constrants/route";
3+
4+
const chapter_root = Chapters.xrobot_qa;
5+
</script>
6+
7+
<ChapterContents :chapter=chapter_root />

0 commit comments

Comments
 (0)