mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-23 15:43:54 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ac7e5be9c | ||
|
|
ebfcfe148d | ||
|
|
435860d339 | ||
|
|
b7cb97a373 | ||
|
|
e7b1daf021 | ||
|
|
bbf2febd6d | ||
|
|
586520f321 | ||
|
|
22262be7cd | ||
|
|
9021eac54e | ||
|
|
b72967bcc3 | ||
|
|
469f836a82 | ||
|
|
1e8960f37c | ||
|
|
7aad8da6f6 | ||
|
|
dd24dc0abc | ||
|
|
4f6cdc745f | ||
|
|
48087582c2 | ||
|
|
fbb0e02fdd | ||
|
|
d7ef85f6d2 | ||
|
|
2f2bd38f1e | ||
|
|
bc48a169f4 | ||
|
|
e777db6ef3 | ||
|
|
60498b24ae | ||
|
|
caae839b1d | ||
|
|
6a14d694b0 | ||
|
|
d86387971a | ||
|
|
ff1076deac | ||
|
|
5b986bf57f | ||
|
|
f1b2080d99 | ||
|
|
ed41de7b8e | ||
|
|
42a132f5cd | ||
|
|
7b2f6c2eee | ||
|
|
ee5a53d67d | ||
|
|
f691e9f0c9 | ||
|
|
7a32c208fb | ||
|
|
6984763ddc | ||
|
|
d6c3659d70 | ||
|
|
d51c2a241c | ||
|
|
a1d37b61e4 | ||
|
|
8b24151756 | ||
|
|
a9854756ec | ||
|
|
f95bed4189 | ||
|
|
f7bf29a5e4 | ||
|
|
5913dbbb7b | ||
|
|
f6bb55ae90 | ||
|
|
33e712b5fb | ||
|
|
1c26faddc4 | ||
|
|
ac887139ce | ||
|
|
bc2c68e89f | ||
|
|
cdc2363af1 | ||
|
|
ba07c623df | ||
|
|
344a73b87b | ||
|
|
9a81b6c0ee | ||
|
|
96f65e7c35 | ||
|
|
ff2cdeb483 | ||
|
|
fe8b82fcda | ||
|
|
f007e6614d | ||
|
|
0eafd37bf6 | ||
|
|
af3bc09403 | ||
|
|
90ebb8d499 | ||
|
|
f2c6cb8641 | ||
|
|
116a6973cf | ||
|
|
769407a5b0 | ||
|
|
a4583e273a | ||
|
|
645462abd0 | ||
|
|
b49c4520f9 | ||
|
|
acf45ae8ad | ||
|
|
0d1c18f5dd | ||
|
|
7b020ba55c | ||
|
|
cc081bc9eb | ||
|
|
187c2ee977 | ||
|
|
00ab407b04 | ||
|
|
bda7a90551 | ||
|
|
71b72f5b51 | ||
|
|
61fd8b21e0 | ||
|
|
9a4610ab04 | ||
|
|
fd8296262e | ||
|
|
63dfcf6659 | ||
|
|
8897b4f3c6 | ||
|
|
8d46585101 | ||
|
|
6967b2bce2 | ||
|
|
16a38bbfc4 | ||
|
|
861df73eab | ||
|
|
fa9809bee1 | ||
|
|
2a93745d01 | ||
|
|
85fab64588 | ||
|
|
b22f430e98 | ||
|
|
c3da3e937e | ||
|
|
4ea3bea85c | ||
|
|
520e24a54e | ||
|
|
e82cc53bfb | ||
|
|
3bddc1c722 | ||
|
|
f68fc5c90d | ||
|
|
ea8001a9c8 | ||
|
|
ca10d7290d | ||
|
|
7b3db72285 | ||
|
|
3639871dd2 | ||
|
|
5fb7fbe08f | ||
|
|
73f8a0977c | ||
|
|
87b99e0353 | ||
|
|
795dcec698 | ||
|
|
4f61d21d17 | ||
|
|
8a84428724 | ||
|
|
46f1dee20e | ||
|
|
75e24af858 | ||
|
|
fae6db2198 | ||
|
|
32aea32e2c | ||
|
|
63d9dae18b | ||
|
|
041c254ea4 | ||
|
|
378d68aba9 | ||
|
|
4076136fe4 | ||
|
|
1e6e250dac | ||
|
|
42b495d556 | ||
|
|
c88d709d56 | ||
|
|
fa523dc615 | ||
|
|
8718a07c7e | ||
|
|
39124d4930 | ||
|
|
8dbc0b9689 | ||
|
|
9fd3501605 | ||
|
|
4f72a516d3 | ||
|
|
e4cfabeb7e | ||
|
|
85a83727fd | ||
|
|
a31e16c1d9 | ||
|
|
3ab5dc49ac | ||
|
|
005dc55db3 | ||
|
|
ba1cf14ed4 | ||
|
|
6da32a60c0 | ||
|
|
ea9778f422 | ||
|
|
f0b176768d | ||
|
|
5aa671d6ff | ||
|
|
d02d094219 | ||
|
|
f5b4bae927 | ||
|
|
19fdf5d917 | ||
|
|
9682f615cf | ||
|
|
8162adeca1 | ||
|
|
ba2749430f | ||
|
|
e3088f4410 | ||
|
|
614b662e3d | ||
|
|
f5b9995f89 | ||
|
|
0ddd9ba8ff | ||
|
|
9c8d614d78 | ||
|
|
0075550229 | ||
|
|
4a547be882 | ||
|
|
d721270bed | ||
|
|
fe2e178b19 | ||
|
|
21337e5046 | ||
|
|
1c8b271e20 | ||
|
|
3d1160b6bb | ||
|
|
086c4a55e6 | ||
|
|
889f2f9a75 | ||
|
|
07b686be14 | ||
|
|
4d6b453485 | ||
|
|
9909045f9d | ||
|
|
b0dc4d88db | ||
|
|
bbf3858735 | ||
|
|
73573e2f12 | ||
|
|
99e136786e | ||
|
|
205be0e4ec | ||
|
|
2e64f45a31 | ||
|
|
818b4f2f6d | ||
|
|
5d72f9f79d | ||
|
|
22d0dcdf58 | ||
|
|
122d1def1d | ||
|
|
0ee349df2d | ||
|
|
4dde66339b | ||
|
|
0064f975c2 | ||
|
|
43234f4798 | ||
|
|
48034fc000 | ||
|
|
3fc33e9095 | ||
|
|
da71dce860 | ||
|
|
b7e4408a0f | ||
|
|
4f4f8ca54e | ||
|
|
99c12a0fed | ||
|
|
dcd0ef3f40 | ||
|
|
2f53b921fe | ||
|
|
0f16a8d31f | ||
|
|
3051dc8327 | ||
|
|
c313997a61 | ||
|
|
07c0c764d3 | ||
|
|
e339a501aa | ||
|
|
f2c541b4ab | ||
|
|
206af1c074 | ||
|
|
344729c9a6 | ||
|
|
3b1c2d3b1b | ||
|
|
3660af9619 | ||
|
|
4905ba836c | ||
|
|
4b573fb4e2 | ||
|
|
6ae0af278b | ||
|
|
15650e1a6c | ||
|
|
ce00c862fe | ||
|
|
a50229431b | ||
|
|
275102f5b7 | ||
|
|
ff6286ffcc | ||
|
|
974fe6c3b7 | ||
|
|
b78292b270 | ||
|
|
3559a7018c | ||
|
|
9368885355 | ||
|
|
3222d6175d | ||
|
|
28f9f23449 | ||
|
|
5e7d192ebc | ||
|
|
d6a32416d7 | ||
|
|
6a2c01763e | ||
|
|
e1dd272708 | ||
|
|
3e7bc0606a | ||
|
|
9d9ca1475d | ||
|
|
43ddc0135c | ||
|
|
98f907a97b | ||
|
|
b2ddf060c9 | ||
|
|
5e612276db | ||
|
|
cbb293e7fa | ||
|
|
fdb050f6ed | ||
|
|
f83ddf79fa | ||
|
|
95b340a7a3 | ||
|
|
d46ac89e58 | ||
|
|
80b0912f84 | ||
|
|
e0b4431064 | ||
|
|
e3f16f91cf | ||
|
|
5f39e5c308 | ||
|
|
83304c9ff4 | ||
|
|
863cfb575c | ||
|
|
2944040648 | ||
|
|
5f19b9b0d0 | ||
|
|
2948ed091c | ||
|
|
bfa638e17f | ||
|
|
97ee397b54 | ||
|
|
f7fbe7efbe | ||
|
|
ce6b0bd099 | ||
|
|
8643960104 | ||
|
|
b4549ebc59 | ||
|
|
a602cddd05 | ||
|
|
c4278864d1 | ||
|
|
7094548ecf | ||
|
|
363fffada8 | ||
|
|
c2c3eb7106 | ||
|
|
8e19a64f15 | ||
|
|
9042b7e6d7 | ||
|
|
ad1855cfb5 | ||
|
|
efa0d1095d | ||
|
|
a8c13d740b | ||
|
|
7475e9829f | ||
|
|
b7dde1dae2 | ||
|
|
778c4560fd | ||
|
|
fa31096cd8 | ||
|
|
fd1dd39463 | ||
|
|
ecd3e12a41 | ||
|
|
0a8121e849 | ||
|
|
e93f9d7111 | ||
|
|
3bdccfea62 | ||
|
|
fdf98985a1 | ||
|
|
6c3609e79e | ||
|
|
5fa50339b4 | ||
|
|
f0c95bc987 | ||
|
|
a9aa709502 | ||
|
|
8edc23b888 | ||
|
|
c4fc510a27 | ||
|
|
134000996b | ||
|
|
111909c26d | ||
|
|
f66966d72f | ||
|
|
1f6a89ada5 | ||
|
|
31a1180b79 | ||
|
|
77b4a416a9 | ||
|
|
06a2e6fbfa | ||
|
|
c8a28e98d6 | ||
|
|
564adbd851 | ||
|
|
ad93f43145 | ||
|
|
2bf1123647 | ||
|
|
a6ff6426e9 | ||
|
|
da7a6933f5 | ||
|
|
54cac0d2fd | ||
|
|
de7aedab96 | ||
|
|
7fe718c887 | ||
|
|
36eaefb8b0 | ||
|
|
3a61ec84b3 | ||
|
|
dadf05ab4e | ||
|
|
c1bf92d243 | ||
|
|
c1959e0795 | ||
|
|
40a6b7434b | ||
|
|
24519a2732 | ||
|
|
c190abe4b1 | ||
|
|
07d5b3cd2a | ||
|
|
81e923b4f7 | ||
|
|
bcb51729a5 | ||
|
|
a731c1d01f | ||
|
|
0bb5a37ace | ||
|
|
a711827996 | ||
|
|
8f854e6f74 | ||
|
|
f1b5afbf5c | ||
|
|
84f6930389 | ||
|
|
f415dd4482 | ||
|
|
927f65e106 | ||
|
|
4b6b3082c7 | ||
|
|
4c550245db | ||
|
|
341ed22370 | ||
|
|
6851ccacf3 | ||
|
|
815af687ea | ||
|
|
e9373b59c8 | ||
|
|
3f3f3fcd57 | ||
|
|
d003e66310 | ||
|
|
e6108ccbbd | ||
|
|
a01f01198c | ||
|
|
cc96eaeb8f | ||
|
|
e25ca3d1d3 | ||
|
|
9c111b2d5e | ||
|
|
436a01fb6e | ||
|
|
9b6620dd4a | ||
|
|
85919e800e | ||
|
|
a2023a65c0 | ||
|
|
619370f36c | ||
|
|
ea6c0e691f | ||
|
|
de0d82f1e8 | ||
|
|
c8a26d9c5e | ||
|
|
d89b842586 | ||
|
|
6dd3ceea7e | ||
|
|
5fe68030b0 | ||
|
|
5215105440 | ||
|
|
fb69eb751a | ||
|
|
b903d51592 | ||
|
|
d1f6774e58 | ||
|
|
9e55df4141 | ||
|
|
b169e9413f | ||
|
|
c511766e9d | ||
|
|
e6f9ceb7fa | ||
|
|
eab8b48c9c | ||
|
|
46abb1009a | ||
|
|
2a42d86db0 | ||
|
|
68b0d9654c | ||
|
|
8f96cf13ac | ||
|
|
dbd179e507 | ||
|
|
9541e85600 | ||
|
|
9ecd829bfa | ||
|
|
fd4cff73ae | ||
|
|
1d6c4751de | ||
|
|
e066c1d6a1 | ||
|
|
85f5404b3b | ||
|
|
33c5893d32 | ||
|
|
b597cb0686 | ||
|
|
c5e288ca9c | ||
|
|
38d984f225 | ||
|
|
628c642040 | ||
|
|
d217cc4dd0 | ||
|
|
4f0e54b390 | ||
|
|
d7f89be31c | ||
|
|
53bcee7032 | ||
|
|
96991ae5ef | ||
|
|
068bcde451 | ||
|
|
0dda4f5646 | ||
|
|
6c57ce9dd2 | ||
|
|
6ac67a7e41 | ||
|
|
a23a585ad8 | ||
|
|
eba9562e81 | ||
|
|
ce49b409ac | ||
|
|
7222f68d4d | ||
|
|
f3f0d62f12 | ||
|
|
6e7c86e159 | ||
|
|
f5565f6700 | ||
|
|
e8d0bb0c54 | ||
|
|
33d70ccc96 | ||
|
|
53313a26af | ||
|
|
7ba180752a | ||
|
|
19736e66ad | ||
|
|
a00f8e4b76 | ||
|
|
7d9895cf5b | ||
|
|
d5f804bbb3 | ||
|
|
33a385cfa8 | ||
|
|
109d924591 | ||
|
|
a825eb3d4c | ||
|
|
3fb40677a4 | ||
|
|
833971cd28 | ||
|
|
d14b14bce9 | ||
|
|
53e26821ad | ||
|
|
1a7c06eb81 | ||
|
|
6cdbe45313 | ||
|
|
42a5b4892d | ||
|
|
9f4508b0c7 | ||
|
|
b2123ff01a | ||
|
|
43ead841a4 | ||
|
|
33b4794e83 | ||
|
|
fb91e6b1dd | ||
|
|
4a4dbf123e | ||
|
|
0decedd6a1 | ||
|
|
d2e3a63418 | ||
|
|
15b3f0a8f5 | ||
|
|
5c261528d0 | ||
|
|
8b2bbec0b9 | ||
|
|
8b3a4ad163 | ||
|
|
b3e272281b | ||
|
|
06a90d6266 | ||
|
|
6eb7acaf73 | ||
|
|
2e092a7880 | ||
|
|
515f669546 | ||
|
|
7699596597 | ||
|
|
34dd325a1d | ||
|
|
d33cdd978d | ||
|
|
0da9b4a69c | ||
|
|
7fc2eeaaa5 | ||
|
|
508529f66e | ||
|
|
dc170edbc1 | ||
|
|
85e65cf9e8 | ||
|
|
41887ef431 | ||
|
|
5dbf796fa9 | ||
|
|
20f601e607 | ||
|
|
c8d2d2255d | ||
|
|
5eaaf9f01d | ||
|
|
d6697948c2 | ||
|
|
f88abd7638 | ||
|
|
fbfc408e94 | ||
|
|
5ac1a1d6a5 | ||
|
|
3a74b30a0e | ||
|
|
fe0a6852e9 | ||
|
|
bfa04743e2 | ||
|
|
48094f7e37 | ||
|
|
60521b0a7e | ||
|
|
401deff2c3 | ||
|
|
6ffa325b73 | ||
|
|
eeedfc8ac9 | ||
|
|
aba7172a03 | ||
|
|
192f6f198f | ||
|
|
43c9d85b8f | ||
|
|
6d5935fb27 | ||
|
|
efbef4ff5b | ||
|
|
e4c99b9351 | ||
|
|
11e328ea6a | ||
|
|
8879907e38 | ||
|
|
885d72c4f7 | ||
|
|
4538542c25 | ||
|
|
3d509d75dc | ||
|
|
0ef73d7c3e | ||
|
|
6da90c6a97 | ||
|
|
bacdb794da | ||
|
|
2ece3f399b | ||
|
|
68b539db15 | ||
|
|
7a7bfa26f6 | ||
|
|
5f229351c8 | ||
|
|
82125c4933 | ||
|
|
33f75d26c1 | ||
|
|
3c4d702bc1 | ||
|
|
db8d100edb | ||
|
|
6f7e8978ca | ||
|
|
856bf2c574 | ||
|
|
b10cfa6b24 | ||
|
|
d3d329bd43 | ||
|
|
f358011900 | ||
|
|
cd6c3e4f79 | ||
|
|
ee7342de9d | ||
|
|
6120d49a35 | ||
|
|
381f8ea578 | ||
|
|
a3e2073dc6 | ||
|
|
f7bd858fea | ||
|
|
80d10cf4b5 | ||
|
|
ba1fb16f2d | ||
|
|
5f574667d3 | ||
|
|
c470bb1db1 | ||
|
|
26ed8ca33f | ||
|
|
313f5b1982 | ||
|
|
f3f0c24e16 | ||
|
|
fe2539ac97 | ||
|
|
dd1a430c21 | ||
|
|
621634697e | ||
|
|
fb5c35e6c9 | ||
|
|
228596dbe3 | ||
|
|
74baa85340 | ||
|
|
8f6e9ca54d | ||
|
|
19420d0bb3 | ||
|
|
770c8c8a9f | ||
|
|
252a34090a | ||
|
|
bde5ef4594 | ||
|
|
6eddf081de | ||
|
|
4645c50f6d | ||
|
|
3f6e66b1ce | ||
|
|
106889b0dd | ||
|
|
785b43464b | ||
|
|
03da60dd12 | ||
|
|
ec372f65ec | ||
|
|
cfba4c45b6 | ||
|
|
657d03f49d | ||
|
|
b4dd78b2ed | ||
|
|
1ebe7b8f71 | ||
|
|
30e7a71497 | ||
|
|
ff1de6c7e3 | ||
|
|
9e39883276 | ||
|
|
0f249ae1db | ||
|
|
31ada101b0 | ||
|
|
1b52a7168b | ||
|
|
83a3d0eabe | ||
|
|
080c6b4dfb | ||
|
|
ea50288c5b | ||
|
|
5d439a4168 | ||
|
|
3c46e16494 | ||
|
|
39cd0fe1ac | ||
|
|
16c0be74c9 | ||
|
|
732828612e | ||
|
|
7344b81c98 | ||
|
|
1e5b03edb5 | ||
|
|
b15b5af349 | ||
|
|
5242430b6d | ||
|
|
c39968a5bf | ||
|
|
8b4f9ab20e | ||
|
|
527e6050ce | ||
|
|
1d162cb874 | ||
|
|
c197f5c942 | ||
|
|
3a4c0bb888 | ||
|
|
38d50f4275 | ||
|
|
25a3b648fc | ||
|
|
d3638164fe | ||
|
|
1c2a61fd34 | ||
|
|
f81c4aa970 | ||
|
|
3caa4ec6e8 | ||
|
|
5e48a2274a | ||
|
|
7f7c980522 | ||
|
|
bbab4ebc86 | ||
|
|
8bae0c8ac5 | ||
|
|
a5e4aa1300 | ||
|
|
48313bc302 | ||
|
|
f0261a8236 | ||
|
|
84c194dd34 | ||
|
|
920e24b4ff | ||
|
|
43d82343a3 | ||
|
|
320d246a83 | ||
|
|
faea50f99d | ||
|
|
ef59798d70 | ||
|
|
6781eca56a | ||
|
|
c1f0853271 | ||
|
|
d4cda5c104 | ||
|
|
f9bd5bb995 | ||
|
|
f1c2b5cb3f | ||
|
|
579af29a73 | ||
|
|
0b0fd142a3 | ||
|
|
9e20a53ca0 | ||
|
|
8768240efe | ||
|
|
b429760bd5 | ||
|
|
218cd35c3d | ||
|
|
146a039c19 | ||
|
|
9a3e1fa9c8 | ||
|
|
fa194af9bb | ||
|
|
7bdb2efd8b | ||
|
|
6c325f68ac | ||
|
|
3113c5cf62 | ||
|
|
c6527d7df9 | ||
|
|
e86974b7b2 | ||
|
|
e37618423d | ||
|
|
c640662663 | ||
|
|
3fe1acd153 | ||
|
|
9eaaec75a5 | ||
|
|
1ad86153c7 | ||
|
|
09a58ba5bf | ||
|
|
867ab7aca2 | ||
|
|
5dda2f731a | ||
|
|
71c6f04f99 | ||
|
|
80c7295784 | ||
|
|
e2869f1f50 | ||
|
|
dc55f8d7ab | ||
|
|
925ed1ec0c | ||
|
|
8064cdf1a2 | ||
|
|
46b3757c13 | ||
|
|
5050ea7ac1 | ||
|
|
bdd0ec41d5 | ||
|
|
d121b4d0e1 | ||
|
|
d45bf5f60a | ||
|
|
94a43432fc | ||
|
|
b55e5870db | ||
|
|
2afd90f2d4 | ||
|
|
4001378904 | ||
|
|
6c313e60eb | ||
|
|
3f6fd3144b | ||
|
|
e5e4aa4836 | ||
|
|
18e84a90c9 | ||
|
|
b37f87d231 | ||
|
|
7c592e33fe | ||
|
|
471749f6ff | ||
|
|
637b528aad | ||
|
|
502ef997d4 | ||
|
|
b76e354b86 | ||
|
|
988bb90528 | ||
|
|
578ed62d18 | ||
|
|
0d6d44bed9 | ||
|
|
918c47669c | ||
|
|
8ad22dc082 | ||
|
|
c3d94a5c21 | ||
|
|
48d72e373e | ||
|
|
c667c8ee79 | ||
|
|
aebc1c1597 | ||
|
|
cd113a5351 | ||
|
|
b7ca7cbdb5 | ||
|
|
b3b270e999 | ||
|
|
ad3c420191 | ||
|
|
8a4f786c0b | ||
|
|
d99d122416 | ||
|
|
5a5f670272 | ||
|
|
be533b7814 | ||
|
|
9a6e5c9f33 | ||
|
|
9d420b4304 | ||
|
|
acb1fdc51d | ||
|
|
c6f1fa96bb | ||
|
|
7315e2e5d2 | ||
|
|
429fa0032a | ||
|
|
f2a7016119 | ||
|
|
47e199a59e | ||
|
|
172b097a11 | ||
|
|
4f2693505b | ||
|
|
ae321b26af | ||
|
|
6de4a29dbf | ||
|
|
37f0d2398e | ||
|
|
5c68be6636 | ||
|
|
ee2ac5f46f | ||
|
|
99bc55f256 | ||
|
|
5d860e5b45 | ||
|
|
a2069456b2 | ||
|
|
2dc0c101c6 | ||
|
|
4fc306bccf | ||
|
|
4966a42ed8 | ||
|
|
c3ffa9d393 | ||
|
|
f16906ad9d | ||
|
|
1b28e8ddcb | ||
|
|
ff3e308ce8 | ||
|
|
f6219bd58e | ||
|
|
92bd207ae5 | ||
|
|
bbca561dd0 | ||
|
|
833f379aa1 | ||
|
|
de0eda1b6c | ||
|
|
96da84dad4 | ||
|
|
59f55a4187 | ||
|
|
ab5e91c07b | ||
|
|
dca5f2c837 | ||
|
|
33c60ba320 | ||
|
|
a4fad9e796 | ||
|
|
ee0d89d8d2 | ||
|
|
5bead86fd5 | ||
|
|
79eefb651f | ||
|
|
cbb74170ea | ||
|
|
c6835ddd11 | ||
|
|
c57427efbc | ||
|
|
466eae4c76 | ||
|
|
4b7b80aa2d | ||
|
|
dc5ff21002 | ||
|
|
75807c5845 | ||
|
|
ce1bdea54d | ||
|
|
25801bf1d4 | ||
|
|
c02f2105d7 | ||
|
|
b0ceb0b06d | ||
|
|
b6ba06ec97 | ||
|
|
d09fa0c1f6 | ||
|
|
ff02c11558 | ||
|
|
e8f5025e4d | ||
|
|
90980652ce | ||
|
|
2527c16e18 | ||
|
|
09dee65239 | ||
|
|
eaf4f4b08e | ||
|
|
d2b05c614c | ||
|
|
9383a44106 | ||
|
|
3ec5ed9d22 | ||
|
|
482aaf453c | ||
|
|
bf9277671e | ||
|
|
588a391d90 | ||
|
|
65f7e794bc | ||
|
|
987a72a3aa | ||
|
|
1aab88e8df | ||
|
|
a30ef520fb | ||
|
|
ea15ed39f5 | ||
|
|
9b214279ba | ||
|
|
873daf093d | ||
|
|
289f2ad199 | ||
|
|
7e15301d2b | ||
|
|
1792bf299b | ||
|
|
4cde66e7de | ||
|
|
3eeace5d5f | ||
|
|
7215ded7e8 | ||
|
|
1c6ee46d61 | ||
|
|
ca87b23d15 | ||
|
|
fd47ce8e69 | ||
|
|
a82cf6e300 | ||
|
|
0008ca6335 | ||
|
|
f127f38cbc | ||
|
|
f29f4086b3 | ||
|
|
b65ae6dc55 | ||
|
|
11b4b06c92 | ||
|
|
98011272ff | ||
|
|
222f3f1c93 | ||
|
|
a2fbc07a78 | ||
|
|
4d728663a6 | ||
|
|
8b1fe1dbcf | ||
|
|
1c836fff39 | ||
|
|
53ee24f828 | ||
|
|
e1056f72e1 | ||
|
|
67b89b5527 | ||
|
|
06c3a8d761 | ||
|
|
e93f95254a | ||
|
|
e38609e9b8 | ||
|
|
4d631cbfe4 | ||
|
|
838d9a3927 | ||
|
|
8e12e75b2f | ||
|
|
0698a6d8ac | ||
|
|
57c2af413e | ||
|
|
ec07088c13 | ||
|
|
121318dc37 | ||
|
|
b1e1a29145 | ||
|
|
e59df53c99 | ||
|
|
e19fb24009 | ||
|
|
419e7f6dcc | ||
|
|
b3f13e274f | ||
|
|
cdf0f91251 | ||
|
|
32ecbe55fc | ||
|
|
58b71f5039 | ||
|
|
b17a265378 | ||
|
|
ba446d2374 | ||
|
|
18d66270d6 | ||
|
|
2d02349c55 | ||
|
|
cc9d5306e6 | ||
|
|
5149a8049a | ||
|
|
cf3c955b73 | ||
|
|
cde093dd20 | ||
|
|
455b3df5ae | ||
|
|
85741137a5 | ||
|
|
cc2fdf1b9b | ||
|
|
a70542265a | ||
|
|
5a9cc89b64 | ||
|
|
5586515327 | ||
|
|
4d14caf0d4 | ||
|
|
47b44bb124 | ||
|
|
eb743ab577 | ||
|
|
d6344bde5e | ||
|
|
7ce1672d98 | ||
|
|
4e3701e62c | ||
|
|
a035ed525a | ||
|
|
dbea7ae11e | ||
|
|
26127e9b4a | ||
|
|
7035a57cf1 | ||
|
|
aee9bdc514 | ||
|
|
9018422ecb | ||
|
|
da8d8c53c0 | ||
|
|
2c428a380e | ||
|
|
bde50e661d | ||
|
|
2beeb825cf | ||
|
|
371dab1282 | ||
|
|
3ba437c937 | ||
|
|
4b2d7da4e5 | ||
|
|
d00592020e | ||
|
|
e0b24f4e59 | ||
|
|
4b7be99837 | ||
|
|
99db948b96 | ||
|
|
2b3e205cda | ||
|
|
c9b7d77094 | ||
|
|
f3818167f3 | ||
|
|
55d6c2a193 | ||
|
|
6cfb6a8f43 | ||
|
|
396c3eb18b | ||
|
|
d8c4c1f207 | ||
|
|
268ce9fff3 | ||
|
|
bbc3b44336 | ||
|
|
fb223984d3 | ||
|
|
9f21711cae | ||
|
|
c139701468 | ||
|
|
66d3bcfa13 | ||
|
|
ff048797a1 | ||
|
|
ad6607b7f5 | ||
|
|
c992ed48da | ||
|
|
bdf9cda4c5 | ||
|
|
c85ffcc181 | ||
|
|
c53e3ed965 | ||
|
|
d374b77baa | ||
|
|
f3b2339803 | ||
|
|
27ed540113 | ||
|
|
434fba55f7 | ||
|
|
280c04e753 | ||
|
|
24832822a5 | ||
|
|
a357f0818d | ||
|
|
e4bf5d2d21 | ||
|
|
8b261d473a | ||
|
|
bba84382ec | ||
|
|
d081803434 | ||
|
|
9194ffa6b7 | ||
|
|
c06a7b1db6 | ||
|
|
1736e10189 | ||
|
|
43b79c50a0 | ||
|
|
2e6aced1bd | ||
|
|
2dc80c8432 | ||
|
|
01e7a7d3b8 | ||
|
|
e5e9f2bdea | ||
|
|
06eff425f1 | ||
|
|
d2aae057f6 | ||
|
|
b7b39de445 | ||
|
|
4aedcb8419 | ||
|
|
6c5bd395cb | ||
|
|
6ad9ae8d1b | ||
|
|
48e2369964 | ||
|
|
e753c242ad | ||
|
|
c1e0b5181e | ||
|
|
d3371c2875 | ||
|
|
2488678f34 | ||
|
|
958d50c119 | ||
|
|
19c16cfcd8 | ||
|
|
c66c92be73 | ||
|
|
4f9ea49f8e | ||
|
|
b776c545e3 | ||
|
|
d65969a2b2 | ||
|
|
d3eb8df7f0 | ||
|
|
89e299764d | ||
|
|
66fb7933b7 | ||
|
|
49e1bbbf15 | ||
|
|
af02d53718 | ||
|
|
f8b1e8199c | ||
|
|
008456d7cd | ||
|
|
aa7c07167c | ||
|
|
d451fe7a0b | ||
|
|
3b8bbb5c5f | ||
|
|
29cd69415a | ||
|
|
bc99da5b28 | ||
|
|
5b38d92cc6 | ||
|
|
0e1392de35 | ||
|
|
a033b56b8d | ||
|
|
c449d29de0 | ||
|
|
afc142b397 | ||
|
|
55348ffe65 | ||
|
|
174b9f5898 | ||
|
|
3b69629a61 | ||
|
|
56eb25f8e2 | ||
|
|
1400e48fc7 | ||
|
|
bccda3e7b2 | ||
|
|
dfb0a2b213 | ||
|
|
f94b376f31 | ||
|
|
13ce67e4c7 | ||
|
|
eece86ab71 | ||
|
|
4fd294dc80 | ||
|
|
4952ccfbf7 | ||
|
|
471ad864b6 | ||
|
|
bec32bd085 | ||
|
|
087fd5d547 | ||
|
|
99f178274d | ||
|
|
450560f92a | ||
|
|
691a0529b0 | ||
|
|
38e63eb665 | ||
|
|
ad8390301e | ||
|
|
acee7e27c6 | ||
|
|
e790b668ef | ||
|
|
432a5d01f8 | ||
|
|
374f2a92aa | ||
|
|
a22ad985dc | ||
|
|
44f41ebd11 | ||
|
|
a10e94bef6 | ||
|
|
e7cb67f846 | ||
|
|
b5a3cc1c78 | ||
|
|
1d107fb39b | ||
|
|
1ec8f639cb | ||
|
|
c15069a9b6 | ||
|
|
13ae5e3ade | ||
|
|
9cffc8b0ec | ||
|
|
c8c5b1095b | ||
|
|
9803b3c690 | ||
|
|
341c0087b7 | ||
|
|
0cd752be05 | ||
|
|
2e39b1c6f5 | ||
|
|
c4026ef9ac | ||
|
|
271a2e3e96 | ||
|
|
bc3e10f09b | ||
|
|
fed3501bf6 | ||
|
|
877cb0d645 | ||
|
|
e930935202 | ||
|
|
0af81fa366 | ||
|
|
3249970b7b | ||
|
|
1466806339 | ||
|
|
05389b1368 | ||
|
|
bef7f79f40 | ||
|
|
8d7394cd46 | ||
|
|
65053e98e2 | ||
|
|
c1bea43598 | ||
|
|
31aeb63f89 | ||
|
|
0175a7a1d4 | ||
|
|
1417ee017e | ||
|
|
5b4d79902f | ||
|
|
f10fddc59a | ||
|
|
ed07793c47 | ||
|
|
2ed2e9c391 | ||
|
|
2b9fed2609 | ||
|
|
848ce65d13 | ||
|
|
f0512ce1cc | ||
|
|
313fad1f81 | ||
|
|
ff26a84988 | ||
|
|
f7ee54598e | ||
|
|
7a62462c1b | ||
|
|
a4433ebe68 | ||
|
|
48feea55fe | ||
|
|
6e5f708f5a | ||
|
|
f2ed645f9c | ||
|
|
d47664e670 | ||
|
|
8f3229ddda | ||
|
|
4f2b7524aa | ||
|
|
4e99e176e9 | ||
|
|
cfc7047967 | ||
|
|
776b5fb3b4 | ||
|
|
f16d42d2b5 | ||
|
|
344d183b6f | ||
|
|
feb668c96c | ||
|
|
f345568675 | ||
|
|
11207f793d | ||
|
|
ce09eb48c4 | ||
|
|
6925732f72 | ||
|
|
dd9d08c8c3 | ||
|
|
1443c883f1 | ||
|
|
30676e2170 | ||
|
|
e41e6d4284 | ||
|
|
1a7b1d24fa | ||
|
|
99443d1c9f | ||
|
|
a84b8d818e | ||
|
|
ef4abf08f0 | ||
|
|
dfcac51312 | ||
|
|
c963a2de18 | ||
|
|
9ec8ecf7f4 | ||
|
|
5d77c96d76 | ||
|
|
a8932f3743 | ||
|
|
d022dd385a | ||
|
|
b2dfbb7973 | ||
|
|
7fee922796 | ||
|
|
9b6acf1ffc | ||
|
|
a0e7cb56dc | ||
|
|
f8447033b9 | ||
|
|
bb07015feb | ||
|
|
111d945a9a | ||
|
|
d1587cc645 | ||
|
|
e50e21c240 | ||
|
|
9bbcf7f31a | ||
|
|
4f29e375c3 | ||
|
|
e15c784bdb | ||
|
|
e77a3b79cd | ||
|
|
7ac5113fef | ||
|
|
ae58537979 | ||
|
|
ebf10828f0 | ||
|
|
33bad7ed40 | ||
|
|
af9ed0cd86 | ||
|
|
14a0829190 | ||
|
|
ca400d8ea7 | ||
|
|
d28750dae0 | ||
|
|
ef81a17311 | ||
|
|
8891a96731 | ||
|
|
49e69ecad4 | ||
|
|
1db2483557 | ||
|
|
7067050006 | ||
|
|
55b455216c | ||
|
|
ffba2f4fa3 | ||
|
|
9f303d840a | ||
|
|
86b4e61c1c | ||
|
|
3232b36e15 | ||
|
|
83329cf9db | ||
|
|
4608c81ea6 | ||
|
|
41679f4e1d | ||
|
|
559699ec19 | ||
|
|
f785219a43 | ||
|
|
bf2b6d7554 | ||
|
|
9a6348c71a | ||
|
|
646f4cbfe9 | ||
|
|
d4c6b6840e | ||
|
|
758aa1c78c | ||
|
|
ec2b52ccac | ||
|
|
38e1eb0c18 | ||
|
|
00e8478f61 | ||
|
|
0c556b1424 | ||
|
|
9987555a72 | ||
|
|
ebb4ba5595 | ||
|
|
7e338b28df | ||
|
|
c4b3e30c5d | ||
|
|
4d283c3504 | ||
|
|
ffc1541343 | ||
|
|
588d75763c | ||
|
|
9e218281da | ||
|
|
6fa58c7948 | ||
|
|
7fe40579b9 | ||
|
|
7e2782ce22 | ||
|
|
1fbe8dab77 | ||
|
|
89ef36711a | ||
|
|
0ba3e2c964 | ||
|
|
0aec742bd3 | ||
|
|
a6f5d868dd | ||
|
|
966d8a8a84 | ||
|
|
611d1a65e7 | ||
|
|
b23e31bb4b | ||
|
|
bec1c7b88f | ||
|
|
5d407b9227 | ||
|
|
e5bc029d87 | ||
|
|
608abb7dc3 | ||
|
|
5fcc7592c9 | ||
|
|
3fb925f13d | ||
|
|
4e958ce57c | ||
|
|
7f6ce89e39 | ||
|
|
71274cf0a3 | ||
|
|
58127cdfdc | ||
|
|
09d5d37867 | ||
|
|
6a8c4ccbf8 | ||
|
|
6d7bbfca95 | ||
|
|
3de39c8cdc | ||
|
|
387398a069 | ||
|
|
f17011939c | ||
|
|
9b6f564d30 | ||
|
|
e23989add0 | ||
|
|
a199e47701 | ||
|
|
4f64316144 | ||
|
|
68e10f42f8 | ||
|
|
3d1cae4692 | ||
|
|
31e84dadd1 | ||
|
|
c331b8322c | ||
|
|
ba4423684b | ||
|
|
62eaf46f34 | ||
|
|
3767bf8c81 | ||
|
|
300a33ddc2 | ||
|
|
34d7bd92ca | ||
|
|
44e7380c6b | ||
|
|
15ca08ce14 | ||
|
|
83b88eeaa0 | ||
|
|
290c92ee39 | ||
|
|
c2985c0db3 | ||
|
|
334dfc7917 | ||
|
|
03b51f73e7 | ||
|
|
af079d6c18 | ||
|
|
99008cf813 | ||
|
|
5fcb670821 | ||
|
|
3bdf8e20c7 | ||
|
|
e8d44b13cf | ||
|
|
c6a7871e5b | ||
|
|
4c9824b16f | ||
|
|
3e54a3272a | ||
|
|
8851406f84 | ||
|
|
fe85ea049a | ||
|
|
221c01e642 | ||
|
|
753aa280f6 | ||
|
|
64f3062eb2 | ||
|
|
f5143d60b7 | ||
|
|
e9fb36bf8f | ||
|
|
11e8736e66 | ||
|
|
30ce36b169 | ||
|
|
1541128e03 | ||
|
|
9d808ec733 | ||
|
|
8f526820a8 | ||
|
|
c0689c6916 | ||
|
|
893872e509 | ||
|
|
2c4b92f941 | ||
|
|
21cc1153b0 | ||
|
|
3c35380e9d | ||
|
|
2b65cfd369 | ||
|
|
8a44aaa7f9 | ||
|
|
4e0bf5542c | ||
|
|
f788e45bc1 | ||
|
|
5b4381c257 | ||
|
|
7396605844 | ||
|
|
b0308af05d | ||
|
|
98a1483032 | ||
|
|
07242dbfc0 | ||
|
|
a9b0775469 | ||
|
|
26a49ba34c | ||
|
|
f3431ea977 | ||
|
|
f0a7ee1c0c | ||
|
|
ad5f085c1f | ||
|
|
e7f5f5da34 | ||
|
|
d10b632875 | ||
|
|
8dd39c5a5b | ||
|
|
cdd1345c19 | ||
|
|
84067a1f57 | ||
|
|
26fd3110b4 | ||
|
|
5bd78cac1a | ||
|
|
0738c52d14 | ||
|
|
c93cb3bb52 | ||
|
|
eea7689c3d | ||
|
|
7b9e34c3e5 | ||
|
|
f81be33539 | ||
|
|
21a1cb65fc | ||
|
|
ef02a01439 | ||
|
|
0b22f4bbd2 | ||
|
|
9f8ae62ebb | ||
|
|
cec71a28eb | ||
|
|
7d060e9994 | ||
|
|
a3a6e889ee | ||
|
|
80283db9bd | ||
|
|
906a322675 | ||
|
|
bc829d9ef0 | ||
|
|
c5e6a46450 | ||
|
|
77f0bdc4ca | ||
|
|
8b9f13283b | ||
|
|
c3c65708e0 | ||
|
|
6bc64aa4aa | ||
|
|
eee907b1a2 | ||
|
|
ddd63f4136 | ||
|
|
b12c1efc90 | ||
|
|
01838f598c | ||
|
|
aef6d5dc1d | ||
|
|
9262963f20 | ||
|
|
d3e2aaacb9 | ||
|
|
755c81286c | ||
|
|
9dd2d998e2 | ||
|
|
abbb13161e | ||
|
|
23dc6f1ea9 | ||
|
|
8aed23f21a | ||
|
|
ae117e3579 | ||
|
|
0d19c693a9 | ||
|
|
283e57ff71 | ||
|
|
eed9503391 | ||
|
|
d66db60177 | ||
|
|
25d9e6c8cf | ||
|
|
a81f433228 | ||
|
|
257e365299 | ||
|
|
554afa3f46 | ||
|
|
d04ec9d510 | ||
|
|
4a802e00e4 | ||
|
|
a7007f5ae2 | ||
|
|
2b3cacd5b0 | ||
|
|
49565b4b3c | ||
|
|
bd8ae27f92 | ||
|
|
3fe0b8b669 | ||
|
|
f0e0b97217 | ||
|
|
67e07c916e | ||
|
|
b3a6ae2441 | ||
|
|
74f321a0fd | ||
|
|
64c841d00a | ||
|
|
5afa2fdc98 | ||
|
|
74bc5dbb7d | ||
|
|
5c67f2ecfd | ||
|
|
66f382039c | ||
|
|
3cfc1cf97a | ||
|
|
b88b102d38 | ||
|
|
fa3ddc2e2b | ||
|
|
f45bc5d9c9 | ||
|
|
79956ade97 | ||
|
|
b9df6d4ad2 | ||
|
|
fa79e2b379 | ||
|
|
5db638c075 | ||
|
|
0f0a0814b7 | ||
|
|
a842f0688f | ||
|
|
c3c2e7c28e | ||
|
|
0364d1199b | ||
|
|
c428a9ddee | ||
|
|
dba571727a | ||
|
|
d31761e78a | ||
|
|
63dfcde4c8 | ||
|
|
32e6ecf00d | ||
|
|
2481509dc5 | ||
|
|
44dd7fc58c | ||
|
|
87f50e5253 | ||
|
|
bffed8bb8a | ||
|
|
ff3c0ab7ca | ||
|
|
6d0addf005 | ||
|
|
1520874432 | ||
|
|
eaade698fb | ||
|
|
b4f4995ff9 | ||
|
|
76a7ac04c9 | ||
|
|
3e1765a26d | ||
|
|
95b80f6bb1 | ||
|
|
caf5f3f04c | ||
|
|
41b8fac3aa | ||
|
|
f6f240bc4b | ||
|
|
a79d8d61e3 | ||
|
|
a5e748f775 | ||
|
|
0fc4edc431 | ||
|
|
c82cf670de | ||
|
|
a3827aed6e | ||
|
|
cc7ba0872c | ||
|
|
3378d2cd8f | ||
|
|
e004a85f53 | ||
|
|
91cd843cfe | ||
|
|
880b669877 | ||
|
|
e53ba28c65 | ||
|
|
bdb6d3c093 | ||
|
|
9af77d0f47 | ||
|
|
15291bfcf2 | ||
|
|
ae228f3b86 | ||
|
|
b8803f92e7 | ||
|
|
1515784700 | ||
|
|
06e2909fda | ||
|
|
9012deeae7 | ||
|
|
31657e1dc0 | ||
|
|
5a08a41cc8 | ||
|
|
3e48d7e331 | ||
|
|
5993470d3f | ||
|
|
18acec1a81 | ||
|
|
701936326d | ||
|
|
5b7d613a35 | ||
|
|
0ce55ff7a4 | ||
|
|
595edb6f80 | ||
|
|
d4b75c5d99 | ||
|
|
1988bced60 | ||
|
|
60f8dbf418 | ||
|
|
a708382cfd | ||
|
|
1d95e1420a | ||
|
|
e1bcff82e2 | ||
|
|
216f1b701f | ||
|
|
0ea18d87a3 | ||
|
|
6a79d57a93 | ||
|
|
31f596f96c | ||
|
|
7f99895116 | ||
|
|
789d756ce1 | ||
|
|
570fb29d3c | ||
|
|
d7dc636d3f | ||
|
|
67d3a8f94f | ||
|
|
7d7b8ddfb1 | ||
|
|
74826c1c59 | ||
|
|
0676b87832 | ||
|
|
d138e1dcef | ||
|
|
372dc8ecb0 | ||
|
|
e8bfe9850e | ||
|
|
ad50fbe3c9 | ||
|
|
61636dd085 | ||
|
|
5ea669be5a | ||
|
|
5260b62287 | ||
|
|
984a84edc1 | ||
|
|
32548878e4 | ||
|
|
093db56c98 | ||
|
|
a17f8518d6 | ||
|
|
e9e9c5355d | ||
|
|
61ee21d627 | ||
|
|
a86707f1ff | ||
|
|
be42d80061 | ||
|
|
16da6f9696 | ||
|
|
427b0aa197 | ||
|
|
a2432d45cc | ||
|
|
f62b5d4f22 | ||
|
|
001225c27b | ||
|
|
3e68f188fa | ||
|
|
2d75eb76f1 | ||
|
|
bcc3ebb6bb | ||
|
|
52c4e65686 | ||
|
|
44a5afb8a2 | ||
|
|
3057d35111 | ||
|
|
bdf99bc554 | ||
|
|
e70415690c | ||
|
|
9b5e4eb9b7 | ||
|
|
e2324d3c37 | ||
|
|
c395c31e46 | ||
|
|
94662e17ba | ||
|
|
0bfa5cf723 | ||
|
|
d2f29f335e | ||
|
|
4423cb85c2 | ||
|
|
46fb997b52 | ||
|
|
dcf8c134a2 | ||
|
|
7c0df908e9 | ||
|
|
7bb76d7ced | ||
|
|
1cfb8de3a0 | ||
|
|
768d2b82d6 | ||
|
|
7a4431d80c | ||
|
|
7e63e1d607 | ||
|
|
bda6c1e3ed | ||
|
|
a9d116df2f | ||
|
|
e7c6c32d40 | ||
|
|
cdfe24fcdb | ||
|
|
a9199171df | ||
|
|
76b9542507 | ||
|
|
d30b6a8dcf | ||
|
|
76b5ad1c99 | ||
|
|
7840e83ada | ||
|
|
c4ac9da3e5 | ||
|
|
311e5d5cfd | ||
|
|
a1f6795d44 | ||
|
|
f8a30ce261 | ||
|
|
ccfd15bda0 | ||
|
|
a9610e6ee7 | ||
|
|
733b36b869 | ||
|
|
70c3f9f929 | ||
|
|
210bda15b8 | ||
|
|
93be1b3443 | ||
|
|
533a001aeb | ||
|
|
0b57d78732 | ||
|
|
dce9d1a1e2 | ||
|
|
1cff39cec4 | ||
|
|
c7392dcf5a | ||
|
|
3eb39ebef2 | ||
|
|
041d8d5643 | ||
|
|
1c19046442 | ||
|
|
3d696aaa64 | ||
|
|
76516336af | ||
|
|
fc18677409 | ||
|
|
029d3730a8 | ||
|
|
8509e62114 | ||
|
|
6e8f9ca22e | ||
|
|
dbc1a515d2 | ||
|
|
70221e7f62 | ||
|
|
28f921c38d | ||
|
|
30a773601f | ||
|
|
6cddd5c704 | ||
|
|
709bc12b1c | ||
|
|
171892a894 | ||
|
|
535ab315d9 | ||
|
|
de28247b7e | ||
|
|
6186eb753a | ||
|
|
a18bc85a9b | ||
|
|
806e4c398d | ||
|
|
a4f1abfa42 | ||
|
|
f2efd9718e | ||
|
|
031c56e30b | ||
|
|
994715d9eb | ||
|
|
90f7af7afa | ||
|
|
2f3c466833 | ||
|
|
d742bca205 | ||
|
|
8e51d52155 | ||
|
|
a1c4f72470 | ||
|
|
2c11bba25e | ||
|
|
42a5b4fae7 | ||
|
|
a61aedc906 | ||
|
|
7b72d517ab | ||
|
|
1c43295fbc | ||
|
|
747c432ea3 | ||
|
|
235bdba42a | ||
|
|
b3f603732e | ||
|
|
6091eae7fc | ||
|
|
ef36ad1ec1 | ||
|
|
f832611d41 | ||
|
|
4d50eeb830 | ||
|
|
abf1fa0ef4 | ||
|
|
903c0e51ee | ||
|
|
ce6a711c8e | ||
|
|
095fe72db0 | ||
|
|
1b6cd01eaf | ||
|
|
ac1e19f621 | ||
|
|
faf2890695 | ||
|
|
75f0773247 | ||
|
|
8b81b918cc | ||
|
|
5fe91a80fa | ||
|
|
6f3dee74be | ||
|
|
9391e8cc1a | ||
|
|
8aa5537029 | ||
|
|
f40c3ec0f6 | ||
|
|
408143e55e | ||
|
|
71eef4693d | ||
|
|
0b7814882d | ||
|
|
99cf26ee9e | ||
|
|
775f754ff3 | ||
|
|
b6ee2dee68 | ||
|
|
ef25e82544 | ||
|
|
14b7631dd6 | ||
|
|
ef0099b3c9 | ||
|
|
38d60affce | ||
|
|
c8a2c9bbd4 | ||
|
|
9c2084b62e | ||
|
|
9edd083411 | ||
|
|
80e8ecc4f4 | ||
|
|
e5d3048fb2 | ||
|
|
67c4622ca7 | ||
|
|
121f1c4698 | ||
|
|
ff9fb9eb1b | ||
|
|
b07a8796ff | ||
|
|
8ad5ff457e | ||
|
|
99f6209c57 | ||
|
|
1b3a55b105 | ||
|
|
8b59a94324 | ||
|
|
b17f20eece | ||
|
|
d9062a0bb0 | ||
|
|
6066c20676 | ||
|
|
1c7ba50def | ||
|
|
e53b24ef47 | ||
|
|
1a978abcc1 | ||
|
|
b91f4e4281 | ||
|
|
86978329eb | ||
|
|
337ecf0efe | ||
|
|
4c3eb90bfc | ||
|
|
018a0422b7 | ||
|
|
f18ac169fa | ||
|
|
04746961f2 | ||
|
|
3939c81044 | ||
|
|
fdbe5fa556 | ||
|
|
dff8b8ccec | ||
|
|
8d11b47241 | ||
|
|
78e5c52932 | ||
|
|
46c7759718 | ||
|
|
2f5e8c2019 | ||
|
|
2508d3f965 | ||
|
|
3699d28dd0 | ||
|
|
be7146fa89 | ||
|
|
66f4ea0a84 | ||
|
|
84ff897b46 | ||
|
|
29c7b2a920 | ||
|
|
83ded8458a | ||
|
|
e93053d412 | ||
|
|
2370936dfd | ||
|
|
06bd7aed36 | ||
|
|
ff560a317c | ||
|
|
6892befa15 | ||
|
|
fadf18b7fc | ||
|
|
d9b632c031 | ||
|
|
35fd4d2770 | ||
|
|
1b8963f311 | ||
|
|
710218b5b5 | ||
|
|
60cbe1571c | ||
|
|
6740d6a723 | ||
|
|
eb14e50941 | ||
|
|
37ac778ff4 | ||
|
|
bc5586a077 | ||
|
|
eb7ac93e72 | ||
|
|
bf8a8bddf1 | ||
|
|
d1badcb28c | ||
|
|
f6e79e17b7 | ||
|
|
eead126f7a | ||
|
|
e5ef61dfd3 | ||
|
|
eb130aa57f | ||
|
|
c9b10494d8 | ||
|
|
b8136ac1dc | ||
|
|
6d5b53fcd5 | ||
|
|
5cf8eb5e71 | ||
|
|
f037f4c7de | ||
|
|
618be6d108 | ||
|
|
7fb028205f | ||
|
|
a09e56bbfd | ||
|
|
c0c01a0285 | ||
|
|
af0854a840 | ||
|
|
f70652f165 | ||
|
|
7c440f47b6 | ||
|
|
6967cc2293 | ||
|
|
97ad1f6f22 | ||
|
|
f62f530f97 | ||
|
|
815647ae02 | ||
|
|
ce1e3fb04d | ||
|
|
1a86828ae6 | ||
|
|
8831ea22b7 | ||
|
|
1a411da133 | ||
|
|
e2a7534aa5 | ||
|
|
f8a92e1710 | ||
|
|
953a232654 | ||
|
|
4afa29554f | ||
|
|
dc78057823 | ||
|
|
53ca586847 | ||
|
|
4f7e96ed7d | ||
|
|
0397ef3fad | ||
|
|
aa38591d90 | ||
|
|
b87b82bec9 | ||
|
|
2e719e2ccc | ||
|
|
909b41174b | ||
|
|
2c33ee5b32 | ||
|
|
82beae0e59 | ||
|
|
7f979e2f52 | ||
|
|
e94eb302a8 | ||
|
|
8ffbb614f7 | ||
|
|
7a589f4a7b | ||
|
|
04ed5ed980 | ||
|
|
e37b094d1e | ||
|
|
a491ce96cb | ||
|
|
7be79519b1 | ||
|
|
47e4c0f190 | ||
|
|
8e5d933745 | ||
|
|
6b24844172 | ||
|
|
c6225f3ab8 | ||
|
|
60c4aa943b | ||
|
|
81d0adf73c | ||
|
|
7dc3929f0e | ||
|
|
09be3a4de3 | ||
|
|
f7407e46c5 | ||
|
|
8f685967d3 | ||
|
|
23cd453af8 | ||
|
|
8f6dd22a6d | ||
|
|
108c87f395 | ||
|
|
cd58b3a39a | ||
|
|
26a3b51162 | ||
|
|
2fbee33185 | ||
|
|
6da3138814 | ||
|
|
b2e6156bbb | ||
|
|
fbd4a22e3e | ||
|
|
dede73e9a5 | ||
|
|
f499040955 | ||
|
|
008c446966 | ||
|
|
ce358dcd65 | ||
|
|
01158e67e0 | ||
|
|
d533fb83eb | ||
|
|
f4cfa04954 | ||
|
|
ae4387ce3f | ||
|
|
a64b495083 | ||
|
|
81cdd0a211 | ||
|
|
6bfb5f1340 | ||
|
|
2625133f40 | ||
|
|
38409b4200 | ||
|
|
29b4d0daeb | ||
|
|
8f4f9fe19a | ||
|
|
7f67459c6e | ||
|
|
f47a7b4dbc | ||
|
|
0bf6926506 | ||
|
|
d13fb73c67 | ||
|
|
5e18a46e3f | ||
|
|
62e39dd0e2 | ||
|
|
203ea89c6d | ||
|
|
9ddd967776 | ||
|
|
44593ff3f3 | ||
|
|
3ed13b3ff5 | ||
|
|
53cfdcc240 | ||
|
|
0636b95b87 | ||
|
|
cf449a9b60 | ||
|
|
ab890ada37 | ||
|
|
b9c136c6ae | ||
|
|
f81a7e8273 | ||
|
|
d40d4a08b0 | ||
|
|
61907d2270 | ||
|
|
601a90981e | ||
|
|
10b7259b13 | ||
|
|
5c83d63fe2 | ||
|
|
beb7a191c1 | ||
|
|
ee72a328ca | ||
|
|
c85419bf06 | ||
|
|
155ba92ba6 | ||
|
|
b201c3cca8 | ||
|
|
c45f47faa0 | ||
|
|
ee7ea7fca6 | ||
|
|
5ee7830f1b | ||
|
|
8da9dc8a3f | ||
|
|
61ecfd2d92 | ||
|
|
2535ff6c90 | ||
|
|
880bc6326a | ||
|
|
d892212583 | ||
|
|
089acd357d | ||
|
|
d14f6937fa | ||
|
|
d74813ec80 | ||
|
|
1cfba1aa52 | ||
|
|
5f96f56574 | ||
|
|
076aaae944 | ||
|
|
aed54bb3a6 | ||
|
|
7c03677295 | ||
|
|
3d3875f14f | ||
|
|
f6dd493997 | ||
|
|
d5e3989ed1 | ||
|
|
77527d8823 | ||
|
|
5e5ec98995 | ||
|
|
1c2d4f9045 | ||
|
|
3d64152dba | ||
|
|
37ecd3da1e | ||
|
|
22e9e4c352 | ||
|
|
7e5a2b4549 | ||
|
|
036dde5bb0 | ||
|
|
69cac9d40a | ||
|
|
04b132816c | ||
|
|
039badd265 | ||
|
|
f08ed1bbb7 | ||
|
|
d59a769084 | ||
|
|
7a8fe1074c | ||
|
|
3fc256ed9a | ||
|
|
18eed4417c | ||
|
|
20adbadc02 | ||
|
|
c68384be69 | ||
|
|
90a9631450 | ||
|
|
7619979046 | ||
|
|
54ccae8665 | ||
|
|
3015b01740 | ||
|
|
43d47a4f09 | ||
|
|
96abc34a92 | ||
|
|
26553b8875 | ||
|
|
5e3187e36b | ||
|
|
eba8c3122f | ||
|
|
f1a3f39782 | ||
|
|
0880f78002 | ||
|
|
1c16d497f9 | ||
|
|
faaae95197 | ||
|
|
d5e0e8ab40 | ||
|
|
500b0ebde3 | ||
|
|
6f6c39da23 | ||
|
|
f8ccc7a92f | ||
|
|
95a678bb18 | ||
|
|
e43ce6ba3c | ||
|
|
7663b0b969 | ||
|
|
ba898b0874 | ||
|
|
04843010bc | ||
|
|
41c06efeee | ||
|
|
d0425fa31a | ||
|
|
08753b97df | ||
|
|
a86fef5f28 | ||
|
|
c5c2f59b31 | ||
|
|
69ee8ab438 | ||
|
|
4a24bc8c21 | ||
|
|
1d293244d3 | ||
|
|
6812c5ac40 | ||
|
|
eeb5ed920a | ||
|
|
90ad3e019f | ||
|
|
3af453c2df | ||
|
|
3071d2bdfa | ||
|
|
90aad4f131 | ||
|
|
f69b1b34f1 | ||
|
|
ece2c4b49f | ||
|
|
033c8f9bee | ||
|
|
1b9ca95a0e | ||
|
|
7e86a9f8a9 | ||
|
|
9dee744498 | ||
|
|
32fa71e8f1 | ||
|
|
ec4694f859 | ||
|
|
717386f10a | ||
|
|
fe071fe41a | ||
|
|
560a7d083b | ||
|
|
4428c1a298 | ||
|
|
760fd2fdc5 | ||
|
|
84c11a281a | ||
|
|
ad682ca0c4 | ||
|
|
2a349ca9ef | ||
|
|
da8435cfea | ||
|
|
0f36daf1fd | ||
|
|
1f3c90e9e5 | ||
|
|
6ec7a1fe09 | ||
|
|
2f78acaf4d | ||
|
|
9412a26bfc | ||
|
|
2348d9ceb3 | ||
|
|
61b4b6617b | ||
|
|
a8620f21a0 | ||
|
|
78dc266eee | ||
|
|
0631fe37ea | ||
|
|
8828f8401d | ||
|
|
21339aba42 | ||
|
|
660231978f | ||
|
|
dde203b158 | ||
|
|
0ee69fa2b2 | ||
|
|
8c1a8f7d55 | ||
|
|
ef03b665c9 | ||
|
|
b87906234d | ||
|
|
896b318c49 | ||
|
|
b3d441c385 | ||
|
|
96de670bfe | ||
|
|
bc2fc35cc9 | ||
|
|
993d5395b2 | ||
|
|
67f0b828ea | ||
|
|
879c1267b6 | ||
|
|
46c53e36a6 | ||
|
|
09f6605cfe | ||
|
|
12cee4027a | ||
|
|
979fea0d60 | ||
|
|
94553c54bd | ||
|
|
248db31c8b | ||
|
|
24bfa1ca15 | ||
|
|
1e97a8febc | ||
|
|
2742f2e1ff | ||
|
|
0a5ae70a7c | ||
|
|
22d53bd36e | ||
|
|
ebf68929ce | ||
|
|
ef3b373211 | ||
|
|
5012a51e1d | ||
|
|
fb1f476a3c | ||
|
|
1a31c8cd1d | ||
|
|
b7c0201ca3 | ||
|
|
3e491c7d79 | ||
|
|
33345817d2 | ||
|
|
82973a685a | ||
|
|
e1d245068c | ||
|
|
b74517ffb0 | ||
|
|
231ae8dfa6 | ||
|
|
4ee9a47d41 | ||
|
|
d8bf5cdedf | ||
|
|
755e0edd44 | ||
|
|
178df82693 | ||
|
|
a88c3b2032 | ||
|
|
513396b905 | ||
|
|
9885d4758b | ||
|
|
f5583717d5 | ||
|
|
da3076e5f7 | ||
|
|
3b77e1ddf1 | ||
|
|
3763a615f0 | ||
|
|
f90e07976e | ||
|
|
45b7658634 | ||
|
|
70323936e9 | ||
|
|
44f64fa336 | ||
|
|
2bd8afcc89 | ||
|
|
5fdab2522c | ||
|
|
ef7bd8bd19 | ||
|
|
9aa76cad69 | ||
|
|
f51477bf18 | ||
|
|
2a8ec27ba6 | ||
|
|
2ff7fbbe6f | ||
|
|
8a2fe7c20e | ||
|
|
0fc8f02c6e | ||
|
|
3e8246ac41 | ||
|
|
1adb2fe0f6 | ||
|
|
9c3e1a6ff6 | ||
|
|
e943b07344 | ||
|
|
0ca1a6286c | ||
|
|
535c088404 | ||
|
|
f615621ffe | ||
|
|
f3d0df6772 | ||
|
|
3b34d687a6 | ||
|
|
d3ba8d4385 | ||
|
|
25ccf7fed3 | ||
|
|
6139c51b60 | ||
|
|
77ded65157 | ||
|
|
1836284223 | ||
|
|
c43afc6b39 | ||
|
|
4b0902017b | ||
|
|
b2d26b9481 | ||
|
|
68dbc91d54 | ||
|
|
a4aea694d4 | ||
|
|
0f31bfc78f | ||
|
|
80554ecff4 | ||
|
|
0e57aad12d | ||
|
|
742db377f6 | ||
|
|
a0250c8191 | ||
|
|
65b2656112 | ||
|
|
1c4e5f0eed | ||
|
|
224a06803f | ||
|
|
8534a6d509 | ||
|
|
f3dbb1f930 | ||
|
|
fedb6f2da2 | ||
|
|
aa7303c707 | ||
|
|
4b99ca5c5a | ||
|
|
d49462152b | ||
|
|
33faeee75d | ||
|
|
8cb15dcc7e | ||
|
|
cef5813318 | ||
|
|
c43ee8025e | ||
|
|
052d8c8962 | ||
|
|
2eb5539c9b | ||
|
|
be6fba5963 | ||
|
|
b273181ba6 | ||
|
|
f5c3c51fe2 | ||
|
|
3e7c200a0b | ||
|
|
152dbe9dec | ||
|
|
24b744b27e | ||
|
|
250afc0a5c | ||
|
|
c22a3ed092 | ||
|
|
7a23ae4b84 | ||
|
|
201462d743 | ||
|
|
3d1768100f | ||
|
|
3fbfbeaf0f | ||
|
|
7163abbbe3 | ||
|
|
423626a6bf | ||
|
|
182acc0787 | ||
|
|
705aef462c | ||
|
|
1f092dd80e | ||
|
|
4d0ddd7ff3 | ||
|
|
2a212ae759 | ||
|
|
1d57e75d28 | ||
|
|
ac1e254eed | ||
|
|
6074431364 | ||
|
|
d5fc4d48b4 | ||
|
|
61232e7dda | ||
|
|
594b4f1d75 | ||
|
|
98174bcc16 | ||
|
|
29d90df9ea | ||
|
|
50e6e4817b | ||
|
|
c6a88e41e1 | ||
|
|
ae1c41ba82 | ||
|
|
837bb74576 | ||
|
|
a8f559b22c | ||
|
|
992eb89d1a | ||
|
|
1284418c18 | ||
|
|
3eb3a4502f | ||
|
|
6023af2f21 | ||
|
|
2cd90d8066 | ||
|
|
c1dfb540a3 | ||
|
|
bc44ea8757 | ||
|
|
77743ef8ba | ||
|
|
f8de052d54 | ||
|
|
cb4eb21551 | ||
|
|
8357d7abc3 | ||
|
|
5a01bfcdbf | ||
|
|
01eb416a03 | ||
|
|
dca02c1f4b | ||
|
|
2654802bb0 | ||
|
|
d7eecfdcea | ||
|
|
8df9846ad7 | ||
|
|
e43c0135a7 | ||
|
|
adf1a47945 | ||
|
|
492e0b952e | ||
|
|
ecc9d154d8 | ||
|
|
e776966ef9 | ||
|
|
98df2e5486 | ||
|
|
ca1beb956a | ||
|
|
c694d3d6f1 | ||
|
|
a314d03870 | ||
|
|
f2fd3a0b7e | ||
|
|
7b693527d9 | ||
|
|
93e0d57783 | ||
|
|
18027d5d5c | ||
|
|
0ef514a68f | ||
|
|
4780f5e972 | ||
|
|
5b8a567f26 | ||
|
|
23cb7616d9 | ||
|
|
488522de6e | ||
|
|
03bcf5d2c7 | ||
|
|
fba758ea36 | ||
|
|
0268f90e9c | ||
|
|
4cc7247c37 | ||
|
|
5d94ed853d | ||
|
|
d06e297c2d | ||
|
|
6304467d3a | ||
|
|
e52601a584 | ||
|
|
74226581b7 | ||
|
|
bc28504b3e | ||
|
|
109811199d | ||
|
|
610fa4d101 | ||
|
|
0269620e66 | ||
|
|
10ebe975cf | ||
|
|
0bc609cac4 | ||
|
|
3657f6ce75 | ||
|
|
e62f72810c | ||
|
|
21553410f9 | ||
|
|
a6bc910b0f | ||
|
|
3e68667323 | ||
|
|
c0d4bbcecf | ||
|
|
6bf6159e6c | ||
|
|
fd4193daab | ||
|
|
da2077f3dd | ||
|
|
ee65032f7d | ||
|
|
2d7d75c290 | ||
|
|
237e88ba89 | ||
|
|
48223e4f39 | ||
|
|
ce776f210c | ||
|
|
fb5e25ec16 | ||
|
|
c4f2411fee | ||
|
|
3c3be950e9 | ||
|
|
b24ee0b9a6 | ||
|
|
e1d5caa0fd | ||
|
|
35ba9b0e6b | ||
|
|
66de07823d | ||
|
|
fd96e71d04 | ||
|
|
3c85242efc | ||
|
|
3c288e1e59 | ||
|
|
4bf2f927b0 | ||
|
|
ad30030a1f | ||
|
|
02d66e8093 | ||
|
|
49eab95be9 | ||
|
|
b1bfaf5a5c | ||
|
|
92affd6e13 | ||
|
|
843e605352 | ||
|
|
6a7fa6060b | ||
|
|
43ce1df0ed | ||
|
|
a6deb3af8b | ||
|
|
9c01f5f0b0 | ||
|
|
80b89a85ee | ||
|
|
2fd0bb4912 | ||
|
|
c0329618fe | ||
|
|
c4a240cb04 | ||
|
|
33d5761194 | ||
|
|
a58ddd5880 | ||
|
|
3bbb5f9b83 | ||
|
|
3d6bf800f3 | ||
|
|
a0b0a0e1e8 | ||
|
|
8f48e9ac0c | ||
|
|
bb42095ca0 | ||
|
|
c487f69676 | ||
|
|
3db46a84b2 | ||
|
|
69520391f2 | ||
|
|
4b212753fb | ||
|
|
d86a2cf9de | ||
|
|
3130044909 | ||
|
|
fac1c4db7b | ||
|
|
ae1b90dfd7 | ||
|
|
ec55de429c | ||
|
|
d62b957189 | ||
|
|
599ce19ace | ||
|
|
625d079168 | ||
|
|
2586843654 | ||
|
|
8ea48f9875 | ||
|
|
d7f3b3caf5 | ||
|
|
b37d8abf62 | ||
|
|
cd930edd06 | ||
|
|
4956aa6d70 | ||
|
|
fd17465d94 | ||
|
|
87a9425241 | ||
|
|
b225e8afd5 | ||
|
|
297b6e69d5 | ||
|
|
d7f0e88801 | ||
|
|
d62b27814c | ||
|
|
19526878b3 | ||
|
|
14ecad720f | ||
|
|
81689c04a5 | ||
|
|
de6b9de341 | ||
|
|
7f864eb84d | ||
|
|
4af0c1e2ce | ||
|
|
6a4ed78812 | ||
|
|
23b881f364 | ||
|
|
22054cf8bc | ||
|
|
fc236b1d96 | ||
|
|
4f81454f93 | ||
|
|
b3d6f173f1 | ||
|
|
8d2ba39ab8 | ||
|
|
4260e5a1a7 | ||
|
|
17585c8294 | ||
|
|
d242a9e5c0 | ||
|
|
9ca98f6391 | ||
|
|
be7ef08f40 | ||
|
|
626692df29 | ||
|
|
631787a4f1 | ||
|
|
09cf6cdc2d | ||
|
|
baf174b059 | ||
|
|
49eb3178a9 | ||
|
|
6a6aceff1d | ||
|
|
b8349af3da | ||
|
|
258d783f8e | ||
|
|
761fc05331 | ||
|
|
0c8e943d1b | ||
|
|
9787ca60da | ||
|
|
b8e57aeff4 | ||
|
|
9a0240ef3e | ||
|
|
cf5ccafe7e | ||
|
|
ae64233986 | ||
|
|
6dda79ee10 | ||
|
|
335a855968 | ||
|
|
94c92c5f38 | ||
|
|
35fa1493b3 | ||
|
|
f78f6fc529 | ||
|
|
5be65216e2 | ||
|
|
24526ad206 | ||
|
|
d7564a65f7 | ||
|
|
866d61cfaf | ||
|
|
3f3f3fdaa6 | ||
|
|
e0da59096a | ||
|
|
40632019ac | ||
|
|
3c5563b62f | ||
|
|
562424b74d | ||
|
|
7a598d5839 | ||
|
|
574d34bc2c | ||
|
|
16a4ccdb12 | ||
|
|
920cf4f897 | ||
|
|
76ee2c5365 | ||
|
|
472106390d | ||
|
|
d97f8b2e9a | ||
|
|
98e2526f8a | ||
|
|
c30c4649a4 | ||
|
|
ede8676979 | ||
|
|
17fb60b7ae | ||
|
|
8119897818 | ||
|
|
0a9e5d2cea | ||
|
|
a5f74d7767 | ||
|
|
02cb9c35b3 | ||
|
|
d934e0a69d | ||
|
|
2ecce6485c | ||
|
|
1ad8aeeaa7 | ||
|
|
46a15082d6 | ||
|
|
153ecf0b41 | ||
|
|
f0f7304ae2 | ||
|
|
997e171118 | ||
|
|
04a8fe8af2 | ||
|
|
a0822a356c | ||
|
|
b78d337fd0 | ||
|
|
13c5cb3f1d | ||
|
|
197c0532fa | ||
|
|
76342b09ff | ||
|
|
241d96f6ac | ||
|
|
fdc6dcb26e | ||
|
|
9fd010e91e | ||
|
|
c900498ce8 | ||
|
|
c4c84e44e1 | ||
|
|
191ac47353 | ||
|
|
851365fb58 | ||
|
|
ede2bc6a4e | ||
|
|
38780b6daa | ||
|
|
0dc267c109 | ||
|
|
bc6c85c6c6 | ||
|
|
915f4cac5e | ||
|
|
b8da0714c2 | ||
|
|
f1105e6822 | ||
|
|
20296148eb | ||
|
|
2138c0fb4f | ||
|
|
34d9857089 | ||
|
|
888b71a196 | ||
|
|
5f16c871dc | ||
|
|
595a338de7 | ||
|
|
fe47fd1910 | ||
|
|
ac9abf8ede | ||
|
|
282706dbc8 | ||
|
|
5360cbf19c | ||
|
|
84ac1b6686 | ||
|
|
ebc16207f4 | ||
|
|
7611e98156 | ||
|
|
848f73715f | ||
|
|
6f30dfb963 | ||
|
|
c8aa903e3e | ||
|
|
f0e55037de | ||
|
|
1335b368d1 | ||
|
|
a647f3c105 | ||
|
|
c936372105 | ||
|
|
f242d43f73 | ||
|
|
c216012304 | ||
|
|
87c2f0e38e | ||
|
|
d9cc75edc0 | ||
|
|
1f91ec32da | ||
|
|
92b60b7f25 | ||
|
|
8104d02a3a | ||
|
|
83c4add375 | ||
|
|
c19084b7b4 | ||
|
|
2761e97c6a | ||
|
|
0cdfd1d114 | ||
|
|
8566e048b6 | ||
|
|
31fc731af6 | ||
|
|
ff95764824 | ||
|
|
737c4a6b5d | ||
|
|
db68871646 | ||
|
|
748f17b777 | ||
|
|
bbba24c7bc | ||
|
|
5bba864faa | ||
|
|
33b7fe6072 | ||
|
|
4d0bef62ed | ||
|
|
e09ba81cfa | ||
|
|
baf15450a3 | ||
|
|
d24419cfb7 | ||
|
|
fe88db2094 | ||
|
|
91d2ab7d1d | ||
|
|
9a405a756f | ||
|
|
86f5be23fe | ||
|
|
9f4ca1aa6b | ||
|
|
624b1cce74 | ||
|
|
29216768e1 | ||
|
|
59e18dc1c1 | ||
|
|
858a85f952 | ||
|
|
1cbd68f1e3 | ||
|
|
324bf62bb8 | ||
|
|
dd1d7d5dc1 | ||
|
|
e6ad9e23cc | ||
|
|
a557322dc6 | ||
|
|
7d7324ddbc | ||
|
|
680ed4596f | ||
|
|
e66ab647e1 | ||
|
|
253f4c59a3 | ||
|
|
38a97d6b5a | ||
|
|
ae8f11d5a8 | ||
|
|
dcfd82f84e | ||
|
|
25a531341a | ||
|
|
f421f6dee8 | ||
|
|
a5332ccc7d | ||
|
|
76c3f401ea | ||
|
|
5173dded2a | ||
|
|
bdd8597f69 | ||
|
|
46bba64a94 | ||
|
|
d0694a0e70 | ||
|
|
bd12b0e81f | ||
|
|
2f4fb0fc52 | ||
|
|
cbabf01902 | ||
|
|
c51c8b4af0 | ||
|
|
2741e11078 | ||
|
|
aa251aa011 | ||
|
|
0509ddb129 | ||
|
|
5a180836b7 | ||
|
|
9c7c6b9ea7 | ||
|
|
d64eb0b087 | ||
|
|
28e4318f8a | ||
|
|
36f0821ea0 | ||
|
|
293a690ccd | ||
|
|
1c96ff7d3b | ||
|
|
db8a2bb872 | ||
|
|
dfbe4fc7ee | ||
|
|
3cccc4ec64 | ||
|
|
e29684e672 | ||
|
|
30796c6f81 | ||
|
|
86b5eb1818 | ||
|
|
696405a8bf | ||
|
|
a2c2eab6b3 | ||
|
|
eadb69bdc0 | ||
|
|
e73223ca8a | ||
|
|
6dd66dbae9 | ||
|
|
ead9ee81fb | ||
|
|
073b69f94a | ||
|
|
1a0a0777a3 | ||
|
|
a971ae2168 | ||
|
|
bd140af714 | ||
|
|
6b8d2502b7 | ||
|
|
96008fa78f | ||
|
|
da4d0f515c | ||
|
|
67e6a22da9 | ||
|
|
b791fb1494 | ||
|
|
9e329bf19f | ||
|
|
3906e8a942 | ||
|
|
f74faea065 | ||
|
|
7d3759acce | ||
|
|
172962f711 | ||
|
|
36109e3b88 | ||
|
|
7c63b7c062 | ||
|
|
1efaf048f5 | ||
|
|
ac52714498 | ||
|
|
c3de89f504 | ||
|
|
6f6a645d0a | ||
|
|
5605352144 | ||
|
|
ef433f446d | ||
|
|
fe8f200364 | ||
|
|
e4194cdf4d | ||
|
|
c8392c9b47 | ||
|
|
be3a030302 | ||
|
|
cd6d4488d1 | ||
|
|
da3a5df5c3 | ||
|
|
4864407d61 | ||
|
|
f6f7879d6e | ||
|
|
dab1f14a59 | ||
|
|
51ca914206 | ||
|
|
933ffb8ca2 | ||
|
|
2f5f20a257 | ||
|
|
92544f89f3 | ||
|
|
f1cf1acbfa | ||
|
|
f22008389c | ||
|
|
885b7a0b05 | ||
|
|
91de372cbc | ||
|
|
811bd94934 | ||
|
|
5987488b3d | ||
|
|
966c9e972d | ||
|
|
464261a1b7 | ||
|
|
363dcef81a | ||
|
|
4439617c50 | ||
|
|
5d2fa3d65d | ||
|
|
8930ab0af6 | ||
|
|
6af6fe22fc | ||
|
|
dd577a7843 | ||
|
|
f772155674 | ||
|
|
3ce204338a | ||
|
|
168bc9ef45 | ||
|
|
bfc3d4888b | ||
|
|
0148b115db | ||
|
|
0b11953f6f | ||
|
|
6e210faacf | ||
|
|
4ef755e10b | ||
|
|
62b7cc5509 | ||
|
|
0e1ec05110 | ||
|
|
dd38fc74db | ||
|
|
d619d7ac76 | ||
|
|
37f7511ba0 | ||
|
|
afd03ba1b5 | ||
|
|
ac7b02d28a | ||
|
|
4a0bdbf779 | ||
|
|
164dada46a | ||
|
|
fd1c4ec792 | ||
|
|
add000d221 | ||
|
|
def598f728 | ||
|
|
0294885fbf | ||
|
|
c0ec4338f8 | ||
|
|
fb7f6f73bd | ||
|
|
e04c38e557 | ||
|
|
bfb5420733 | ||
|
|
9e6fc32903 | ||
|
|
217ceb1c7a | ||
|
|
846f89664e | ||
|
|
0e30f69e96 | ||
|
|
af9eb538f4 | ||
|
|
66a0beea33 | ||
|
|
411e73bb35 | ||
|
|
852e222f5d | ||
|
|
054ceab4f4 | ||
|
|
d9149ff572 | ||
|
|
7f331690a0 | ||
|
|
a5698dfff0 | ||
|
|
1e5866da06 | ||
|
|
3f7b7da184 | ||
|
|
c0020c8769 | ||
|
|
1c5e678cef | ||
|
|
3ab1b8ebc9 | ||
|
|
7635c68ccd | ||
|
|
a3b562b895 | ||
|
|
94d1493195 | ||
|
|
3a5bbe32b9 | ||
|
|
7e712c5003 | ||
|
|
31328e092e | ||
|
|
29671f48a8 | ||
|
|
61c2782491 | ||
|
|
15263b5223 | ||
|
|
557d1ee5b0 | ||
|
|
777265c730 | ||
|
|
e76a8d547b | ||
|
|
ff98f84f18 | ||
|
|
d0b4fa5b28 | ||
|
|
91b80f7c49 | ||
|
|
47f409246d | ||
|
|
be1ff83297 | ||
|
|
297c9e0085 | ||
|
|
ec95917b4d | ||
|
|
98bfe863fe | ||
|
|
af3d00662e | ||
|
|
39803fb0df | ||
|
|
4dad5ea6c1 | ||
|
|
ba8cb8c6f8 | ||
|
|
64f10b28e7 | ||
|
|
7f34447ace | ||
|
|
c2e000f937 | ||
|
|
831ab6d99b | ||
|
|
b246d9e567 | ||
|
|
919c2ffd46 | ||
|
|
e6d63a811e | ||
|
|
92227098b7 | ||
|
|
571080c1d6 | ||
|
|
d07feb837d | ||
|
|
1c823c4255 | ||
|
|
63e378524b | ||
|
|
ea5f54e421 | ||
|
|
ee18fbebae | ||
|
|
fa56d06e0c | ||
|
|
72f7514114 | ||
|
|
44e1f00ffc | ||
|
|
e7054ea13f | ||
|
|
4a3ac2cfcd | ||
|
|
bbc31e01c4 | ||
|
|
ba86b34a8c | ||
|
|
770a198772 | ||
|
|
a26bee3696 | ||
|
|
abb8f4f963 | ||
|
|
43d2adff70 | ||
|
|
474eeb9e68 | ||
|
|
e2dffea423 | ||
|
|
3d5eaba46f | ||
|
|
1bb8fbd56f | ||
|
|
b699886953 | ||
|
|
12c957d48b | ||
|
|
48e890c1b1 | ||
|
|
05331f001a | ||
|
|
bde260b330 | ||
|
|
59ef51ea20 | ||
|
|
aa77bfdfc4 | ||
|
|
a2baef8911 | ||
|
|
3fcfb65d45 | ||
|
|
8f266bea0d | ||
|
|
0a765f4aac | ||
|
|
ee3f0555d1 | ||
|
|
0c0386f4ba | ||
|
|
6c2b1cb589 | ||
|
|
9fc1285c09 | ||
|
|
e6e8ccee50 | ||
|
|
f9632af016 | ||
|
|
81359bf419 | ||
|
|
a144570ed7 | ||
|
|
0732b72e8f | ||
|
|
8332445a52 | ||
|
|
c9111d1bfc | ||
|
|
e7d999278d | ||
|
|
4043d20ea6 | ||
|
|
afe88ccfd6 | ||
|
|
56c3a04809 | ||
|
|
4530345a1f | ||
|
|
4a89ec8515 | ||
|
|
cb5f1c6485 | ||
|
|
15c0677a4b | ||
|
|
dc68b8148a | ||
|
|
1976034f12 | ||
|
|
727621fdac | ||
|
|
0f3806d358 | ||
|
|
dfb2bf3923 | ||
|
|
bf08a91191 | ||
|
|
f0e353cc1a | ||
|
|
456b1eddcc | ||
|
|
5e08f05437 | ||
|
|
9f9227bae4 | ||
|
|
76f47bce37 | ||
|
|
e1f54b30dc | ||
|
|
fc4e7e6c05 | ||
|
|
7aaa79b644 | ||
|
|
9b6f894be2 | ||
|
|
48f7ef2023 | ||
|
|
54692859fd | ||
|
|
1719244015 | ||
|
|
48f8c6c5b7 | ||
|
|
f0815e595b | ||
|
|
4f829017ed | ||
|
|
d2f8f05acb | ||
|
|
e8b1156bfd | ||
|
|
bf748773c8 | ||
|
|
a05b25ae90 | ||
|
|
3ceb3feccf | ||
|
|
b4944f23ef | ||
|
|
09c17b2dc5 | ||
|
|
6f7ff9f858 | ||
|
|
9e9af2a031 | ||
|
|
7d74e853ae | ||
|
|
1d627d570d | ||
|
|
9b0088f4f0 | ||
|
|
b50c7dbed4 | ||
|
|
f92c0313a6 | ||
|
|
233e1ee0a6 | ||
|
|
805b40ec76 | ||
|
|
86ca3e5be0 | ||
|
|
bb2143d9a0 | ||
|
|
ef662e0ccf | ||
|
|
30708a59f1 | ||
|
|
b0262cfe72 | ||
|
|
259886c1a8 | ||
|
|
f1b4b33727 | ||
|
|
38e8b690bd | ||
|
|
9a52b43e09 | ||
|
|
5e35cfc44a | ||
|
|
ac0ec6dfe6 | ||
|
|
361defc348 | ||
|
|
b9fc0da215 | ||
|
|
6ac8947168 | ||
|
|
5655930d12 | ||
|
|
18acc37324 | ||
|
|
e9155d719e | ||
|
|
16e77b02c2 | ||
|
|
adc1902649 | ||
|
|
1cc470bc5a | ||
|
|
b3f6efc7d0 | ||
|
|
d91fbf3ff4 | ||
|
|
e552593474 | ||
|
|
1f5a78f458 | ||
|
|
f490c15282 | ||
|
|
90a31debd1 | ||
|
|
416145a90e | ||
|
|
6285786282 | ||
|
|
f9f6a69c89 | ||
|
|
61da60bdf1 | ||
|
|
2d5ef3011a | ||
|
|
63dab6d224 | ||
|
|
38dd76dfb3 | ||
|
|
fe642de526 | ||
|
|
f4b7eefc38 | ||
|
|
5bbbad02b4 | ||
|
|
bd85dd5faf | ||
|
|
d91ba3d219 | ||
|
|
7992c40815 | ||
|
|
574b01db97 | ||
|
|
2d6049b7bd | ||
|
|
96d0f2e6f9 | ||
|
|
b46bd4d0dd | ||
|
|
244c76793c | ||
|
|
411fc46189 | ||
|
|
48427e330f | ||
|
|
5ddc2451c1 | ||
|
|
e357cad2bb | ||
|
|
80be8b2eaa | ||
|
|
9a5aaea8ca | ||
|
|
7d585615a9 | ||
|
|
3f3375dcac | ||
|
|
f555eae653 | ||
|
|
e805a6e037 | ||
|
|
3ed82ed7bb | ||
|
|
d638e512c9 | ||
|
|
204b966935 | ||
|
|
8318ba5e55 | ||
|
|
d39c595828 | ||
|
|
04154162c6 | ||
|
|
47f8e0f04c | ||
|
|
7e4ada5f4b | ||
|
|
b0b4f87848 | ||
|
|
d9085b82bf | ||
|
|
8e5770ff59 | ||
|
|
beb420c69d | ||
|
|
1d8b898924 | ||
|
|
b5b4c5ced7 | ||
|
|
b4e9d77895 | ||
|
|
21a08b3c7a | ||
|
|
6977d6bf73 | ||
|
|
39f81dd0c0 | ||
|
|
b3191f5e0b | ||
|
|
78f2f21142 | ||
|
|
497fc1d1ae | ||
|
|
d83e1c6fb2 | ||
|
|
c5218d485a | ||
|
|
19cbd3b8da | ||
|
|
c0c5630bfb | ||
|
|
969b5fcfbb | ||
|
|
0739fa2195 | ||
|
|
3c62adab3c | ||
|
|
edc601c35e | ||
|
|
951370eee7 | ||
|
|
fa81f4a150 | ||
|
|
e6a90c40fb | ||
|
|
2e0a1c00fa | ||
|
|
109754fac9 | ||
|
|
c3fbff3d7a | ||
|
|
6dd967fe24 | ||
|
|
f0bfdba944 | ||
|
|
7f76b5f4ee | ||
|
|
35f4d8f15a | ||
|
|
783f17e9e8 | ||
|
|
9e305c2840 | ||
|
|
78fa5d3110 | ||
|
|
d57482d966 | ||
|
|
3d7c2aff4b | ||
|
|
3757c5dde7 | ||
|
|
13c0a966ec | ||
|
|
d987619946 | ||
|
|
8fb9498fe6 | ||
|
|
b8f64a6693 | ||
|
|
e31bb047bf | ||
|
|
6897b813a6 | ||
|
|
83f86406b5 | ||
|
|
dde237ff0d | ||
|
|
6a4887e252 | ||
|
|
d945b94910 | ||
|
|
bc7dcf791d | ||
|
|
66c71fe3b7 | ||
|
|
16a7aeec3b | ||
|
|
94605345e5 | ||
|
|
ec9fa32c81 | ||
|
|
264aa15281 | ||
|
|
180a6ff824 | ||
|
|
5904ee1571 | ||
|
|
bc99341f85 | ||
|
|
8b9174b67e | ||
|
|
6c04a6cf69 | ||
|
|
14a63c4b97 | ||
|
|
098d13a34b | ||
|
|
488f247744 | ||
|
|
c74dbf03cd | ||
|
|
1f836c3235 | ||
|
|
bd2e2e77d5 | ||
|
|
6282ef14e8 | ||
|
|
558f23688f | ||
|
|
39fe057f9f | ||
|
|
541f2de599 | ||
|
|
68116254cd | ||
|
|
77ff4599ea | ||
|
|
652f5a3247 | ||
|
|
9b6e57b143 | ||
|
|
bdc19256bf | ||
|
|
de5eaf4467 | ||
|
|
ca884833d1 | ||
|
|
9fc164a69d | ||
|
|
0da2da83a5 | ||
|
|
bfdfa44edd | ||
|
|
ed1cfe5eb6 | ||
|
|
b696f3f5db | ||
|
|
7a0cf5ef9a | ||
|
|
d1b7cb6a36 | ||
|
|
b21d699472 | ||
|
|
029fadd778 | ||
|
|
215d50235b | ||
|
|
000e676397 | ||
|
|
208c045d3d | ||
|
|
ee20f59a8e | ||
|
|
925cf3dabb | ||
|
|
0049d0e926 | ||
|
|
56959808a9 | ||
|
|
8667a9680e | ||
|
|
8c7d129089 | ||
|
|
a3a9b98a1d | ||
|
|
f2f66579cb | ||
|
|
1354cf2a87 | ||
|
|
15f5592429 | ||
|
|
dc69094f00 | ||
|
|
8ad3783a36 | ||
|
|
15d5dd8e92 | ||
|
|
b07edb977b | ||
|
|
1509fc2039 | ||
|
|
2877bb8faa | ||
|
|
a83410cb49 | ||
|
|
4ff9f2235b | ||
|
|
1bc611f097 | ||
|
|
4e0a3941ff | ||
|
|
4e885dac3e | ||
|
|
eafd131a22 | ||
|
|
289ce3716b | ||
|
|
2242070bdc | ||
|
|
ee83cea11c | ||
|
|
6e571a43d8 | ||
|
|
466a0245a9 | ||
|
|
d9ce5e4ce7 | ||
|
|
6b0dd291c2 | ||
|
|
4ff77d0d7e | ||
|
|
e00da5d8d2 | ||
|
|
1a525a59ab | ||
|
|
d5581c4236 | ||
|
|
4bf950574c | ||
|
|
0b9e434c4b | ||
|
|
c4b1466643 | ||
|
|
488842029b | ||
|
|
1b0ce59371 | ||
|
|
97bea89204 | ||
|
|
0892dfc601 | ||
|
|
20d66ff401 | ||
|
|
e2fda532d1 | ||
|
|
68035af7b3 | ||
|
|
ee25555f0e | ||
|
|
e528510f5c | ||
|
|
afa0527b4c | ||
|
|
dd7d23498f | ||
|
|
eaaea2b24c | ||
|
|
58d0aefae1 | ||
|
|
11c9915a70 | ||
|
|
6cf6b0d645 | ||
|
|
1980a39b73 | ||
|
|
8d3fbeeb22 | ||
|
|
2678644c2c | ||
|
|
25da9fe119 | ||
|
|
03d89d22ec | ||
|
|
100cd25ffc | ||
|
|
6284a74a6e | ||
|
|
978cd8ba8e | ||
|
|
c76f28824c | ||
|
|
703ecfae40 | ||
|
|
b15c59aa48 | ||
|
|
98a4ce701c | ||
|
|
2fc0de8f4e | ||
|
|
66fd551d68 | ||
|
|
6e4e9a002b | ||
|
|
91278b0b3d | ||
|
|
ff9b3ed1a2 | ||
|
|
0c855d4ba8 | ||
|
|
9176e9d255 | ||
|
|
2bab917b3e | ||
|
|
b80086a349 | ||
|
|
8a4fca9bd5 | ||
|
|
13288a6b3a | ||
|
|
57ed552f43 | ||
|
|
5a4d65986d | ||
|
|
427b3bb774 | ||
|
|
4912f385c6 | ||
|
|
dcb6d0feab | ||
|
|
de8c762d79 | ||
|
|
056659304a | ||
|
|
525bf18a03 | ||
|
|
7714c3f611 | ||
|
|
768b9fb7c1 | ||
|
|
db4f028955 | ||
|
|
e3928ffbcc | ||
|
|
db5159bd5e | ||
|
|
2626e1ebf0 | ||
|
|
5d69ba0796 | ||
|
|
c39ad97b8e | ||
|
|
7c73f060ed | ||
|
|
f0aa7df3b0 | ||
|
|
5882dec23a | ||
|
|
835c9deb28 | ||
|
|
a4ecc7ac7f | ||
|
|
526a195e4d | ||
|
|
5e77560313 | ||
|
|
1abacfe90b | ||
|
|
d042c589df | ||
|
|
92e117c10a | ||
|
|
71db92ef61 | ||
|
|
9f0f2870d0 | ||
|
|
118bb728a9 | ||
|
|
9dd445b0ce | ||
|
|
8e1cc6e75b | ||
|
|
a36887d885 | ||
|
|
e300d04502 | ||
|
|
3d8afac9e1 | ||
|
|
81d2571f8f | ||
|
|
e4a0d2c56c | ||
|
|
d7aac5e10f | ||
|
|
55be189772 | ||
|
|
56352478fe | ||
|
|
f16d0406ea | ||
|
|
4359f1d5b3 | ||
|
|
8bb888c58e | ||
|
|
9d1871dc80 | ||
|
|
137f29e9e5 | ||
|
|
0e81a165e4 | ||
|
|
a73bcc05bc | ||
|
|
cd97018c4d | ||
|
|
a42ed5c388 | ||
|
|
f4bd80b5f9 | ||
|
|
498542f8be | ||
|
|
1aaa31ceb0 | ||
|
|
c9eb640510 | ||
|
|
766a706250 | ||
|
|
6fd63870f0 | ||
|
|
0be5350a1c | ||
|
|
48a5489c52 | ||
|
|
fe0fb9a884 | ||
|
|
91a2846794 | ||
|
|
625c9c2e40 | ||
|
|
710b338e6d | ||
|
|
024468adbd | ||
|
|
e4d173ad28 | ||
|
|
f4218b032a | ||
|
|
b87ebc6e1c | ||
|
|
d901b0ed34 | ||
|
|
519340dbf8 | ||
|
|
4c81585e32 | ||
|
|
a7f6a6cc16 | ||
|
|
a0e56757d8 | ||
|
|
a618c2a2c6 | ||
|
|
07d8f783e0 | ||
|
|
623bfe32f7 | ||
|
|
6862735aa0 | ||
|
|
5461794a1e | ||
|
|
d9cd9acd27 | ||
|
|
b2788ac7a0 | ||
|
|
d4f6e25f92 | ||
|
|
17bcaba026 | ||
|
|
aed4e6b1e4 | ||
|
|
50897e97af | ||
|
|
e57137b101 | ||
|
|
3370ecb2ef | ||
|
|
8225a5a12f | ||
|
|
5655362a00 | ||
|
|
2f2884e991 | ||
|
|
6061a1d2bf | ||
|
|
a28d316ca4 | ||
|
|
d53230245f | ||
|
|
d2e8d1c261 | ||
|
|
fe86e1fb0f | ||
|
|
03441c8582 | ||
|
|
d255edfd5f | ||
|
|
52187daafa | ||
|
|
6f46776484 | ||
|
|
50b2b37bc1 | ||
|
|
35eed6dca0 | ||
|
|
e337dd920d | ||
|
|
671c992f3a | ||
|
|
b5ff4d329b | ||
|
|
941eb063fb | ||
|
|
148e71985f | ||
|
|
efd22b36ef | ||
|
|
70ea24ac83 | ||
|
|
3c9b7ad60b | ||
|
|
18cc1273f6 | ||
|
|
a6f9f0d88c | ||
|
|
d36210ad6b | ||
|
|
b2262d062c | ||
|
|
0e6d1cd677 | ||
|
|
98368cbe06 | ||
|
|
0b4a4df1af | ||
|
|
c8a3d378b7 | ||
|
|
27be7fd217 | ||
|
|
97f210c9de | ||
|
|
a230fc6aaa | ||
|
|
b042a34726 | ||
|
|
1673ad7e70 | ||
|
|
f7eab31b57 | ||
|
|
4553188739 | ||
|
|
7550ac327e | ||
|
|
5b28cf6c66 | ||
|
|
4ea27cbdc2 | ||
|
|
f55d6c2e60 | ||
|
|
e474a2114c | ||
|
|
06e4834e27 | ||
|
|
083e7071f0 | ||
|
|
14be24a515 | ||
|
|
fbdfd8df69 | ||
|
|
17b5308515 | ||
|
|
8f4c0901f0 | ||
|
|
e18065a1bf | ||
|
|
ad0493f8a0 | ||
|
|
b85368f8d4 | ||
|
|
18ea1e7acf | ||
|
|
50d7627b81 | ||
|
|
5934cf718d | ||
|
|
c57ab0e703 | ||
|
|
2fb7281d07 | ||
|
|
4c0d55d2e6 | ||
|
|
a1904d4a80 | ||
|
|
8856f7efa6 | ||
|
|
bdedc48aca | ||
|
|
8a6b4e5499 | ||
|
|
f7a6de912c | ||
|
|
48fa48c159 | ||
|
|
c811beadb4 | ||
|
|
4c76ad2ba7 | ||
|
|
aa34473560 | ||
|
|
0a63b00199 | ||
|
|
f479a789db | ||
|
|
0761d5a8c2 | ||
|
|
d4ce501c75 | ||
|
|
c2643d0b80 | ||
|
|
078605c188 | ||
|
|
f6ad17729f | ||
|
|
cd3e9ed494 | ||
|
|
1f9f564def | ||
|
|
198755c3f5 | ||
|
|
d2b6d5f083 | ||
|
|
444e3192a2 | ||
|
|
c12d3df073 | ||
|
|
82b1548ae0 | ||
|
|
afd1d2ae6a | ||
|
|
90aafe1b5f | ||
|
|
143d33e285 | ||
|
|
09938e0aa6 | ||
|
|
fd59aff4d0 | ||
|
|
59133b9d8d | ||
|
|
cca42309c4 | ||
|
|
510ee1b282 | ||
|
|
c4d3020a1d | ||
|
|
132174568f | ||
|
|
f3af30ae53 | ||
|
|
6d3f270a8f | ||
|
|
86621661df | ||
|
|
d668917694 | ||
|
|
8bc1d09c4a | ||
|
|
76b90c179b | ||
|
|
ee17d9416a | ||
|
|
8a5a9cc0b3 | ||
|
|
347fc4ca44 | ||
|
|
61db1192e2 | ||
|
|
7c389a0641 | ||
|
|
4241120853 | ||
|
|
5998fc3edd | ||
|
|
392f8a1ce0 | ||
|
|
04203c4103 | ||
|
|
188cd7f023 | ||
|
|
8d17f5bd3c | ||
|
|
9d39880e9d | ||
|
|
f27e213d13 | ||
|
|
69ecb2c503 | ||
|
|
0585a0732f | ||
|
|
fab4adb07e | ||
|
|
5c3ae278be | ||
|
|
19a067f4e8 | ||
|
|
9430094072 | ||
|
|
a7b5e0df6c | ||
|
|
83e9725d02 | ||
|
|
086dea8594 | ||
|
|
50490b70b7 | ||
|
|
fac3a0acd7 | ||
|
|
73c4d6a604 | ||
|
|
6ba63db47f | ||
|
|
d3c8e4badb | ||
|
|
fdd16ad3c7 | ||
|
|
9178faef6d | ||
|
|
665318164e | ||
|
|
44f8254b43 | ||
|
|
e085fb1b10 | ||
|
|
48ed5d5c9b | ||
|
|
e2da300e09 | ||
|
|
e11a37ffec | ||
|
|
20c1f0576b | ||
|
|
fef8cece90 | ||
|
|
f549f26541 | ||
|
|
9ba836b814 | ||
|
|
d9d973b6aa | ||
|
|
cc4aed5a8e | ||
|
|
26e471616c | ||
|
|
f20c17f27d | ||
|
|
fd188f6f65 | ||
|
|
d10ba456d7 | ||
|
|
ee3808dd2f | ||
|
|
a345d41e9e | ||
|
|
b44d52fb3e | ||
|
|
d36ea8a906 | ||
|
|
28f8533d0a | ||
|
|
93265be974 | ||
|
|
587b9e8800 | ||
|
|
2028405af6 | ||
|
|
d2d97149fc | ||
|
|
bb9df3f54c | ||
|
|
c3a1b0f609 | ||
|
|
1b25ed5903 | ||
|
|
e87c96300b | ||
|
|
ba5bf33b5a | ||
|
|
94e1c09647 | ||
|
|
6bd7ad9413 | ||
|
|
d75032e853 | ||
|
|
261ecfea4d | ||
|
|
6f9cd94e66 | ||
|
|
ee2e1ed5fc | ||
|
|
92c1317d4c | ||
|
|
cfb97a087b | ||
|
|
76ba99aa6c | ||
|
|
330d7ed95c | ||
|
|
878e73524b | ||
|
|
13b0aa1a7b | ||
|
|
326342b834 | ||
|
|
8bbd610f12 | ||
|
|
549c2af988 | ||
|
|
d02c56a0e0 | ||
|
|
1f3654cc01 | ||
|
|
b6b6b0310f | ||
|
|
4c91bffcc7 | ||
|
|
d730a6cd06 | ||
|
|
67050f972e | ||
|
|
ffafd32693 | ||
|
|
ab4ec5e468 | ||
|
|
a07277feb8 | ||
|
|
a3cd4b6e66 | ||
|
|
25b7e76407 | ||
|
|
630cb13066 | ||
|
|
81188a0129 | ||
|
|
cf1abd90a0 | ||
|
|
6865a8be45 | ||
|
|
b63fcc80a1 | ||
|
|
a19ba6d48b | ||
|
|
70b6efe922 | ||
|
|
0b07269346 | ||
|
|
336954eeeb | ||
|
|
264487574b | ||
|
|
2988e5eef2 | ||
|
|
fe87889ccd | ||
|
|
0598ab4400 | ||
|
|
7d090f8ecc | ||
|
|
088ee47b3c | ||
|
|
a320b4c001 | ||
|
|
3adce95340 | ||
|
|
2a6bfd792a | ||
|
|
0816f1f589 | ||
|
|
497def8055 | ||
|
|
62be26ff47 | ||
|
|
6a81d80778 | ||
|
|
8914beae26 | ||
|
|
60c38a8dea | ||
|
|
4e0934debf | ||
|
|
17126303fa | ||
|
|
98fa95190c | ||
|
|
3a2261107c | ||
|
|
b1b64abed9 | ||
|
|
05356b6652 | ||
|
|
cbd0c6615d | ||
|
|
90e389efa2 | ||
|
|
00a0b26797 | ||
|
|
69b5ffe3bf | ||
|
|
31539294eb | ||
|
|
d1a2307134 | ||
|
|
97b777f1b2 | ||
|
|
c565bfc6bc | ||
|
|
a63137abc9 | ||
|
|
3ca06f8d50 | ||
|
|
e5b0e202be | ||
|
|
41db6aafd9 | ||
|
|
c66385d1f7 | ||
|
|
b0304fd875 | ||
|
|
5bfc3efc9c | ||
|
|
62845cfcf1 | ||
|
|
5c536e72df | ||
|
|
7cfece1592 | ||
|
|
f393b2c9ba | ||
|
|
164f2e5472 | ||
|
|
1434ecbc2e | ||
|
|
c2e443d4ac | ||
|
|
c079125458 | ||
|
|
4c1d7b34b9 | ||
|
|
53772b3fe3 | ||
|
|
28d3c40835 | ||
|
|
a01faecd0c | ||
|
|
a1b071e38e | ||
|
|
571622a0f4 | ||
|
|
4ab84d7209 | ||
|
|
4b90e70aad | ||
|
|
30a938e348 | ||
|
|
f6f4384e42 | ||
|
|
911b11211e | ||
|
|
ee0da9fc3a | ||
|
|
8bb596c74f | ||
|
|
d0fdeb33e0 | ||
|
|
ae7f41032e | ||
|
|
f30cb6badb | ||
|
|
97a9c1e08a | ||
|
|
1e699c027d | ||
|
|
9bd731729d | ||
|
|
dc17eccf76 | ||
|
|
3649a33afb | ||
|
|
d76bcc1366 | ||
|
|
2987f1c680 | ||
|
|
ab93ee0406 | ||
|
|
69dd933a7d | ||
|
|
5440de0453 | ||
|
|
f2e130c70e | ||
|
|
4c845c26f7 | ||
|
|
a43acca375 | ||
|
|
635520aa85 | ||
|
|
fce9759e93 | ||
|
|
18243cd4b0 | ||
|
|
75a6e51e68 | ||
|
|
312edd4b15 | ||
|
|
be3e67b2c1 | ||
|
|
a5765f81fe | ||
|
|
4bee92abb0 | ||
|
|
d9dcb90745 | ||
|
|
fbd25353d5 | ||
|
|
44c3e73577 | ||
|
|
9cbad1a448 | ||
|
|
3a3ddbc2bc | ||
|
|
63a3c33df9 | ||
|
|
32d7400f7d | ||
|
|
38191f976b | ||
|
|
c380e0e110 | ||
|
|
2199b8eca7 | ||
|
|
88455604a2 | ||
|
|
63eb69091f | ||
|
|
fc668810bd | ||
|
|
2773e3a48a | ||
|
|
18a03f6ccc | ||
|
|
e9348f5512 | ||
|
|
ce65226ea4 | ||
|
|
a3b3079b63 | ||
|
|
22de4bb13b | ||
|
|
eef7bb0cad | ||
|
|
8f1fbbdeef | ||
|
|
f3562e091f | ||
|
|
2001258ef4 | ||
|
|
52a66ea304 | ||
|
|
21ddb1541f | ||
|
|
a3ec6d79b0 | ||
|
|
bb8c315ffc | ||
|
|
f2ae398d3f | ||
|
|
02e33f68b4 | ||
|
|
8c4c9d88da | ||
|
|
49cb98a606 | ||
|
|
bdd18b384b | ||
|
|
32ab716f0d | ||
|
|
fe24529fce | ||
|
|
b59c097bca | ||
|
|
6d6414eb62 | ||
|
|
5b1c20d625 | ||
|
|
af6c8ab935 | ||
|
|
4acb5f924a | ||
|
|
b1b99f1066 | ||
|
|
004ee6f143 | ||
|
|
19455f89d3 | ||
|
|
18d98e3bd0 | ||
|
|
af038b7fc8 | ||
|
|
4a9297dc65 | ||
|
|
49fefb41a6 | ||
|
|
2fa64dfdd0 | ||
|
|
e0f777b9b4 | ||
|
|
dfe3de14d8 | ||
|
|
abe234c7ce | ||
|
|
d7bf67fd0e | ||
|
|
8218996f04 | ||
|
|
ed91e5d607 | ||
|
|
0bf0b0d381 | ||
|
|
d88559f5de | ||
|
|
f398115df3 | ||
|
|
82413fecab | ||
|
|
66352de1eb | ||
|
|
a7730f6e93 | ||
|
|
d5a5b24223 | ||
|
|
472dba2665 | ||
|
|
a5444b11b3 | ||
|
|
5a05a68524 | ||
|
|
36be61bbe1 | ||
|
|
ec6ab983f7 | ||
|
|
69630c2be0 | ||
|
|
8e605dd1d4 | ||
|
|
8bb0cf02ad | ||
|
|
60c054f457 | ||
|
|
5648ee974a | ||
|
|
dc4968f961 | ||
|
|
36d1370720 | ||
|
|
7ead5537f6 | ||
|
|
7fe797d44d | ||
|
|
a1e959420d | ||
|
|
4c99b40257 | ||
|
|
ead0958d18 | ||
|
|
220af8068e | ||
|
|
a1730b2d52 | ||
|
|
1a1d6c0835 | ||
|
|
06cbffdea4 | ||
|
|
4409f37000 | ||
|
|
c45e1faf42 | ||
|
|
732d42f174 | ||
|
|
524fde99f8 | ||
|
|
649246dc6a | ||
|
|
6c7ac25388 | ||
|
|
cb1d6ddeec | ||
|
|
58313889ee | ||
|
|
5ebc62a084 | ||
|
|
fcba384a15 | ||
|
|
3ea95ffa48 | ||
|
|
898fd36eca | ||
|
|
6cd88fb98f | ||
|
|
396de72c5d | ||
|
|
9932d60dee | ||
|
|
1ad93ce1fd | ||
|
|
2041513676 | ||
|
|
3ea1a2bf2f | ||
|
|
2b81ebca8e | ||
|
|
6a00895af8 | ||
|
|
1136ca4b24 | ||
|
|
b153bc11f2 | ||
|
|
27df97d710 | ||
|
|
a25b7b9b3f | ||
|
|
de9809ca5a | ||
|
|
8504c181c0 | ||
|
|
8a005ffb00 | ||
|
|
80ffa7a577 | ||
|
|
ca8f9a7e4a | ||
|
|
8d19d78297 | ||
|
|
483e5eb85a | ||
|
|
a4b4f491d2 | ||
|
|
08093f509a | ||
|
|
9a96223d12 | ||
|
|
0c2b194444 | ||
|
|
a06055168f | ||
|
|
e04546a9ae | ||
|
|
f6da1a045d | ||
|
|
acd386bb09 | ||
|
|
45225c0ce1 | ||
|
|
0bd884d309 | ||
|
|
aea2ae8d79 | ||
|
|
99ec5ab161 | ||
|
|
4431e7470f | ||
|
|
ed775405c6 | ||
|
|
4aefbe5aa8 | ||
|
|
786c467464 | ||
|
|
50182ef940 | ||
|
|
bf3aa2df09 | ||
|
|
0b744a2599 | ||
|
|
a75b8b40e2 | ||
|
|
2e23c08608 | ||
|
|
178f45ee26 | ||
|
|
7b16edc99c | ||
|
|
f3738a1630 | ||
|
|
34fa65132d | ||
|
|
19fe2d2f03 | ||
|
|
c796af7d07 | ||
|
|
b7251e2be2 | ||
|
|
6efede79c7 | ||
|
|
e58da80f8e | ||
|
|
bd556c33a0 | ||
|
|
878809ecb4 | ||
|
|
ea4966f494 | ||
|
|
f5d9b478d5 | ||
|
|
3d97fab16d | ||
|
|
af2ae11eb1 | ||
|
|
2c1fc30bfb | ||
|
|
5aa4199dfb | ||
|
|
773790c8ec | ||
|
|
c7dec8045e | ||
|
|
5d7d12415c | ||
|
|
8a066163fe | ||
|
|
08e57936fc | ||
|
|
7d474e17fa | ||
|
|
6eac25425c | ||
|
|
c0f1981d6f | ||
|
|
d3571942d7 | ||
|
|
8376b6f0f2 | ||
|
|
490a66d3fe | ||
|
|
2e182626b9 | ||
|
|
66f5f8ab12 | ||
|
|
50ecee99cc | ||
|
|
fc3f982309 | ||
|
|
b8e9aded6b | ||
|
|
74ce9f7a86 | ||
|
|
5b2957e7eb | ||
|
|
55a464f1f6 | ||
|
|
72ec6beb99 | ||
|
|
40eb4ea4ec | ||
|
|
895f3d9cb3 | ||
|
|
ae758da449 | ||
|
|
a067a6ba87 | ||
|
|
c271b88c87 | ||
|
|
1dfa619243 | ||
|
|
91bdc05a38 | ||
|
|
a8f06f5718 | ||
|
|
c458a1b59a | ||
|
|
29d59b3974 | ||
|
|
27f267cb3d | ||
|
|
0f41039b99 | ||
|
|
8f76db9e41 | ||
|
|
fc922e996c | ||
|
|
0a26ad8925 | ||
|
|
a8c6c7cb36 | ||
|
|
81fee53085 | ||
|
|
7c5f2d95a4 | ||
|
|
3d6bd0e23e | ||
|
|
8064e84276 | ||
|
|
f8ece2d984 | ||
|
|
442eef36ba | ||
|
|
7d737ad312 | ||
|
|
2b662d3a14 | ||
|
|
4f3fae81c1 | ||
|
|
7b266ad7c0 | ||
|
|
16601a67e3 | ||
|
|
224d59d50d | ||
|
|
6142d325c8 | ||
|
|
0e8edfe002 | ||
|
|
c1084923f7 | ||
|
|
f9472627f4 | ||
|
|
69735207e6 | ||
|
|
3b47f18a12 | ||
|
|
63f34e5a82 | ||
|
|
aa21aa686d | ||
|
|
9c2b2a2dcc | ||
|
|
baff979ab4 | ||
|
|
ec2719a572 | ||
|
|
07fe330e4f | ||
|
|
f98c3efef7 | ||
|
|
8b74dec910 | ||
|
|
dc4b8a5002 | ||
|
+2 |
dd5fecdf5a | ||
|
|
a466126d63 | ||
|
|
6c52754c8f | ||
|
|
e1ebcfa865 | ||
|
|
6464c81e72 | ||
|
|
0b7abfae3a | ||
|
|
76c16ad16e | ||
|
|
568f322a25 | ||
|
|
1b64959e2c | ||
|
|
1f722477ce | ||
|
|
2676331804 | ||
|
|
c7f705b274 | ||
|
|
6db25ffcfe | ||
|
|
0e43748fdc | ||
|
|
b2381fc689 | ||
|
|
fa75f56ffb | ||
|
|
8b151d07c2 | ||
|
|
e31e04639b | ||
|
|
53479fafa5 | ||
|
|
93a94dea45 | ||
|
|
83911d9ad1 | ||
|
|
cf7acb12d8 | ||
|
|
343ecb3ad4 | ||
|
|
72fa13b0e7 | ||
|
|
bee0663040 | ||
|
|
8dd045d9fd | ||
|
|
126aa6d4a7 | ||
|
|
f2e68060de | ||
|
|
6507a2ae3e | ||
|
|
effd79b465 | ||
|
|
bc531652e9 | ||
|
|
1c5581b765 | ||
|
|
b486599ab8 | ||
|
|
b94842c312 | ||
|
|
2c88a36f32 | ||
|
|
242f4d87e7 | ||
|
|
2255aacfd0 | ||
|
|
87cb0b484d | ||
|
|
73803f49fc | ||
|
|
5fd87752d5 | ||
|
|
94a90c4124 | ||
|
|
c3b0347155 | ||
|
|
600f712750 | ||
|
|
9e76869c36 | ||
|
|
cb540736ab | ||
|
|
66cd5bb4a5 | ||
|
|
1226e8be47 | ||
|
|
22ff7a92b8 | ||
|
|
2d01812f8d | ||
|
|
3bc0b821a1 | ||
|
|
148578399f |
+1
-7
@@ -3,11 +3,5 @@ __pycache__
|
|||||||
*.pyc
|
*.pyc
|
||||||
.env
|
.env
|
||||||
Dockerfile
|
Dockerfile
|
||||||
docs/
|
|
||||||
tmp/
|
tmp/
|
||||||
data/
|
data/
|
||||||
LICENSE
|
|
||||||
README.md
|
|
||||||
README_en.md
|
|
||||||
manager/static
|
|
||||||
manager/static/webui/
|
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
name: Bug 报告(Bug Report)
|
||||||
|
about: 反馈项目中的缺陷或问题
|
||||||
|
title: "[Bug] 简短描述问题"
|
||||||
|
labels: bug
|
||||||
|
assignees: ''
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🐛 问题描述
|
||||||
|
<!-- 清晰简洁地描述问题是什么 -->
|
||||||
|
|
||||||
|
## 🖥️ 环境信息
|
||||||
|
- 部署方式: 全模块部署 还是 单Server部署
|
||||||
|
- 版本号: 例如 0.3.x
|
||||||
|
|
||||||
|
## 🔍 告诉我们,应该怎么复现这个问题
|
||||||
|
<!-- 这个很重要,方便我们快速定位 -->
|
||||||
|
1. 打开 '...'
|
||||||
|
2. 点击 '...'
|
||||||
|
3. 滚动到 '...'
|
||||||
|
4. 看到错误
|
||||||
|
|
||||||
|
## 🤔 你原本希望是怎么样的
|
||||||
|
<!-- 简要描述预期的正确行为 -->
|
||||||
|
|
||||||
|
## 😯 提供一些截图
|
||||||
|
<!-- 如果适用,添加问题的截图 -->
|
||||||
|
1. 比如日志截图,越多越好
|
||||||
|
2. 比如界面反应
|
||||||
|
|
||||||
|
## 📋 其他信息
|
||||||
|
<!-- 在此添加关于此问题的任何其他上下文信息 -->
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
name: 代码优化建议(Code Improvement)
|
||||||
|
about: 提出对现有代码的优化或改进建议
|
||||||
|
title: "[Improvement] 简短描述改进内容"
|
||||||
|
labels: refactor
|
||||||
|
assignees: ''
|
||||||
|
---
|
||||||
|
|
||||||
|
## 💡 改进描述
|
||||||
|
<!-- 描述需要改进的代码部分以及存在的问题 -->
|
||||||
|
|
||||||
|
## 🌟 改进建议
|
||||||
|
<!-- 提出具体的改进方案或思路 -->
|
||||||
|
|
||||||
|
## 🛠️ 相关代码
|
||||||
|
<!-- 如果可能,提供相关代码片段或链接 -->
|
||||||
|
|
||||||
|
## 📋 其他信息
|
||||||
|
<!-- 在此添加任何其他相关信息 -->
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
name: 文档改进建议(Documentation Improvement)
|
||||||
|
about: 提出对项目文档的改进或补充建议
|
||||||
|
title: "[Docs] 简短描述改进内容"
|
||||||
|
labels: documentation
|
||||||
|
assignees: ''
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📚 改进描述
|
||||||
|
<!-- 描述需要改进的文档部分以及存在的问题 -->
|
||||||
|
|
||||||
|
## ✨ 改进建议
|
||||||
|
<!-- 提出具体的改进方案或内容 -->
|
||||||
|
|
||||||
|
## 📋 其他信息
|
||||||
|
<!-- 在此添加任何其他相关信息 -->
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
name: 功能请求(Feature Request)
|
||||||
|
about: 提出新的功能或改进建议
|
||||||
|
title: "[Feature] 简短描述功能"
|
||||||
|
labels: enhancement
|
||||||
|
assignees: ''
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🚀 需求描述
|
||||||
|
<!-- 清晰简洁地描述你希望发生什么 -->
|
||||||
|
|
||||||
|
## 🎯 解决方案
|
||||||
|
<!-- 描述你认为可行的解决方案或实现方式 -->
|
||||||
|
|
||||||
|
## 📝 备选方案
|
||||||
|
<!-- 描述你考虑过的替代方案或功能 -->
|
||||||
|
|
||||||
|
## 📋 其他信息
|
||||||
|
<!-- 在此添加关于需求的任何其他上下文信息 -->
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: pip
|
||||||
|
directory: /main/xiaozhi-server
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
name: Build Base Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- 'main/xiaozhi-server/requirements.txt'
|
||||||
|
- 'Dockerfile-server-base'
|
||||||
|
- '.github/workflows/build-base-image.yml'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-base:
|
||||||
|
name: Build and push server base image
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
packages: write
|
||||||
|
contents: read
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push server-base
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: Dockerfile-server-base
|
||||||
|
push: true
|
||||||
|
tags: ghcr.io/${{ github.repository }}:server-base
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
cache-from: type=gha,scope=server-base
|
||||||
|
cache-to: type=gha,mode=max,scope=server-base
|
||||||
|
build-args: |
|
||||||
|
BUILDKIT_PROGRESS=plain
|
||||||
|
|
||||||
|
- name: Output image info
|
||||||
|
run: |
|
||||||
|
echo "✅ Base image built and pushed successfully!"
|
||||||
|
echo "📦 Tag: ghcr.io/${{ github.repository }}:server-base"
|
||||||
@@ -4,25 +4,42 @@ on:
|
|||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v*.*.*' # 只在以 v 开头的标签推送时触发,例如 v1.0.0
|
- 'v*.*.*' # 只在以 v 开头的标签推送时触发,例如 v1.0.0
|
||||||
|
workflow_dispatch:
|
||||||
|
workflow_run:
|
||||||
|
workflows: ["Build Base Image"]
|
||||||
|
types:
|
||||||
|
- completed
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
name: Release Docker image
|
name: Release Docker images
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
packages: write
|
packages: write
|
||||||
contents: write
|
contents: write
|
||||||
id-token: write
|
id-token: write
|
||||||
issues: write
|
issues: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out the repo
|
- name: Check Disk Space
|
||||||
|
run: |
|
||||||
|
df -h
|
||||||
|
docker system df
|
||||||
|
|
||||||
|
- name: Clean up Docker resources
|
||||||
|
run: |
|
||||||
|
docker system prune -af
|
||||||
|
docker builder prune -af
|
||||||
|
|
||||||
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
driver-opts: |
|
||||||
|
network=host
|
||||||
|
|
||||||
- name: Log in to the GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
@@ -32,15 +49,40 @@ jobs:
|
|||||||
- name: Extract version from tag
|
- name: Extract version from tag
|
||||||
id: get_version
|
id: get_version
|
||||||
run: |
|
run: |
|
||||||
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
if [[ "$GITHUB_REF" =~ ^refs/tags/v([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
|
||||||
|
echo "VERSION=${BASH_REMATCH[1]}" >> $GITHUB_ENV
|
||||||
|
echo "IS_VERSION=true" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
echo "VERSION=latest" >> $GITHUB_ENV
|
||||||
|
echo "IS_VERSION=false" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Build and push Docker image
|
# 构建 xiaozhi-server 镜像
|
||||||
id: build_push
|
- name: Build and push xiaozhi-server
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
|
file: Dockerfile-server
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
ghcr.io/${{ github.repository }}:${{ env.VERSION }}
|
${{ env.IS_VERSION == 'true' && format('ghcr.io/{0}:server_{1},ghcr.io/{0}:server_latest', github.repository, env.VERSION) || format('ghcr.io/{0}:server_latest', github.repository) }}
|
||||||
ghcr.io/${{ github.repository }}:latest
|
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
|
build-args: |
|
||||||
|
BUILDKIT_PROGRESS=plain
|
||||||
|
|
||||||
|
# 构建 manager-api 镜像
|
||||||
|
- name: Build and push manager-web
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: Dockerfile-web
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ env.IS_VERSION == 'true' && format('ghcr.io/{0}:web_{1},ghcr.io/{0}:web_latest', github.repository, env.VERSION) || format('ghcr.io/{0}:web_latest', github.repository) }}
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
|
build-args: |
|
||||||
|
BUILDKIT_PROGRESS=plain
|
||||||
|
|||||||
+43
-2
@@ -3,6 +3,9 @@ __pycache__/
|
|||||||
.idea/
|
.idea/
|
||||||
*.py[cod]
|
*.py[cod]
|
||||||
*$py.class
|
*$py.class
|
||||||
|
.vscode
|
||||||
|
.claude
|
||||||
|
AGENTS.md
|
||||||
|
|
||||||
# C extensions
|
# C extensions
|
||||||
*.so
|
*.so
|
||||||
@@ -75,6 +78,7 @@ docs/_build/
|
|||||||
# PyBuilder
|
# PyBuilder
|
||||||
.pybuilder/
|
.pybuilder/
|
||||||
target/
|
target/
|
||||||
|
*.pid
|
||||||
|
|
||||||
# Jupyter Notebook
|
# Jupyter Notebook
|
||||||
.ipynb_checkpoints
|
.ipynb_checkpoints
|
||||||
@@ -132,17 +136,54 @@ dmypy.json
|
|||||||
# Pyre type checker
|
# Pyre type checker
|
||||||
.pyre/
|
.pyre/
|
||||||
|
|
||||||
|
# music directory
|
||||||
|
music/
|
||||||
|
|
||||||
# pytype static type analyzer
|
# pytype static type analyzer
|
||||||
.pytype/
|
.pytype/
|
||||||
|
|
||||||
# Cython debug symbols
|
# Cython debug symbols
|
||||||
cython_debug/
|
cython_debug/
|
||||||
*.iml
|
*.iml
|
||||||
model.pt
|
|
||||||
tmp
|
tmp
|
||||||
|
.history
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
main/xiaozhi-server/data
|
||||||
|
|
||||||
|
main/manager-web/node_modules
|
||||||
.config.yaml
|
.config.yaml
|
||||||
.secrets.yaml
|
.secrets.yaml
|
||||||
.private_config.yaml
|
.private_config.yaml
|
||||||
.env.development
|
.env.development
|
||||||
docker-compose.yml
|
|
||||||
|
# model files
|
||||||
|
main/xiaozhi-server/models/SenseVoiceSmall/model.pt
|
||||||
|
main/xiaozhi-server/models/sherpa-onnx*
|
||||||
|
/main/xiaozhi-server/audio_ref/
|
||||||
|
/audio_ref/
|
||||||
|
/asr-models/iic/SenseVoiceSmall/
|
||||||
|
/main/xiaozhi-server/asr-models/iic/SenseVoiceSmall/
|
||||||
|
/models/SenseVoiceSmall/model.pt
|
||||||
|
my_wakeup_words.mp3
|
||||||
|
!main/xiaozhi-server/config/assets/bind_code.wav
|
||||||
|
!main/xiaozhi-server/config/assets/wakeup_words.wav
|
||||||
|
!main/xiaozhi-server/config/assets/bind_not_found.wav
|
||||||
|
!main/xiaozhi-server/config/assets/bind_code/*.wav
|
||||||
|
!main/xiaozhi-server/config/assets/max_output_size.wav
|
||||||
|
main/manager-api/.vscode
|
||||||
|
# Ignore webpack cache directory
|
||||||
|
main/manager-web/.webpack_cache/
|
||||||
|
main/xiaozhi-server/mysql
|
||||||
|
uploadfile
|
||||||
|
*.json
|
||||||
|
.vscode
|
||||||
|
.cursor
|
||||||
|
|
||||||
|
!package.json
|
||||||
|
!**/package.json
|
||||||
|
|
||||||
|
# Do not ignore env and json files inside manager-mobile
|
||||||
|
!main/manager-mobile/**/env/
|
||||||
|
!main/manager-mobile/**/.env*
|
||||||
|
!main/manager-mobile/**/*.json
|
||||||
|
!main/xiaozhi-server/**/*.json
|
||||||
-45
@@ -1,45 +0,0 @@
|
|||||||
# 第一阶段:前端构建
|
|
||||||
|
|
||||||
FROM kalicyh/node:v18-alpine AS frontend-builder
|
|
||||||
|
|
||||||
WORKDIR /app/ZhiKongTaiWeb
|
|
||||||
|
|
||||||
# RUN corepack enable && yarn config set registry https://registry.npmmirror.com
|
|
||||||
|
|
||||||
COPY ZhiKongTaiWeb/package.json ZhiKongTaiWeb/yarn.lock ./
|
|
||||||
|
|
||||||
RUN yarn install --frozen-lockfile
|
|
||||||
|
|
||||||
COPY ZhiKongTaiWeb .
|
|
||||||
RUN yarn build
|
|
||||||
|
|
||||||
# 第二阶段:构建 Python 依赖
|
|
||||||
|
|
||||||
FROM kalicyh/poetry:v3.10_xiaozhi AS builder
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# 同时拷贝本地环境.venv
|
|
||||||
COPY . .
|
|
||||||
# 检查是否有缺失
|
|
||||||
RUN poetry install --no-root
|
|
||||||
|
|
||||||
# 使用清华源加速apt安装,该镜像内置所以注释
|
|
||||||
# RUN rm -rf /etc/apt/sources.list.d/* && \
|
|
||||||
# echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware" > /etc/apt/sources.list && \
|
|
||||||
# echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
|
|
||||||
# echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
|
|
||||||
# echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
|
|
||||||
# apt-get update && \
|
|
||||||
# apt-get install -y --no-install-recommends libopus0 ffmpeg && \
|
|
||||||
# apt-get clean
|
|
||||||
|
|
||||||
# 从构建阶段复制虚拟环境和前端构建产物
|
|
||||||
COPY --from=frontend-builder /app/ZhiKongTaiWeb/dist /app/manager/static/webui
|
|
||||||
|
|
||||||
# 设置虚拟环境路径
|
|
||||||
ENV PATH="/app/.venv/bin:$PATH"
|
|
||||||
|
|
||||||
# 启动应用
|
|
||||||
ENTRYPOINT ["poetry", "run", "python"]
|
|
||||||
CMD ["app.py"]
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
# 第一阶段:前端构建
|
|
||||||
FROM node:18 AS frontend-builder
|
|
||||||
|
|
||||||
WORKDIR /app/ZhiKongTaiWeb
|
|
||||||
|
|
||||||
# 配置npm使用淘宝源
|
|
||||||
RUN npm config set registry https://registry.npmmirror.com
|
|
||||||
|
|
||||||
COPY ZhiKongTaiWeb/package*.json ./
|
|
||||||
|
|
||||||
# 安装axios依赖
|
|
||||||
RUN npm install axios
|
|
||||||
RUN npm install
|
|
||||||
|
|
||||||
COPY ZhiKongTaiWeb .
|
|
||||||
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
# 第二阶段:构建Python依赖
|
|
||||||
FROM python:3.10-slim AS builder
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY requirements.txt .
|
|
||||||
|
|
||||||
# 优化apt安装
|
|
||||||
RUN pip install --no-cache-dir -r requirements.txt \
|
|
||||||
-i https://mirrors.aliyun.com/pypi/simple/
|
|
||||||
|
|
||||||
# 第三阶段:生产镜像
|
|
||||||
FROM python:3.10-slim
|
|
||||||
|
|
||||||
WORKDIR /opt/xiaozhi-esp32-server
|
|
||||||
|
|
||||||
# 优化apt安装
|
|
||||||
RUN echo "deb https://mirrors.aliyun.com/debian/ bookworm main contrib non-free non-free-firmware" > /etc/apt/sources.list && \
|
|
||||||
echo "deb https://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
|
|
||||||
apt-get update && \
|
|
||||||
apt-get install -y --no-install-recommends libopus0 ffmpeg && \
|
|
||||||
apt-get clean && \
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# 从构建阶段复制Python包和前端构建产物
|
|
||||||
COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
|
|
||||||
COPY --from=frontend-builder /app/ZhiKongTaiWeb/dist /opt/xiaozhi-esp32-server/manager/static/webui
|
|
||||||
|
|
||||||
# 复制应用代码
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
# 启动应用
|
|
||||||
CMD ["python", "app.py"]
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# 生产镜像,仅包含应用代码
|
||||||
|
FROM ghcr.io/xinnan-tech/xiaozhi-esp32-server:server-base
|
||||||
|
|
||||||
|
COPY main/xiaozhi-server .
|
||||||
|
|
||||||
|
# 启动应用
|
||||||
|
CMD ["python", "app.py"]
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
# Dockerfile-server-base
|
||||||
|
# 基础镜像,包含系统依赖和Python包
|
||||||
|
FROM python:3.10-slim
|
||||||
|
|
||||||
|
# 安装系统依赖
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y --no-install-recommends libopus0 ffmpeg locales && \
|
||||||
|
sed -i '/zh_CN.UTF-8/s/^# //g' /etc/locale.gen && \
|
||||||
|
locale-gen && \
|
||||||
|
apt-get clean && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# 配置pip使用国内镜像源(阿里云)并设置超时和重试
|
||||||
|
RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ && \
|
||||||
|
pip config set global.trusted-host mirrors.aliyun.com && \
|
||||||
|
pip config set global.timeout 120 && \
|
||||||
|
pip config set install.retries 5
|
||||||
|
|
||||||
|
# 设置环境变量以确保正确的字符编码
|
||||||
|
ENV LANG=zh_CN.UTF-8 \
|
||||||
|
LC_ALL=zh_CN.UTF-8 \
|
||||||
|
LANGUAGE=zh_CN:zh \
|
||||||
|
PYTHONIOENCODING=utf-8
|
||||||
|
|
||||||
|
WORKDIR /opt/xiaozhi-esp32-server
|
||||||
|
|
||||||
|
# 复制requirements.txt
|
||||||
|
COPY main/xiaozhi-server/requirements.txt .
|
||||||
|
|
||||||
|
# 安装Python依赖
|
||||||
|
RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
|
||||||
|
pip install --no-cache-dir -r requirements.txt --default-timeout=120 --retries 5
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
# 第一阶段:构建Vue前端
|
||||||
|
FROM node:18 AS web-builder
|
||||||
|
WORKDIR /app
|
||||||
|
COPY main/manager-web/package*.json ./
|
||||||
|
RUN npm install
|
||||||
|
COPY main/manager-web .
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
# 第二阶段:构建Java后端
|
||||||
|
FROM maven:3.9.4-eclipse-temurin-21 AS api-builder
|
||||||
|
WORKDIR /app
|
||||||
|
COPY main/manager-api/pom.xml .
|
||||||
|
COPY main/manager-api/src ./src
|
||||||
|
RUN mvn clean package -Dmaven.test.skip=true
|
||||||
|
|
||||||
|
# 第三阶段:构建最终镜像
|
||||||
|
FROM bellsoft/liberica-runtime-container:jre-21-glibc
|
||||||
|
|
||||||
|
# 安装Nginx和字体库
|
||||||
|
RUN apk update && \
|
||||||
|
apk add --no-cache --no-scripts \
|
||||||
|
nginx \
|
||||||
|
bash \
|
||||||
|
fontconfig \
|
||||||
|
ttf-dejavu \
|
||||||
|
&& rm -rf /var/cache/apk/* \
|
||||||
|
&& mkdir -p /run/nginx /var/log/nginx /var/tmp/nginx /etc/nginx/conf.d
|
||||||
|
|
||||||
|
# 复制项目自带的中文字体
|
||||||
|
COPY main/manager-web/public/generator/static/fonts/*.ttf /usr/share/fonts/
|
||||||
|
|
||||||
|
# 更新字体缓存
|
||||||
|
RUN fc-cache -f -v
|
||||||
|
|
||||||
|
# 配置Nginx
|
||||||
|
COPY docs/docker/nginx.conf /etc/nginx/nginx.conf
|
||||||
|
|
||||||
|
# 复制前端构建产物
|
||||||
|
COPY --from=web-builder /app/dist /usr/share/nginx/html
|
||||||
|
|
||||||
|
# 复制Java后端JAR包
|
||||||
|
COPY --from=api-builder /app/target/xiaozhi-esp32-api.jar /app/xiaozhi-esp32-api.jar
|
||||||
|
|
||||||
|
# 暴露端口
|
||||||
|
EXPOSE 8002
|
||||||
|
|
||||||
|
# 启动脚本
|
||||||
|
COPY docs/docker/start.sh /start.sh
|
||||||
|
RUN chmod +x /start.sh
|
||||||
|
CMD ["/start.sh"]
|
||||||
@@ -1,11 +1,45 @@
|
|||||||

|
[](https://github.com/xinnan-tech/xiaozhi-esp32-server)
|
||||||
|
|
||||||
# 小智 ESP-32 后端服务(xiaozhi-esp32-server)
|
<h1 align="center">小智后端服务xiaozhi-esp32-server</h1>
|
||||||
|
|
||||||
(中文 | [English](README_en.md))
|
<p align="center">
|
||||||
|
本项目基于人机共生智能理论和技术研发智能终端软硬件体系<br/>为开源智能硬件项目
|
||||||
|
<a href="https://github.com/78/xiaozhi-esp32">xiaozhi-esp32</a>提供后端服务<br/>
|
||||||
|
根据<a href="https://ccnphfhqs21z.feishu.cn/wiki/M0XiwldO9iJwHikpXD5cEx71nKh">小智通信协议</a>使用Python、Java、Vue实现<br/>
|
||||||
|
支持MQTT+UDP协议、Websocket协议、MCP接入点、声纹识别、知识库
|
||||||
|
</p>
|
||||||
|
|
||||||
本项目为开源智能硬件项目 [xiaozhi-esp32](https://github.com/78/xiaozhi-esp32)
|
<p align="center">
|
||||||
提供后端服务。根据 [小智通信协议](https://ccnphfhqs21z.feishu.cn/wiki/M0XiwldO9iJwHikpXD5cEx71nKh) 使用 `Python` 实现。
|
<a href="./docs/FAQ.md">常见问题</a>
|
||||||
|
· <a href="https://github.com/xinnan-tech/xiaozhi-esp32-server/issues">反馈问题</a>
|
||||||
|
· <a href="./README.md#%E9%83%A8%E7%BD%B2%E6%96%87%E6%A1%A3">部署文档</a>
|
||||||
|
· <a href="https://github.com/xinnan-tech/xiaozhi-esp32-server/releases">更新日志</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="./README.md"><img alt="简体中文版自述文件" src="https://img.shields.io/badge/简体中文-DBEDFA"></a>
|
||||||
|
<a href="./README_en.md"><img alt="README in English" src="https://img.shields.io/badge/English-DFE0E5"></a>
|
||||||
|
<a href="./README_vi.md"><img alt="Tiếng Việt" src="https://img.shields.io/badge/Tiếng Việt-DFE0E5"></a>
|
||||||
|
<a href="./README_de.md"><img alt="Deutsch" src="https://img.shields.io/badge/Deutsch-DFE0E5"></a>
|
||||||
|
<a href="./README_pt_BR.md"><img alt="Português (Brasil)" src="https://img.shields.io/badge/Português (Brasil)-DFE0E5"></a>
|
||||||
|
<a href="https://github.com/xinnan-tech/xiaozhi-esp32-server/releases">
|
||||||
|
<img alt="GitHub Contributors" src="https://img.shields.io/github/v/release/xinnan-tech/xiaozhi-esp32-server?logo=docker" />
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/xinnan-tech/xiaozhi-esp32-server/blob/main/LICENSE">
|
||||||
|
<img alt="GitHub pull requests" src="https://img.shields.io/badge/license-MIT-white?labelColor=black" />
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/xinnan-tech/xiaozhi-esp32-server">
|
||||||
|
<img alt="stars" src="https://img.shields.io/github/stars/xinnan-tech/xiaozhi-esp32-server?color=ffcb47&labelColor=black" />
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
Spearheaded by Professor Siyuan Liu's Team (South China University of Technology)
|
||||||
|
</br>
|
||||||
|
刘思源教授团队主导研发(华南理工大学)
|
||||||
|
</br>
|
||||||
|
<img src="./docs/images/hnlg.jpg" alt="华南理工大学" width="50%">
|
||||||
|
</p>
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -21,7 +55,88 @@
|
|||||||
<td>
|
<td>
|
||||||
<a href="https://www.bilibili.com/video/BV1FMFyejExX" target="_blank">
|
<a href="https://www.bilibili.com/video/BV1FMFyejExX" target="_blank">
|
||||||
<picture>
|
<picture>
|
||||||
<img alt="小智esp32连接自己的后台模型" src="docs/images/demo1.png" />
|
<img alt="响应速度感受" src="docs/images/demo9.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1vchQzaEse" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="速度优化秘诀" src="docs/images/demo6.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1C1tCzUEZh" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="复杂医疗场景" src="docs/images/demo1.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1zUW5zJEkq" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="MQTT指令下发" src="docs/images/demo4.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1Exu3zqEDe" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="声纹识别" src="docs/images/demo14.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1pNXWYGEx1" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="控制家电开关" src="docs/images/demo5.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1ZQKUzYExM" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="MCP接入点" src="docs/images/demo13.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1TJ7WzzEo6" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="多指令任务" src="docs/images/demo11.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1VC96Y5EMH" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="播放音乐" src="docs/images/demo7.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1Z8XuYZEAS" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="天气插件" src="docs/images/demo8.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV12J7WzBEaH" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="实时打断" src="docs/images/demo10.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1Co76z7EvK" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="拍照识物品" src="docs/images/demo12.png" />
|
||||||
</picture>
|
</picture>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
@@ -40,124 +155,153 @@
|
|||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="https://www.bilibili.com/video/av114036381327149" target="_blank">
|
<a href="https://www.bilibili.com/video/BV17LXWYvENb" target="_blank">
|
||||||
<picture>
|
<picture>
|
||||||
<img alt="控制家电开关" src="docs/images/demo5.png" />
|
<img alt="播报新闻" src="docs/images/demo0.png" />
|
||||||
</picture>
|
</picture>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
</tr>
|
||||||
<a href="https://www.bilibili.com/video/BV1kgA2eYEQ9" target="_blank">
|
|
||||||
<picture>
|
|
||||||
<img alt="成本最低配置" src="docs/images/demo4.png" />
|
|
||||||
</picture>
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 系统要求与部署前提 🖥️
|
|
||||||
|
|
||||||
- **硬件**:一套兼容 `xiaozhi-esp32`
|
|
||||||
的硬件设备(具体型号请参考 [此处](https://rcnv1t9vps13.feishu.cn/wiki/DdgIw4BUgivWDPkhMj1cGIYCnRf))。
|
|
||||||
- **服务器**:至少 4 核 CPU、8G 内存的电脑或服务器。
|
|
||||||
- **固件编译**:请将后端服务的接口地址更新至 `xiaozhi-esp32` 项目中,再重新编译固件并烧录到设备上。
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 警告 ⚠️
|
## 警告 ⚠️
|
||||||
|
|
||||||
本项目成立时间较短,还未通过网络安全测评,请勿在生产环境中使用。
|
1、本项目为开源软件,本软件与对接的任何第三方API服务商(包括但不限于语音识别、大模型、语音合成等平台)均不存在商业合作关系,不为其服务质量及资金安全提供任何形式的担保。
|
||||||
|
建议使用者优先选择持有相关业务牌照的服务商,并仔细阅读其服务协议及隐私政策。本软件不托管任何账户密钥、不参与资金流转、不承担充值资金损失风险。
|
||||||
|
|
||||||
如果您在公网环境中部署学习本项目,请务必在配置文件 `config.yaml` 中开启防护:
|
2、本项目功能未完善,且未通过网络安全测评,请勿在生产环境中使用。 如果您在公网环境中部署学习本项目,请务必做好必要的防护。
|
||||||
|
|
||||||
```yaml
|
|
||||||
server:
|
|
||||||
auth:
|
|
||||||
# 开启防护
|
|
||||||
enabled: true
|
|
||||||
```
|
|
||||||
|
|
||||||
开启防护后,您需要根据实际情况校验机器的 token 或 mac 地址,详细请参见配置说明。
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## 部署文档
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
本项目提供两种部署方式,请根据您的具体需求选择:
|
||||||
|
|
||||||
|
#### 🚀 部署方式选择
|
||||||
|
| 部署方式 | 特点 | 适用场景 | 部署文档 | 配置要求 | 视频教程 |
|
||||||
|
|---------|------|---------|---------|---------|---------|
|
||||||
|
| **最简化安装** | 智能对话、单智能体管理 | 低配置环境,数据存储在配置文件,无需数据库 | [①Docker版](./docs/Deployment.md#%E6%96%B9%E5%BC%8F%E4%B8%80docker%E5%8F%AA%E8%BF%90%E8%A1%8Cserver) / [②源码部署](./docs/Deployment.md#%E6%96%B9%E5%BC%8F%E4%BA%8C%E6%9C%AC%E5%9C%B0%E6%BA%90%E7%A0%81%E5%8F%AA%E8%BF%90%E8%A1%8Cserver)| 如果使用`FunASR`要2核4G,如果全API,要2核2G | - |
|
||||||
|
| **全模块安装** | 智能对话、多用户管理、多智能体管理、智控台界面操作 | 完整功能体验,数据存储在数据库 |[①Docker版](./docs/Deployment_all.md#%E6%96%B9%E5%BC%8F%E4%B8%80docker%E8%BF%90%E8%A1%8C%E5%85%A8%E6%A8%A1%E5%9D%97) / [②源码部署](./docs/Deployment_all.md#%E6%96%B9%E5%BC%8F%E4%BA%8C%E6%9C%AC%E5%9C%B0%E6%BA%90%E7%A0%81%E8%BF%90%E8%A1%8C%E5%85%A8%E6%A8%A1%E5%9D%97) / [③源码部署自动更新教程](./docs/dev-ops-integration.md) | 如果使用`FunASR`要4核8G,如果全API,要2核4G| [本地源码启动视频教程](https://www.bilibili.com/video/BV1wBJhz4Ewe) |
|
||||||
|
|
||||||
|
常见问题及相关教程,可参考[这个链接](./docs/FAQ.md)
|
||||||
|
|
||||||
|
> 💡 提示:以下是按最新代码部署后的测试平台,有需要可烧录测试,并发为6个,每天会清空数据,
|
||||||
|
|
||||||
|
```
|
||||||
|
智控台地址: https://2662r3426b.vicp.fun
|
||||||
|
智控台(h5版): https://2662r3426b.vicp.fun/h5/index.html
|
||||||
|
|
||||||
|
服务测试工具: https://2662r3426b.vicp.fun/test/
|
||||||
|
OTA接口地址: https://2662r3426b.vicp.fun/xiaozhi/ota/
|
||||||
|
Websocket接口地址: wss://2662r3426b.vicp.fun/xiaozhi/v1/
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 🚩 配置说明和推荐
|
||||||
|
> [!Note]
|
||||||
|
> 本项目提供两种配置方案:
|
||||||
|
>
|
||||||
|
> 1. `入门全免费`配置:适合个人家庭使用,所有组件均采用免费方案,无需额外付费。
|
||||||
|
>
|
||||||
|
> 2. `流式配置`:适合演示、培训、超过2个并发等场景,采用流式处理技术,响应速度更快,体验更佳。
|
||||||
|
>
|
||||||
|
> 自`0.5.2`版本起,项目支持流式配置,相比早期版本,响应速度提升约`2.5秒`,显著改善用户体验。
|
||||||
|
|
||||||
|
| 模块名称 | 入门全免费设置 | 流式配置 |
|
||||||
|
|:---:|:---:|:---:|
|
||||||
|
| ASR(语音识别) | FunASR(本地) | 👍XunfeiStreamASR(讯飞流式) |
|
||||||
|
| LLM(大模型) | glm-4-flash(智谱) | 👍qwen-flash(阿里百炼) |
|
||||||
|
| VLLM(视觉大模型) | glm-4v-flash(智谱) | 👍qwen2.5-vl-3b-instructh(阿里百炼) |
|
||||||
|
| TTS(语音合成) | ✅LinkeraiTTS(灵犀流式) | 👍HuoshanDoubleStreamTTS(火山流式) |
|
||||||
|
| Intent(意图识别) | function_call(函数调用) | function_call(函数调用) |
|
||||||
|
| Memory(记忆功能) | mem_local_short(本地短期记忆) | mem_local_short(本地短期记忆) |
|
||||||
|
|
||||||
|
如果您关心各组件的耗时,请查阅[小智各组件性能测试报告](https://github.com/xinnan-tech/xiaozhi-performance-research),可按报告中的测试方法在您的环境中实际测试。
|
||||||
|
|
||||||
|
#### 🔧 测试工具
|
||||||
|
本项目提供以下测试工具,帮助您验证系统和选择合适的模型:
|
||||||
|
|
||||||
|
| 工具名称 | 位置 | 使用方法 | 功能说明 |
|
||||||
|
|:---:|:---|:---:|:---:|
|
||||||
|
| 音频交互测试工具 | main》xiaozhi-server》test》test_page.html | 使用谷歌浏览器直接打开 | 测试音频播放和接收功能,验证Python端音频处理是否正常 |
|
||||||
|
| 模型响应测试工具 | main》xiaozhi-server》performance_tester.py | 执行 `python performance_tester.py` | 测试ASR(语音识别)、LLM(大模型)、VLLM(视觉模型)、TTS(语音合成)三个核心模块的响应速度 |
|
||||||
|
|
||||||
|
> 💡 提示:测试模型速度时,只会测试配置了密钥的模型。
|
||||||
|
|
||||||
|
---
|
||||||
## 功能清单 ✨
|
## 功能清单 ✨
|
||||||
|
|
||||||
### 已实现 ✅
|
### 已实现 ✅
|
||||||
|

|
||||||
- **通信协议**
|
| 功能模块 | 描述 |
|
||||||
基于 `xiaozhi-esp32` 协议,通过 WebSocket 实现数据交互。
|
|:---:|:---|
|
||||||
- **对话交互**
|
| 核心架构 | 基于[MQTT+UDP网关](https://github.com/xinnan-tech/xiaozhi-esp32-server/blob/main/docs/mqtt-gateway-integration.md)、WebSocket、HTTP服务器,提供完整的控制台管理和认证系统 |
|
||||||
支持唤醒对话、手动对话及实时打断。长时间无对话时自动休眠
|
| 语音交互 | 支持流式ASR(语音识别)、流式TTS(语音合成)、VAD(语音活动检测),支持多语言识别和语音处理 |
|
||||||
- **多语言识别**
|
| 声纹识别 | 支持多用户声纹注册、管理和识别,与ASR并行处理,实时识别说话人身份并传递给LLM进行个性化回应 |
|
||||||
支持国语、粤语、英语、日语、韩语(默认使用 FunASR)。
|
| 智能对话 | 支持多种LLM(大语言模型),实现智能对话 |
|
||||||
- **LLM 模块**
|
| 视觉感知 | 支持多种VLLM(视觉大模型),实现多模态交互 |
|
||||||
支持灵活切换 LLM 模块,默认使用 ChatGLMLLM,也可选用阿里百炼、DeepSeek、Ollama 等接口。
|
| 意图识别 | 支持外挂的大模型意图识别、大模型自主函数调用,提供插件化意图处理机制 |
|
||||||
- **TTS 模块**
|
| 记忆系统 | 支持本地短期记忆、mem0ai接口记忆、PowerMem智能记忆,具备记忆总结功能 |
|
||||||
支持 EdgeTTS(默认)、火山引擎豆包 TTS 等多种 TTS 接口,满足语音合成需求。
|
| 知识库 | 支持RAGFlow知识库,让大模型判断需要调度知识库后再回答 |
|
||||||
|
| 工具调用 | 支持客户端IOT协议、客户MCP协议、服务端MCP协议、MCP接入点协议、自定义工具函数 |
|
||||||
|
| 指令下发 | 依托MQTT协议,支持从智控台将MCP指令下发到ESP32设备 |
|
||||||
|
| 管理后台 | 提供Web管理界面,支持用户管理、系统配置和设备管理;界面支持中文简体、中文繁体、英文显示 |
|
||||||
|
| 测试工具 | 提供性能测试工具、视觉模型测试工具和音频交互测试工具 |
|
||||||
|
| 部署支持 | 支持Docker部署和本地部署,提供完整的配置文件管理 |
|
||||||
|
| 插件系统 | 支持功能插件扩展、自定义插件开发和插件热加载 |
|
||||||
|
|
||||||
### 正在开发 🚧
|
### 正在开发 🚧
|
||||||
|
|
||||||
- 对话记忆功能
|
想了解具体开发计划进度,[请点击这里](https://github.com/users/xinnan-tech/projects/3)。常见问题及相关教程,可参考[这个链接](./docs/FAQ.md)
|
||||||
- 多种心情模式
|
|
||||||
- 智控台webui
|
如果你是一名软件开发者,这里有一份[《致开发者的公开信》](docs/contributor_open_letter.md),欢迎加入!
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 产品生态 👬
|
||||||
|
小智是一个生态,当你使用这个产品时,也可以看看其他在这个生态圈的[优秀项目](https://github.com/78/xiaozhi-esp32/blob/main/README_zh.md#%E7%9B%B8%E5%85%B3%E5%BC%80%E6%BA%90%E9%A1%B9%E7%9B%AE)
|
||||||
|
|
||||||

|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 本项目支持的平台/组件列表 📋
|
## 本项目支持的平台/组件列表 📋
|
||||||
|
### LLM 语言模型
|
||||||
|
|
||||||
### LLM
|
| 使用方式 | 支持平台 | 免费平台 |
|
||||||
|
|:---:|:---:|:---:|
|
||||||
| 类型 | 平台名称 | 使用方式 | 收费模式 | 备注 |
|
| openai 接口调用 | 阿里百炼、火山引擎、DeepSeek、智谱、Gemini、科大讯飞 | 智谱、Gemini |
|
||||||
|:---:|:------------------:|:---------------------:|:--------:|:-----------------------------------------------------------------:|
|
| ollama 接口调用 | Ollama | - |
|
||||||
| LLM | 阿里百炼 (AliLLM) | openai 接口调用 | 消耗 token | [点击申请密钥](https://bailian.console.aliyun.com/?apiKey=1#/api-key) |
|
| dify 接口调用 | Dify | - |
|
||||||
| LLM | 深度求索 (DeepSeekLLM) | openai 接口调用 | 消耗 token | [点击申请密钥](https://platform.deepseek.com/) |
|
| fastgpt 接口调用 | Fastgpt | - |
|
||||||
| LLM | 智谱(ChatGLMLLM) | openai 接口调用 | 免费 | 虽然免费,仍需[点击申请密钥](https://bigmodel.cn/usercenter/proj-mgmt/apikeys) |
|
| coze 接口调用 | Coze | - |
|
||||||
| LLM | OllamaLLM | ollama 接口调用 | 免费/自定义 | 需预先下载模型(`ollama pull`),服务地址:`http://localhost:11434` |
|
| xinference 接口调用 | Xinference | - |
|
||||||
| LLM | DifyLLM | dify 接口调用 | 消耗 token | 本地化部署,注意配置提示词需在 Dify 控制台设置 |
|
| homeassistant 接口调用 | HomeAssistant | - |
|
||||||
| LLM | GeminiLLM | gemini 接口调用 | 免费 | [点击申请密钥](https://aistudio.google.com/apikey) |
|
|
||||||
| LLM | CozeLLM | coze 接口调用 | 消耗 token | 需提供 bot_id、user_id 及个人令牌 |
|
|
||||||
| LLM | Home Assistant | homeassistant语音助手接口调用 | 免费 | 需提供home assistant令牌 |
|
|
||||||
|
|
||||||
实际上,任何支持 openai 接口调用的 LLM 均可接入使用。
|
实际上,任何支持 openai 接口调用的 LLM 均可接入使用。
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### TTS
|
### VLLM 视觉模型
|
||||||
|
|
||||||
| 类型 | 平台名称 | 使用方式 | 收费模式 | 备注 |
|
| 使用方式 | 支持平台 | 免费平台 |
|
||||||
|:---:|:----------------------:|:----:|:--------:|:-------------------------------------------------------------------------:|
|
|:---:|:---:|:---:|
|
||||||
| TTS | EdgeTTS | 接口调用 | 免费 | 默认 TTS,基于微软语音合成技术 |
|
| openai 接口调用 | 阿里百炼、智谱ChatGLMVLLM | 智谱ChatGLMVLLM |
|
||||||
| TTS | 火山引擎豆包 TTS (DoubaoTTS) | 接口调用 | 消耗 token | [点击创建密钥](https://console.volcengine.com/speech/service/8);建议使用付费版本以获得更高并发 |
|
|
||||||
| TTS | CosyVoiceSiliconflow | 接口调用 | 消耗 token | 需申请硅基流动 API 密钥;输出格式为 wav |
|
实际上,任何支持 openai 接口调用的 VLLM 均可接入使用。
|
||||||
| TTS | CozeCnTTS | 接口调用 | 消耗 token | 需提供 Coze API key;输出格式为 wav |
|
|
||||||
| TTS | FishSpeech | 接口调用 | 免费/自定义 | 本地启动 TTS 服务;启动方法见配置文件内说明 |
|
|
||||||
| TTS | GPT_SOVITS_V2 | 接口调用 | 免费/自定义 | 本地启动 TTS 服务,适用于个性化语音合成场景 |
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### VAD
|
### TTS 语音合成
|
||||||
|
|
||||||
|
| 使用方式 | 支持平台 | 免费平台 |
|
||||||
|
|:---:|:---:|:---:|
|
||||||
|
| 接口调用 | EdgeTTS、科大讯飞、火山引擎、腾讯云、阿里云及百炼、CosyVoiceSiliconflow、TTS302AI、CozeCnTTS、GizwitsTTS、ACGNTTS、OpenAITTS、灵犀流式TTS、MinimaxTTS | 灵犀流式TTS、EdgeTTS、CosyVoiceSiliconflow(部分) |
|
||||||
|
| 本地服务 | FishSpeech、GPT_SOVITS_V2、GPT_SOVITS_V3、Index-TTS、PaddleSpeech | Index-TTS、PaddleSpeech、FishSpeech、GPT_SOVITS_V2、GPT_SOVITS_V3 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### VAD 语音活动检测
|
||||||
|
|
||||||
| 类型 | 平台名称 | 使用方式 | 收费模式 | 备注 |
|
| 类型 | 平台名称 | 使用方式 | 收费模式 | 备注 |
|
||||||
|:---:|:---------:|:----:|:----:|:--:|
|
|:---:|:---------:|:----:|:----:|:--:|
|
||||||
@@ -165,155 +309,67 @@ server:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### ASR
|
### ASR 语音识别
|
||||||
|
|
||||||
| 类型 | 平台名称 | 使用方式 | 收费模式 | 备注 |
|
| 使用方式 | 支持平台 | 免费平台 |
|
||||||
|:---:|:------:|:----:|:----:|:--:|
|
|:---:|:---:|:---:|
|
||||||
| ASR | FunASR | 本地使用 | 免费 | |
|
| 本地使用 | FunASR、SherpaASR | FunASR、SherpaASR |
|
||||||
|
| 接口调用 | FunASRServer、火山引擎、科大讯飞、腾讯云、阿里云、百度云、OpenAI ASR | FunASRServer |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 使用方式 🚀
|
### Voiceprint 声纹识别
|
||||||
|
|
||||||
### 一、[部署文档](./docs/Deployment.md)
|
| 使用方式 | 支持平台 | 免费平台 |
|
||||||
|
|:---:|:---:|:---:|
|
||||||
本项目支持以下三种部署方式,您可根据实际需求选择:
|
| 本地使用 | 3D-Speaker | 3D-Speaker |
|
||||||
|
|
||||||
1. **[Docker 快速部署](./docs/Deployment.md)**
|
|
||||||
适合快速体验,不需过多环境配置。缺点是,拉取镜像有点慢。
|
|
||||||
2.
|
|
||||||
*
|
|
||||||
|
|
||||||
*[借助 Docker 环境运行部署](./docs/Deployment.md#%E6%96%B9%E5%BC%8F%E4%BA%8C%E5%80%9F%E5%8A%A9docker%E7%8E%AF%E5%A2%83%E8%BF%90%E8%A1%8C%E9%83%A8%E7%BD%B2)
|
|
||||||
**
|
|
||||||
适用于已安装 Docker 且希望对代码进行自定义修改的用户。
|
|
||||||
|
|
||||||
3.
|
|
||||||
*
|
|
||||||
|
|
||||||
*[本地源码运行](./docs/Deployment.md#%E6%96%B9%E5%BC%8F%E4%B8%89%E6%9C%AC%E5%9C%B0%E6%BA%90%E7%A0%81%E8%BF%90%E8%A1%8C)
|
|
||||||
**
|
|
||||||
适合熟悉 Conda 环境或希望从零搭建运行环境的用户。
|
|
||||||
对于对响应速度要求较高的场景,推荐使用本地源码运行方式以降低额外开销。
|
|
||||||
|
|
||||||
### 二、[固件编译](./docs/firmware-build.md)
|
|
||||||
|
|
||||||
点这里查看[固件编译](./docs/firmware-build.md)的详细过程。
|
|
||||||
|
|
||||||
编译成功且联网成功后,通过唤醒词唤醒小智,留意server端输出的控制台信息。
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 常见问题 ❓
|
### Memory 记忆存储
|
||||||
|
|
||||||
### 1、TTS 经常失败,经常超时 ⏰
|
| 类型 | 平台名称 | 使用方式 | 收费模式 | 备注 |
|
||||||
|
|:------:|:---------------:|:----:|:---------:|:--:|
|
||||||
|
| Memory | mem0ai | 接口调用 | 1000次/月额度 | |
|
||||||
|
| Memory | [powermem](./docs/powermem-integration.md) | 本地总结 | 取决于LLM和DB | OceanBase开源,支持智能检索 |
|
||||||
|
| Memory | mem_local_short | 本地总结 | 免费 | |
|
||||||
|
| Memory | nomem | 无记忆模式 | 免费 | |
|
||||||
|
|
||||||
建议:如果 `EdgeTTS` 经常失败,请先检查是否使用了代理(梯子)。如果使用了,请尝试关闭代理后再试;
|
---
|
||||||
如果用的是火山引擎的豆包 TTS,经常失败时建议使用付费版本,因为测试版本仅支持 2 个并发。
|
|
||||||
|
|
||||||
### 2、我想通过小智控制电灯、空调、远程开关机等操作 💡
|
### Intent 意图识别
|
||||||
|
|
||||||
建议:在配置文件中将 `LLM` 设置为 `HomeAssistant`,通过 调用`HomeAssistant`接口实现相关控制。
|
| 类型 | 平台名称 | 使用方式 | 收费模式 | 备注 |
|
||||||
|
|:------:|:-------------:|:----:|:-------:|:---------------------:|
|
||||||
|
| Intent | intent_llm | 接口调用 | 根据LLM收费 | 通过大模型识别意图,通用性强 |
|
||||||
|
| Intent | function_call | 接口调用 | 根据LLM收费 | 通过大模型函数调用完成意图,速度快,效果好 |
|
||||||
|
| Intent | nointent | 无意图模式 | 免费 | 不进行意图识别,直接返回对话结果 |
|
||||||
|
|
||||||
### 3、我说话很慢,停顿时小智老是抢话 🗣️
|
---
|
||||||
|
|
||||||
建议:在配置文件中找到如下部分,将 `min_silence_duration_ms` 的值调大(例如改为 `1000`):
|
### Rag 检索增强生成
|
||||||
|
|
||||||
```yaml
|
| 类型 | 平台名称 | 使用方式 | 收费模式 | 备注 |
|
||||||
VAD:
|
|:------:|:-------------:|:----:|:-------:|:---------------------:|
|
||||||
SileroVAD:
|
| Rag | ragflow | 接口调用 | 根据切片、分词消耗的token收费 | 借助RagFlow的检索增强生成功能,提供更准确的对话回复 |
|
||||||
threshold: 0.5
|
|
||||||
model_dir: models/snakers4_silero-vad
|
|
||||||
min_silence_duration_ms: 700 # 如果说话停顿较长,可将此值调大
|
|
||||||
```
|
|
||||||
|
|
||||||
### 4、为什么我说的话,小智识别出来很多韩文、日文、英文?🇰🇷
|
|
||||||
|
|
||||||
建议:检查一下`models/SenseVoiceSmall`是否已经有`model.pt`
|
|
||||||
文件,如果没有就要下载,查看这里[下载语音识别模型文件](docs/Deployment.md#模型文件)
|
|
||||||
|
|
||||||
### 5、为什么会出现“TTS 任务出错 文件不存在”?📁
|
|
||||||
|
|
||||||
建议:检查一下是否正确使用`conda` 安装了`libopus`和`ffmpeg`库。
|
|
||||||
|
|
||||||
如果没有安装,就安装
|
|
||||||
|
|
||||||
```
|
|
||||||
conda install conda-forge::libopus
|
|
||||||
conda install conda-forge::ffmpeg
|
|
||||||
```
|
|
||||||
|
|
||||||
### 6、如何提高小智对话响应速度? ⚡
|
|
||||||
|
|
||||||
本项目默认配置为低成本方案,建议初学者先使用默认免费模型,解决“跑得动”的问题,再优化“跑得快”。
|
|
||||||
如需提升响应速度,可尝试更换各组件。以下为各组件的响应速度测试数据(仅供参考,不构成承诺):
|
|
||||||
|
|
||||||
| 影响因素 | 因素值 |
|
|
||||||
|:-----:|:----------------:|
|
|
||||||
| 测试地点 | 广东省广州市海珠区 |
|
|
||||||
| 测试时间 | 2025年2月19日 12:52 |
|
|
||||||
| 宽带运营商 | 中国联通 |
|
|
||||||
|
|
||||||
测试方法:
|
|
||||||
|
|
||||||
1、把各组件的密钥配置上去,只有配置了密钥的组件才参与测试。
|
|
||||||
|
|
||||||
2、配置完密钥后,执行以下方法
|
|
||||||
|
|
||||||
```
|
|
||||||
# 进入项目根目录,执行以下命令:
|
|
||||||
conda activate xiaozhi-esp32-server
|
|
||||||
python performance_tester.py
|
|
||||||
```
|
|
||||||
|
|
||||||
生成报告如下
|
|
||||||
|
|
||||||
LLM 性能排行:
|
|
||||||
|
|
||||||
| 模块名称 | 平均首Token时间 | 平均总响应时间 |
|
|
||||||
|:-----------|:-----------|:--------|
|
|
||||||
| AliLLM | 0.547s | 1.485s |
|
|
||||||
| ChatGLMLLM | 0.677s | 3.057s |
|
|
||||||
| OllamaLLM | 0.003s | 0.003s |
|
|
||||||
|
|
||||||
TTS 性能排行:
|
|
||||||
|
|
||||||
| 模块名称 | 平均合成时间 |
|
|
||||||
|----------------------|--------|
|
|
||||||
| EdgeTTS | 1.019s |
|
|
||||||
| DoubaoTTS | 0.503s |
|
|
||||||
| CosyVoiceSiliconflow | 3.732s |
|
|
||||||
|
|
||||||
推荐配置组合 (综合响应速度):
|
|
||||||
|
|
||||||
| 组合方案 | 综合得分 | LLM首Token | TTS合成 |
|
|
||||||
|-------------------------------|-------|-----------|--------|
|
|
||||||
| AliLLM + DoubaoTTS | 0.539 | 0.547s | 0.503s |
|
|
||||||
| AliLLM + EdgeTTS | 0.642 | 0.547s | 1.019s |
|
|
||||||
| ChatGLMLLM + DoubaoTTS | 0.642 | 0.677s | 0.503s |
|
|
||||||
| ChatGLMLLM + EdgeTTS | 0.745 | 0.677s | 1.019s |
|
|
||||||
| AliLLM + CosyVoiceSiliconflow | 1.184 | 0.547s | 3.732s |
|
|
||||||
|
|
||||||
### 结论 🔍
|
|
||||||
|
|
||||||
`2025年2月19日`,如果我的电脑在`广东省广州市海珠区`,且使用的是`中国联通`网络,我会优先使用:
|
|
||||||
|
|
||||||
- LLM:`AliLLM`
|
|
||||||
- TTS:`DoubaoTTS`
|
|
||||||
|
|
||||||
### 7、更多问题,可联系我们反馈 💬
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 鸣谢 🙏
|
## 鸣谢 🙏
|
||||||
|
|
||||||
- 本项目受 [百聆语音对话机器人](https://github.com/wwbin2017/bailing) 启发,并在其基础上实现。
|
| Logo | 项目/公司 | 说明 |
|
||||||
- 感谢 [腾讯云](https://cloud.tencent.com/) 提供免费 Docker 镜像空间。
|
|:---:|:---:|:---|
|
||||||
- 感谢 [十方融海](https://www.tenclass.com/) 对小智通讯协议提供的详尽文档支持。
|
| <img src="./docs/images/logo_bailing.png" width="160"> | [百聆语音对话机器人](https://github.com/wwbin2017/bailing) | 本项目受[百聆语音对话机器人](https://github.com/wwbin2017/bailing)启发,并在其基础上实现 |
|
||||||
|
| <img src="./docs/images/logo_tenclass.png" width="160"> | [十方融海](https://www.tenclass.com/) | 感谢[十方融海](https://www.tenclass.com/)为小智生态制定了标准的通讯协议、多设备兼容性方案及高并发场景实践示范;为本项目提供了全链路技术文档支持 |
|
||||||
|
| <img src="./docs/images/logo_xuanfeng.png" width="160"> | [玄凤科技](https://github.com/Eric0308) | 感谢[玄凤科技](https://github.com/Eric0308)贡献函数调用框架、MCP通信协议及插件化调用机制的实现代码,通过标准化的指令调度体系与动态扩展能力,显著提升了前端设备(IoT)的交互效率和功能延展性 |
|
||||||
|
| <img src="./docs/images/logo_junsen.png" width="160"> | [huangjunsen](https://github.com/huangjunsen0406) | 感谢[huangjunsen](https://github.com/huangjunsen0406) 贡献`智控台移动端`模块,实现了跨平台移动设备的高效控制与实时交互,大幅提升了系统在移动场景下的操作便捷性和管理效率 |
|
||||||
|
| <img src="./docs/images/logo_huiyuan.png" width="160"> | [汇远设计](http://ui.kwd988.net/) | 感谢[汇远设计](http://ui.kwd988.net/)为本项目提供专业视觉解决方案,用其服务超千家企业的设计实战经验,赋能本项目产品用户体验 |
|
||||||
|
| <img src="./docs/images/logo_qinren.png" width="160"> | [西安勤人信息科技](https://www.029app.com/) | 感谢[西安勤人信息科技](https://www.029app.com/)深化本项目视觉体系,确保整体设计风格在多场景应用中的一致性和扩展性 |
|
||||||
|
| <img src="./docs/images/logo_contributors.png" width="160"> | [代码贡献者](https://github.com/xinnan-tech/xiaozhi-esp32-server/graphs/contributors) | 感谢[所有代码贡献者](https://github.com/xinnan-tech/xiaozhi-esp32-server/graphs/contributors)贡献者,你们的付出让项目更加健壮和强大。 |
|
||||||
|
|
||||||
|
|
||||||
<a href="https://star-history.com/#xinnan-tech/xiaozhi-esp32-server&Date">
|
<a href="https://star-history.com/#xinnan-tech/xiaozhi-esp32-server&Date">
|
||||||
|
|
||||||
<picture>
|
<picture>
|
||||||
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=xinnan-tech/xiaozhi-esp32-server&type=Date&theme=dark" />
|
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=xinnan-tech/xiaozhi-esp32-server&type=Date&theme=dark" />
|
||||||
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=xinnan-tech/xiaozhi-esp32-server&type=Date" />
|
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=xinnan-tech/xiaozhi-esp32-server&type=Date" />
|
||||||
|
|||||||
+376
@@ -0,0 +1,376 @@
|
|||||||
|
[](https://github.com/xinnan-tech/xiaozhi-esp32-server)
|
||||||
|
|
||||||
|
<h1 align="center">Xiaozhi Backend-Service xiaozhi-esp32-server</h1>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
Dieses Projekt basiert auf der Theorie und Technologie der Mensch-Maschine-symbiotischen Intelligenz zur Entwicklung intelligenter Terminal-Hardware- und Software-Systeme<br/>und bietet Backend-Dienste für das Open-Source-Hardware-Projekt
|
||||||
|
<a href="https://github.com/78/xiaozhi-esp32">xiaozhi-esp32</a><br/>
|
||||||
|
Implementiert mit Python, Java und Vue gemäß dem <a href="https://ccnphfhqs21z.feishu.cn/wiki/M0XiwldO9iJwHikpXD5cEx71nKh">Xiaozhi-Kommunikationsprotokoll</a><br/>
|
||||||
|
Unterstützt MQTT+UDP-Protokoll, Websocket-Protokoll, MCP-Endpunkte und Stimmabdruckerkennung
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="./docs/FAQ.md">Häufige Fragen</a>
|
||||||
|
· <a href="https://github.com/xinnan-tech/xiaozhi-esp32-server/issues">Probleme melden</a>
|
||||||
|
· <a href="./README.md#%E9%83%A8%E7%BD%B2%E6%96%87%E6%A1%A3">Deployment-Dokumentation</a>
|
||||||
|
· <a href="https://github.com/xinnan-tech/xiaozhi-esp32-server/releases">Release-Hinweise</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="./README.md"><img alt="简体中文版自述文件" src="https://img.shields.io/badge/简体中文-DFE0E5"></a>
|
||||||
|
<a href="./README_en.md"><img alt="README in English" src="https://img.shields.io/badge/English-DFE0E5"></a>
|
||||||
|
<a href="./README_vi.md"><img alt="Tiếng Việt" src="https://img.shields.io/badge/Tiếng Việt-DFE0E5"></a>
|
||||||
|
<a href="./README_de.md"><img alt="Deutsch" src="https://img.shields.io/badge/Deutsch-DBEDFA"></a>
|
||||||
|
<a href="./README_pt_BR.md"><img alt="Português (Brasil)" src="https://img.shields.io/badge/Português (Brasil)-DFE0E5"></a>
|
||||||
|
<a href="https://github.com/xinnan-tech/xiaozhi-esp32-server/releases">
|
||||||
|
<img alt="GitHub Contributors" src="https://img.shields.io/github/v/release/xinnan-tech/xiaozhi-esp32-server?logo=docker" />
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/xinnan-tech/xiaozhi-esp32-server/blob/main/LICENSE">
|
||||||
|
<img alt="GitHub pull requests" src="https://img.shields.io/badge/license-MIT-white?labelColor=black" />
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/xinnan-tech/xiaozhi-esp32-server">
|
||||||
|
<img alt="stars" src="https://img.shields.io/github/stars/xinnan-tech/xiaozhi-esp32-server?color=ffcb47&labelColor=black" />
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
Geleitet vom Team von Professor Siyuan Liu (South China University of Technology)
|
||||||
|
</br>
|
||||||
|
刘思源教授团队主导研发(华南理工大学)
|
||||||
|
</br>
|
||||||
|
<img src="./docs/images/hnlg.jpg" alt="South China University of Technology" width="50%">
|
||||||
|
</p>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Zielgruppe 👥
|
||||||
|
|
||||||
|
Dieses Projekt erfordert ESP32-Hardware-Geräte zum Betrieb. Wenn Sie ESP32-bezogene Hardware erworben haben, erfolgreich eine Verbindung zu Brother Xias bereitgestelltem Backend-Service hergestellt haben und Ihren eigenen `xiaozhi-esp32`-Backend-Service unabhängig aufbauen möchten, dann ist dieses Projekt perfekt für Sie.
|
||||||
|
|
||||||
|
Möchten Sie die Nutzungseffekte sehen? Klicken Sie auf die Videos unten 🎥
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1FMFyejExX" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="响应速度感受" src="docs/images/demo9.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1vchQzaEse" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="速度优化秘诀" src="docs/images/demo6.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1C1tCzUEZh" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="复杂医疗场景" src="docs/images/demo1.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1zUW5zJEkq" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="MQTT指令下发" src="docs/images/demo4.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1Exu3zqEDe" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="声纹识别" src="docs/images/demo14.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1pNXWYGEx1" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="控制家电开关" src="docs/images/demo5.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1ZQKUzYExM" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="MCP接入点" src="docs/images/demo13.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1TJ7WzzEo6" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="多指令任务" src="docs/images/demo11.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1VC96Y5EMH" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="播放音乐" src="docs/images/demo7.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1Z8XuYZEAS" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="天气插件" src="docs/images/demo8.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV12J7WzBEaH" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="实时打断" src="docs/images/demo10.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1Co76z7EvK" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="拍照识物品" src="docs/images/demo12.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1CDKWemEU6" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="自定义音色" src="docs/images/demo2.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV12yA2egEaC" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="使用粤语交流" src="docs/images/demo3.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV17LXWYvENb" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="播报新闻" src="docs/images/demo0.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Warnungen ⚠️
|
||||||
|
|
||||||
|
1. Dieses Projekt ist Open-Source-Software. Diese Software hat keine kommerzielle Partnerschaft mit Drittanbieter-API-Dienstleistern (einschließlich, aber nicht beschränkt auf Spracherkennung, große Modelle, Sprachsynthese und andere Plattformen), mit denen sie sich verbindet, und bietet keine Garantie für deren Servicequalität oder finanzielle Sicherheit. Es wird empfohlen, dass Benutzer Dienstleister mit entsprechenden Geschäftslizenzen bevorzugen und deren Servicevereinbarungen und Datenschutzrichtlinien sorgfältig lesen. Diese Software hostet keine Kontoschlüssel, nimmt nicht an Geldströmen teil und trägt nicht das Risiko von Verlusten bei Guthaben-Aufladungen.
|
||||||
|
|
||||||
|
2. Die Funktionalität dieses Projekts ist nicht vollständig und hat keine Netzwerksicherheitsbewertung bestanden. Bitte verwenden Sie es nicht in Produktionsumgebungen. Wenn Sie dieses Projekt zu Lernzwecken in einer öffentlichen Netzwerkumgebung bereitstellen, stellen Sie bitte sicher, dass notwendige Schutzmaßnahmen vorhanden sind.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Deployment-Dokumentation
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Dieses Projekt bietet zwei Bereitstellungsmethoden. Bitte wählen Sie basierend auf Ihren spezifischen Anforderungen:
|
||||||
|
|
||||||
|
#### 🚀 Auswahl der Bereitstellungsmethode
|
||||||
|
| Bereitstellungsmethode | Funktionen | Anwendungsszenarien | Deployment-Dokumente | Konfigurationsanforderungen | Video-Tutorials |
|
||||||
|
|---------|------|---------|---------|---------|---------|
|
||||||
|
| **Vereinfachte Installation** | Intelligenter Dialog, Einzel-Agenten-Verwaltung | Umgebungen mit geringer Konfiguration, Daten in Konfigurationsdateien gespeichert, keine Datenbank erforderlich | [①Docker-Version](./docs/Deployment.md#%E6%96%B9%E5%BC%8F%E4%B8%80docker%E5%8F%AA%E8%BF%90%E8%A1%8Cserver) / [②Quellcode-Deployment](./docs/Deployment.md#%E6%96%B9%E5%BC%8F%E4%BA%8C%E6%9C%AC%E5%9C%B0%E6%BA%90%E7%A0%81%E5%8F%AA%E8%BF%90%E8%A1%8Cserver)| 2 Kerne 4GB bei Verwendung von `FunASR`, 2 Kerne 2GB bei allen APIs | - |
|
||||||
|
| **Vollständige Modulinstallation** | Intelligenter Dialog, Mehrbenutzerverwaltung, Mehr-Agenten-Verwaltung, Intelligente Steuerkonsole-Bedienung | Vollständige Funktionserfahrung, Daten in Datenbank gespeichert |[①Docker-Version](./docs/Deployment_all.md#%E6%96%B9%E5%BC%8F%E4%B8%80docker%E8%BF%90%E8%A1%8C%E5%85%A8%E6%A8%A1%E5%9D%97) / [②Quellcode-Deployment](./docs/Deployment_all.md#%E6%96%B9%E5%BC%8F%E4%BA%8C%E6%9C%AC%E5%9C%B0%E6%BA%90%E7%A0%81%E8%BF%90%E8%A1%8C%E5%85%A8%E6%A8%A1%E5%9D%97) / [③Quellcode-Deployment Auto-Update-Tutorial](./docs/dev-ops-integration.md) | 4 Kerne 8GB bei Verwendung von `FunASR`, 2 Kerne 4GB bei allen APIs| [Video-Tutorial für lokalen Quellcode-Start](https://www.bilibili.com/video/BV1wBJhz4Ewe) |
|
||||||
|
|
||||||
|
Häufige Fragen und entsprechende Tutorials finden Sie unter [diesem Link](./docs/FAQ.md)
|
||||||
|
|
||||||
|
> 💡 Hinweis: Unten ist eine Testplattform, die mit dem neuesten Code bereitgestellt wurde. Sie können bei Bedarf brennen und testen. Gleichzeitige Benutzer: 6, Daten werden täglich gelöscht.
|
||||||
|
|
||||||
|
```
|
||||||
|
Adresse der intelligenten Steuerkonsole: https://2662r3426b.vicp.fun
|
||||||
|
Adresse der intelligenten Steuerkonsole (H5): https://2662r3426b.vicp.fun/h5/index.html
|
||||||
|
|
||||||
|
Service-Testtool: https://2662r3426b.vicp.fun/test/
|
||||||
|
OTA-Schnittstellenadresse: https://2662r3426b.vicp.fun/xiaozhi/ota/
|
||||||
|
Websocket-Schnittstellenadresse: wss://2662r3426b.vicp.fun/xiaozhi/v1/
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 🚩 Konfigurationsbeschreibung und Empfehlungen
|
||||||
|
> [!Note]
|
||||||
|
> Dieses Projekt bietet zwei Konfigurationsschemata:
|
||||||
|
>
|
||||||
|
> 1. `Einstiegslevel Kostenlose Einstellungen`: Geeignet für den persönlichen und privaten Gebrauch, alle Komponenten verwenden kostenlose Lösungen, keine zusätzliche Zahlung erforderlich.
|
||||||
|
>
|
||||||
|
> 2. `Streaming-Konfiguration`: Geeignet für Demonstrationen, Schulungen, Szenarien mit mehr als 2 gleichzeitigen Benutzern usw. Verwendet Streaming-Verarbeitungstechnologie für schnellere Reaktionsgeschwindigkeit und bessere Erfahrung.
|
||||||
|
>
|
||||||
|
> Ab Version `0.5.2` unterstützt das Projekt Streaming-Konfiguration. Im Vergleich zu früheren Versionen ist die Reaktionsgeschwindigkeit um ca. `2,5 Sekunden` verbessert, was die Benutzererfahrung erheblich verbessert.
|
||||||
|
|
||||||
|
| Modulname | Einstiegslevel Kostenlose Einstellungen | Streaming-Konfiguration |
|
||||||
|
|:---:|:---:|:---:|
|
||||||
|
| ASR (Spracherkennung) | FunASR (Lokal) | 👍XunfeiStreamASR (Xunfei-Streaming) |
|
||||||
|
| LLM (Großes Modell) | glm-4-flash (Zhipu) | 👍qwen-flash (Alibaba Bailian) |
|
||||||
|
| VLLM (Vision Large Model) | glm-4v-flash (Zhipu) | 👍qwen2.5-vl-3b-instructh (Alibaba Bailian) |
|
||||||
|
| TTS (Sprachsynthese) | ✅LinkeraiTTS (Lingxi-Streaming) | 👍HuoshanDoubleStreamTTS (Volcano-Streaming) |
|
||||||
|
| Intent (Absichtserkennung) | function_call (Funktionsaufruf) | function_call (Funktionsaufruf) |
|
||||||
|
| Memory (Gedächtnisfunktion) | mem_local_short (Lokales Kurzzeitgedächtnis) | mem_local_short (Lokales Kurzzeitgedächtnis) |
|
||||||
|
|
||||||
|
Wenn Sie sich um die Latenz jeder Komponente kümmern, lesen Sie bitte den [Xiaozhi-Komponenten-Leistungstestbericht](https://github.com/xinnan-tech/xiaozhi-performance-research). Sie können gemäß den Testmethoden im Bericht in Ihrer Umgebung tatsächlich testen.
|
||||||
|
|
||||||
|
#### 🔧 Testwerkzeuge
|
||||||
|
Dieses Projekt bietet die folgenden Testwerkzeuge, um Ihnen bei der Überprüfung des Systems und der Auswahl geeigneter Modelle zu helfen:
|
||||||
|
|
||||||
|
| Werkzeugname | Standort | Verwendungsmethode | Funktionsbeschreibung |
|
||||||
|
|:---:|:---|:---:|:---:|
|
||||||
|
| Audio-Interaktionstesttool | main》xiaozhi-server》test》test_page.html | Direkt mit Google Chrome öffnen | Testet Audio-Wiedergabe- und Empfangsfunktionen, überprüft, ob die Python-seitige Audioverarbeitung normal ist |
|
||||||
|
| Modell-Reaktionstesttool | main》xiaozhi-server》performance_tester.py | Ausführen `python performance_tester.py` | Testet die Reaktionsgeschwindigkeit von ASR (Spracherkennung), LLM (großes Modell), VLLM (Vision-Modell), TTS (Sprachsynthese) drei Kernmodulen |
|
||||||
|
|
||||||
|
> 💡 Hinweis: Beim Testen der Modellgeschwindigkeit werden nur Modelle mit konfigurierten Schlüsseln getestet.
|
||||||
|
|
||||||
|
---
|
||||||
|
## Funktionsliste ✨
|
||||||
|
### Implementiert ✅
|
||||||
|

|
||||||
|
| Funktionsmodul | Beschreibung |
|
||||||
|
|:---:|:---|
|
||||||
|
| Kernarchitektur | Basierend auf [MQTT+UDP-Gateway](https://github.com/xinnan-tech/xiaozhi-esp32-server/blob/main/docs/mqtt-gateway-integration.md), WebSocket und HTTP-Servern, bietet vollständiges Konsolenverwaltungs- und Authentifizierungssystem |
|
||||||
|
| Sprachinteraktion | Unterstützt Streaming-ASR (Spracherkennung), Streaming-TTS (Sprachsynthese), VAD (Sprachaktivitätserkennung), unterstützt mehrsprachige Erkennung und Sprachverarbeitung |
|
||||||
|
| Stimmabdruckerkennung | Unterstützt Mehrbenutzer-Stimmabdruckregistrierung, -verwaltung und -erkennung, verarbeitet parallel mit ASR, Echtzeit-Sprecheridentitätserkennung und Weitergabe an LLM für personalisierte Antworten |
|
||||||
|
| Intelligenter Dialog | Unterstützt mehrere LLM (große Sprachmodelle), implementiert intelligenten Dialog |
|
||||||
|
| Visuelle Wahrnehmung | Unterstützt mehrere VLLM (Vision Large Models), implementiert multimodale Interaktion |
|
||||||
|
| Absichtserkennung | Unterstützt LLM-Absichtserkennung, Function Call-Funktionsaufruf, bietet plugin-basierten Absichtsverarbeitungsmechanismus |
|
||||||
|
| Gedächtnissystem | Unterstützt lokales Kurzzeitgedächtnis, mem0ai-Schnittstellengedächtnis, PowerMem intelligentes Gedächtnis, mit Gedächtniszusammenfassungsfunktion |
|
||||||
|
| Wissensdatenbank | Unterstützt RAGFlow-Wissensdatenbank, ermöglicht großem Modell die Bewertung, ob Wissensdatenbank benötigt wird, bevor geantwortet wird |
|
||||||
|
| Werkzeugaufruf | Unterstützt Client-IOT-Protokoll, Client-MCP-Protokoll, Server-MCP-Protokoll, MCP-Endpunktprotokoll, benutzerdefinierte Werkzeugfunktionen |
|
||||||
|
| Befehlsübermittlung | Basierend auf MQTT-Protokoll, unterstützt die Übermittlung von MCP-Befehlen von der intelligenten Steuerkonsole an ESP32-Geräte |
|
||||||
|
| Verwaltungs-Backend | Bietet Web-Verwaltungsoberfläche, unterstützt Benutzerverwaltung, Systemkonfiguration und Geräteverwaltung; Oberfläche unterstützt vereinfachtes Chinesisch, traditionelles Chinesisch und englische Anzeige |
|
||||||
|
| Testwerkzeuge | Bietet Leistungstestwerkzeuge, Vision-Modell-Testwerkzeuge und Audio-Interaktionstestwerkzeuge |
|
||||||
|
| Deployment-Unterstützung | Unterstützt Docker-Deployment und lokales Deployment, bietet vollständige Konfigurationsdateiverwaltung |
|
||||||
|
| Plugin-System | Unterstützt funktionale Plugin-Erweiterungen, benutzerdefinierte Plugin-Entwicklung und Plugin-Hot-Loading |
|
||||||
|
|
||||||
|
### In Entwicklung 🚧
|
||||||
|
|
||||||
|
Um über spezifische Entwicklungsplanfortschritte zu erfahren, [klicken Sie hier](https://github.com/users/xinnan-tech/projects/3). Häufige Fragen und entsprechende Tutorials finden Sie unter [diesem Link](./docs/FAQ.md)
|
||||||
|
|
||||||
|
Wenn Sie ein Softwareentwickler sind, finden Sie hier einen [Offenen Brief an Entwickler](docs/contributor_open_letter.md). Willkommen beim Beitritt!
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Produktökosystem 👬
|
||||||
|
Xiaozhi ist ein Ökosystem. Wenn Sie dieses Produkt verwenden, können Sie sich auch andere [hervorragende Projekte](https://github.com/78/xiaozhi-esp32/blob/main/README_zh.md#%E7%9B%B8%E5%85%B3%E5%BC%80%E6%BA%90%E9%A1%B9%E7%9B%AE) in diesem Ökosystem ansehen
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Liste der von diesem Projekt unterstützten Plattformen/Komponenten 📋
|
||||||
|
### LLM-Sprachmodelle
|
||||||
|
|
||||||
|
| Verwendungsmethode | Unterstützte Plattformen | Kostenlose Plattformen |
|
||||||
|
|:---:|:---:|:---:|
|
||||||
|
| OpenAI-Schnittstellenaufrufe | Alibaba Bailian, Volcano Engine Doubao, DeepSeek, Zhipu ChatGLM, Gemini | Zhipu ChatGLM, Gemini |
|
||||||
|
| Ollama-Schnittstellenaufrufe | Ollama | - |
|
||||||
|
| Dify-Schnittstellenaufrufe | Dify | - |
|
||||||
|
| FastGPT-Schnittstellenaufrufe | FastGPT | - |
|
||||||
|
| Coze-Schnittstellenaufrufe | Coze | - |
|
||||||
|
| Xinference-Schnittstellenaufrufe | Xinference | - |
|
||||||
|
| HomeAssistant-Schnittstellenaufrufe | HomeAssistant | - |
|
||||||
|
|
||||||
|
Tatsächlich kann jedes LLM, das OpenAI-Schnittstellenaufrufe unterstützt, integriert und verwendet werden.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### VLLM-Vision-Modelle
|
||||||
|
|
||||||
|
| Verwendungsmethode | Unterstützte Plattformen | Kostenlose Plattformen |
|
||||||
|
|:---:|:---:|:---:|
|
||||||
|
| OpenAI-Schnittstellenaufrufe | Alibaba Bailian, Zhipu ChatGLMVLLM | Zhipu ChatGLMVLLM |
|
||||||
|
|
||||||
|
Tatsächlich kann jedes VLLM, das OpenAI-Schnittstellenaufrufe unterstützt, integriert und verwendet werden.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### TTS-Sprachsynthese
|
||||||
|
|
||||||
|
| Verwendungsmethode | Unterstützte Plattformen | Kostenlose Plattformen |
|
||||||
|
|:---:|:---:|:---:|
|
||||||
|
| Schnittstellenaufrufe | EdgeTTS, Volcano Engine Doubao TTS, Tencent Cloud, Alibaba Cloud TTS, AliYun Stream TTS, CosyVoiceSiliconflow, TTS302AI, CozeCnTTS, GizwitsTTS, ACGNTTS, OpenAITTS, Lingxi Streaming TTS, MinimaxTTS, Volcano Dual-Stream TTS | Lingxi Streaming TTS, EdgeTTS, CosyVoiceSiliconflow (teilweise) |
|
||||||
|
| Lokale Dienste | FishSpeech, GPT_SOVITS_V2, GPT_SOVITS_V3, Index-TTS, PaddleSpeech | Index-TTS, PaddleSpeech, FishSpeech, GPT_SOVITS_V2, GPT_SOVITS_V3 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### VAD-Sprachaktivitätserkennung
|
||||||
|
|
||||||
|
| Typ | Plattformname | Verwendungsmethode | Preismodell | Hinweise |
|
||||||
|
|:---:|:---------:|:----:|:----:|:--:|
|
||||||
|
| VAD | SileroVAD | Lokale Verwendung | Kostenlos | |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### ASR-Spracherkennung
|
||||||
|
|
||||||
|
| Verwendungsmethode | Unterstützte Plattformen | Kostenlose Plattformen |
|
||||||
|
|:---:|:---:|:---:|
|
||||||
|
| Lokale Verwendung | FunASR, SherpaASR | FunASR, SherpaASR |
|
||||||
|
| Schnittstellenaufrufe | DoubaoASR, Doubao Streaming ASR, FunASRServer, TencentASR, AliyunASR, Aliyun Streaming ASR, Baidu ASR, OpenAI ASR | FunASRServer |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Voiceprint-Stimmabdruckerkennung
|
||||||
|
|
||||||
|
| Verwendungsmethode | Unterstützte Plattformen | Kostenlose Plattformen |
|
||||||
|
|:---:|:---:|:---:|
|
||||||
|
| Lokale Verwendung | 3D-Speaker | 3D-Speaker |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Memory-Gedächtnisspeicher
|
||||||
|
|
||||||
|
| Typ | Plattformname | Verwendungsmethode | Preismodell | Hinweise |
|
||||||
|
|:------:|:---------------:|:----:|:---------:|:--:|
|
||||||
|
| Memory | mem0ai | Schnittstellenaufrufe | 1000 Mal/Monat Kontingent | |
|
||||||
|
| Memory | [powermem](./docs/powermem-integration.md) | Lokale Zusammenfassung | Abhängig von LLM und DB | OceanBase Open Source, unterstützt intelligente Abfrage |
|
||||||
|
| Memory | mem_local_short | Lokale Zusammenfassung | Kostenlos | |
|
||||||
|
| Memory | nomem | Kein Gedächtnismodus | Kostenlos | |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Intent-Absichtserkennung
|
||||||
|
|
||||||
|
| Typ | Plattformname | Verwendungsmethode | Preismodell | Hinweise |
|
||||||
|
|:------:|:-------------:|:----:|:-------:|:---------------------:|
|
||||||
|
| Intent | intent_llm | Schnittstellenaufrufe | Basierend auf LLM-Preisen | Erkennt Absicht durch große Modelle, starke Allgemeingültigkeit |
|
||||||
|
| Intent | function_call | Schnittstellenaufrufe | Basierend auf LLM-Preisen | Vervollständigt Absicht durch Funktionsaufruf großer Modelle, schnelle Geschwindigkeit, guter Effekt |
|
||||||
|
| Intent | nointent | Kein Absichtsmodus | Kostenlos | Führt keine Absichtserkennung durch, gibt direkt Dialogergebnis zurück |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Rag Retrieval Augmented Generation
|
||||||
|
|
||||||
|
| Typ | Plattformname | Verwendungsmethode | Preismodell | Hinweise |
|
||||||
|
|:------:|:-------------:|:----:|:-------:|:---------------------:|
|
||||||
|
| Rag | ragflow | Schnittstellenaufrufe | Gebühren basierend auf Token-Verbrauch für Segmentierung und Tokenisierung | Nutzt RAGFlow's Retrieval-Augmented-Generation-Funktion für präzisere Dialogantworten |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Danksagungen 🙏
|
||||||
|
|
||||||
|
| Logo | Projekt/Unternehmen | Beschreibung |
|
||||||
|
|:---:|:---:|:---|
|
||||||
|
| <img src="./docs/images/logo_bailing.png" width="160"> | [Bailing Voice Dialogue Robot](https://github.com/wwbin2017/bailing) | Dieses Projekt wurde von [Bailing Voice Dialogue Robot](https://github.com/wwbin2017/bailing) inspiriert und auf dessen Basis implementiert |
|
||||||
|
| <img src="./docs/images/logo_tenclass.png" width="160"> | [Tenclass](https://www.tenclass.com/) | Dank an [Tenclass](https://www.tenclass.com/) für die Formulierung von Standardkommunikationsprotokollen, Multi-Geräte-Kompatibilitätslösungen und High-Concurrency-Szenario-Praxisdemonstrationen für das Xiaozhi-Ökosystem; für die Bereitstellung vollständiger technischer Dokumentationsunterstützung für dieses Projekt |
|
||||||
|
| <img src="./docs/images/logo_xuanfeng.png" width="160"> | [Xuanfeng Technology](https://github.com/Eric0308) | Dank an [Xuanfeng Technology](https://github.com/Eric0308) für den Beitrag des Funktionsaufruf-Frameworks, des MCP-Kommunikationsprotokolls und der plugin-basierten Aufrufmechanismus-Implementierungscode. Durch standardisiertes Befehlsplanungssystem und dynamische Erweiterungsfähigkeiten wird die Interaktionseffizienz und funktionale Erweiterbarkeit von Frontend-Geräten (IoT) erheblich verbessert |
|
||||||
|
| <img src="./docs/images/logo_junsen.png" width="160"> | [huangjunsen](https://github.com/huangjunsen0406) | Dank an [huangjunsen](https://github.com/huangjunsen0406) für den Beitrag des `Smart Control Console Mobile`-Moduls, das eine effiziente Steuerung und Echtzeit-Interaktion über mobile Geräte ermöglicht und die Betriebsbequemlichkeit und Verwaltungseffizienz des Systems in mobilen Szenarien erheblich verbessert |
|
||||||
|
| <img src="./docs/images/logo_huiyuan.png" width="160"> | [Huiyuan Design](http://ui.kwd988.net/) | Dank an [Huiyuan Design](http://ui.kwd988.net/) für die Bereitstellung professioneller visueller Lösungen für dieses Projekt, unter Verwendung ihrer Design-Praxiserfahrung im Dienst von über tausend Unternehmen, um die Produktbenutzererfahrung dieses Projekts zu stärken |
|
||||||
|
| <img src="./docs/images/logo_qinren.png" width="160"> | [Xi'an Qinren Information Technology](https://www.029app.com/) | Dank an [Xi'an Qinren Information Technology](https://www.029app.com/) für die Vertiefung des visuellen Systems dieses Projekts und die Sicherstellung der Konsistenz und Erweiterbarkeit des Gesamtdesignstils in Multi-Szenario-Anwendungen |
|
||||||
|
| <img src="./docs/images/logo_contributors.png" width="160"> | [Code-Mitwirkende](https://github.com/xinnan-tech/xiaozhi-esp32-server/graphs/contributors) | Dank an [alle Code-Mitwirkenden](https://github.com/xinnan-tech/xiaozhi-esp32-server/graphs/contributors), Ihre Bemühungen haben das Projekt robuster und leistungsfähiger gemacht. |
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://star-history.com/#xinnan-tech/xiaozhi-esp32-server&Date">
|
||||||
|
|
||||||
|
<picture>
|
||||||
|
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=xinnan-tech/xiaozhi-esp32-server&type=Date&theme=dark" />
|
||||||
|
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=xinnan-tech/xiaozhi-esp32-server&type=Date" />
|
||||||
|
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=xinnan-tech/xiaozhi-esp32-server&type=Date" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
+300
-356
@@ -1,432 +1,376 @@
|
|||||||

|
[](https://github.com/xinnan-tech/xiaozhi-esp32-server)
|
||||||
|
|
||||||
# Xiaozhi ESP-32 Back-end Service (xiaozhi-esp32-server)
|
<h1 align="center">Xiaozhi Backend Service xiaozhi-esp32-server</h1>
|
||||||
|
|
||||||
([中文](README.md) | English)
|
<p align="center">
|
||||||
|
This project is based on human-machine symbiotic intelligence theory and technology to develop intelligent terminal hardware and software systems<br/>providing backend services for the open-source intelligent hardware project
|
||||||
|
<a href="https://github.com/78/xiaozhi-esp32">xiaozhi-esp32</a><br/>
|
||||||
|
Implemented using Python, Java, and Vue according to the <a href="https://ccnphfhqs21z.feishu.cn/wiki/M0XiwldO9iJwHikpXD5cEx71nKh">Xiaozhi Communication Protocol</a><br/>
|
||||||
|
Support for MQTT+UDP protocol, Websocket protocol, MCP access point, voiceprint recognition, and knowledge base
|
||||||
|
</p>
|
||||||
|
|
||||||
This project provides backend services for the open-source smart hardware
|
<p align="center">
|
||||||
project [xiaozhi-esp32](https://github.com/78/xiaozhi-esp32)。Implemented in Python following
|
<a href="./docs/FAQ.md">FAQ</a>
|
||||||
the[Xiaozhi Communication Protocol](https://ccnphfhqs21z.feishu.cn/wiki/M0XiwldO9iJwHikpXD5cEx71nKh)。
|
· <a href="https://github.com/xinnan-tech/xiaozhi-esp32-server/issues">Report Issues</a>
|
||||||
|
· <a href="./README.md#%E9%83%A8%E7%BD%B2%E6%96%87%E6%A1%A3">Deployment Docs</a>
|
||||||
|
· <a href="https://github.com/xinnan-tech/xiaozhi-esp32-server/releases">Release Notes</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
## Target Audience
|
<p align="center">
|
||||||
|
<a href="./README.md"><img alt="简体中文版自述文件" src="https://img.shields.io/badge/简体中文-DFE0E5"></a>
|
||||||
|
<a href="./README_en.md"><img alt="README in English" src="https://img.shields.io/badge/English-DBEDFA"></a>
|
||||||
|
<a href="./README_vi.md"><img alt="Tiếng Việt" src="https://img.shields.io/badge/Tiếng Việt-DFE0E5"></a>
|
||||||
|
<a href="./README_de.md"><img alt="Deutsch" src="https://img.shields.io/badge/Deutsch-DFE0E5"></a>
|
||||||
|
<a href="./README_pt_BR.md"><img alt="Português (Brasil)" src="https://img.shields.io/badge/Português (Brasil)-DFE0E5"></a>
|
||||||
|
<a href="https://github.com/xinnan-tech/xiaozhi-esp32-server/releases">
|
||||||
|
<img alt="GitHub Contributors" src="https://img.shields.io/github/v/release/xinnan-tech/xiaozhi-esp32-server?logo=docker" />
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/xinnan-tech/xiaozhi-esp32-server/blob/main/LICENSE">
|
||||||
|
<img alt="GitHub pull requests" src="https://img.shields.io/badge/license-MIT-white?labelColor=black" />
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/xinnan-tech/xiaozhi-esp32-server">
|
||||||
|
<img alt="stars" src="https://img.shields.io/github/stars/xinnan-tech/xiaozhi-esp32-server?color=ffcb47&labelColor=black" />
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
This project requires compatible esp32 hardware devices. If you have purchased esp32 hardware, successfully connected to
|
<p align="center">
|
||||||
Xiage's deployed backend, and wish to independently set up the `xiaozhi-esp32` backend service, this project is for
|
Spearheaded by Professor Siyuan Liu's Team (South China University of Technology)
|
||||||
you.
|
</br>
|
||||||
|
刘思源教授团队主导研发(华南理工大学)
|
||||||
|
</br>
|
||||||
|
<img src="./docs/images/hnlg.jpg" alt="South China University of Technology" width="50%">
|
||||||
|
</p>
|
||||||
|
|
||||||
To see a demo, watch this video:
|
---
|
||||||
|
|
||||||
<a href="https://www.bilibili.com/video/BV1FMFyejExX">
|
## Target Users 👥
|
||||||
<picture>
|
|
||||||
<img alt="小智esp32连接自己的后台模型" src="docs/images/demo.png" />
|
|
||||||
</picture>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
To fully experience this project, follow these steps:
|
This project requires ESP32 hardware devices to work. If you have purchased ESP32-related hardware, successfully connected to Brother Xia's deployed backend service, and want to build your own `xiaozhi-esp32` backend service independently, then this project is perfect for you.
|
||||||
|
|
||||||
- Prepare hardware compatible with the `xiaozhi-esp32` project. For supported
|
Want to see the usage effects? Click the videos below 🎥
|
||||||
models, [click here](https://rcnv1t9vps13.feishu.cn/wiki/DdgIw4BUgivWDPkhMj1cGIYCnRf).
|
|
||||||
- Use a computer/server with at least 4-core CPU and 8GB RAM to run this project. After deployment, you'll see the
|
|
||||||
service endpoint address in the console.
|
|
||||||
- Download the `xiaozhi-esp32` project, replace the default `endpoint address` with your own, compile, and flash the
|
|
||||||
firmware to your device.
|
|
||||||
- Start the device and check your server console logs to verify successful connection.
|
|
||||||
|
|
||||||
## Warning
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1FMFyejExX" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="响应速度感受" src="docs/images/demo9.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1vchQzaEse" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="速度优化秘诀" src="docs/images/demo6.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1C1tCzUEZh" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="复杂医疗场景" src="docs/images/demo1.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1zUW5zJEkq" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="MQTT指令下发" src="docs/images/demo4.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1Exu3zqEDe" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="声纹识别" src="docs/images/demo14.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1pNXWYGEx1" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="控制家电开关" src="docs/images/demo5.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1ZQKUzYExM" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="MCP接入点" src="docs/images/demo13.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1TJ7WzzEo6" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="多指令任务" src="docs/images/demo11.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1VC96Y5EMH" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="播放音乐" src="docs/images/demo7.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1Z8XuYZEAS" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="天气插件" src="docs/images/demo8.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV12J7WzBEaH" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="实时打断" src="docs/images/demo10.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1Co76z7EvK" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="拍照识物品" src="docs/images/demo12.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1CDKWemEU6" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="自定义音色" src="docs/images/demo2.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV12yA2egEaC" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="使用粤语交流" src="docs/images/demo3.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV17LXWYvENb" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="播报新闻" src="docs/images/demo0.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
This project has been established for a short time and has not passed the network security assessment, so please do not
|
---
|
||||||
use it in the production environment.
|
|
||||||
|
|
||||||
## Feature List
|
## Warnings ⚠️
|
||||||
|
|
||||||
## Implemented
|
1. This project is open-source software. This software has no commercial partnership with any third-party API service providers (including but not limited to speech recognition, large models, speech synthesis, and other platforms) that it interfaces with, and does not provide any form of guarantee for their service quality or financial security. It is recommended that users prioritize service providers with relevant business licenses and carefully read their service agreements and privacy policies. This software does not host any account keys, does not participate in fund flows, and does not bear the risk of recharge fund losses.
|
||||||
|
|
||||||
- `xiaozhi-esp32` WebSocket communication protocol
|
2. The functionality of this project is not complete and has not passed network security assessment. Please do not use it in production environments. If you deploy this project for learning purposes in a public network environment, please ensure necessary protection measures are in place.
|
||||||
- Supports wake-word initiated dialogue, manual dialogue, and real-time interruption of dialogue.
|
|
||||||
- Support for 5 languages: Mandarin, Cantonese, English, Japanese, Korean (FunASR - default)
|
|
||||||
- Flexible LLM switching (openai:ChatGLM - default, Aliyun, DeepSeek; dify:Dify)
|
|
||||||
- Flexible TTS switching (EdgeTTS - default, ByteDance Doubao TTS)
|
|
||||||
|
|
||||||
## In Progress
|
---
|
||||||
|
|
||||||
- Sleep mode after inactivity
|
## Deployment Documentation
|
||||||
- Dialogue memory
|
|
||||||
- Change the mood mode
|
|
||||||
|
|
||||||
## Supported Services
|

|
||||||
|
|
||||||
| Type | Service | Usage | Pricing Model | Notes |
|
This project provides two deployment methods. Please choose based on your specific needs:
|
||||||
|:-----|:-----------|:--------:|:---------------|:---------------------------------------------------------------------------|
|
|
||||||
| LLM | Aliyun | openai API call | Token-based | [Apply for API Key](https://bailian.console.aliyun.com/?apiKey=1#/api-key) |
|
|
||||||
| LLM | DeepSeek | openai API call | Token-based | [Apply for API Key](https://platform.deepseek.com/) |
|
|
||||||
| LLM | Bigmodel | openai API call | Free | [Create API Key](https://bigmodel.cn/usercenter/proj-mgmt/apikeys) |
|
|
||||||
| LLM | Dify | dify API call | Token-based | Self-hosted |
|
|
||||||
| TTS | HuoshanTTS | API call | Token-based | [Create API Key](https://console.volcengine.com/speech/service/8) |
|
|
||||||
| TTS | EdgeTTS | API call | Free | |
|
|
||||||
| VAD | SileroVAD | Local | Free | |
|
|
||||||
| ASR | FunASR | Local | Free | |
|
|
||||||
|
|
||||||
In fact, any LLM that supports OpenAI API calls can be integrated and used.
|
#### 🚀 Deployment Method Selection
|
||||||
|
| Deployment Method | Features | Applicable Scenarios | Deployment Docs | Configuration Requirements | Video Tutorials |
|
||||||
|
|---------|------|---------|---------|---------|---------|
|
||||||
|
| **Simplified Installation** | Intelligent dialogue, single agent management | Low-configuration environments, data stored in config files, no database required | [①Docker Version](./docs/Deployment.md#%E6%96%B9%E5%BC%8F%E4%B8%80docker%E5%8F%AA%E8%BF%90%E8%A1%8Cserver) / [②Source Code Deployment](./docs/Deployment.md#%E6%96%B9%E5%BC%8F%E4%BA%8C%E6%9C%AC%E5%9C%B0%E6%BA%90%E7%A0%81%E5%8F%AA%E8%BF%90%E8%A1%8Cserver)| 2 cores 4GB if using `FunASR`, 2 cores 2GB if all APIs | - |
|
||||||
|
| **Full Module Installation** | Intelligent dialogue, multi-user management, multi-agent management, intelligent console interface operation | Complete functionality experience, data stored in database |[①Docker Version](./docs/Deployment_all.md#%E6%96%B9%E5%BC%8F%E4%B8%80docker%E8%BF%90%E8%A1%8C%E5%85%A8%E6%A8%A1%E5%9D%97) / [②Source Code Deployment](./docs/Deployment_all.md#%E6%96%B9%E5%BC%8F%E4%BA%8C%E6%9C%AC%E5%9C%B0%E6%BA%90%E7%A0%81%E8%BF%90%E8%A1%8C%E5%85%A8%E6%A8%A1%E5%9D%97) / [③Source Code Deployment Auto-Update Tutorial](./docs/dev-ops-integration.md) | 4 cores 8GB if using `FunASR`, 2 cores 4GB if all APIs| [Local Source Code Startup Video Tutorial](https://www.bilibili.com/video/BV1wBJhz4Ewe) |
|
||||||
|
|
||||||
# Deployment
|
For frequently asked questions and related tutorials, please refer to [this link](./docs/FAQ.md)
|
||||||
|
|
||||||
This project supports rapid deployment of docker and local source code operation. If you want to have a quick
|
> 💡 Note: Below is a test platform deployed with the latest code. You can burn and test if needed. Concurrent users: 6, data will be cleared daily.
|
||||||
experience, it is recommended to use docker to deploy. If you want to have an in-depth understanding of this project, it
|
|
||||||
is recommended to run the local source code.
|
|
||||||
|
|
||||||
## Method 1: Quick deployment of docker
|
|
||||||
|
|
||||||
The docker image has supported the CPU of x86 architecture and arm64 architecture, and supports running on Chinese
|
|
||||||
operating systems.
|
|
||||||
|
|
||||||
1. Install docker
|
|
||||||
|
|
||||||
If your computer has not installed docker, you can follow the tutorial here to install
|
|
||||||
it:[Install docker](https://www.runoob.com/docker/ubuntu-docker-install.html)
|
|
||||||
|
|
||||||
2. Create a directory
|
|
||||||
|
|
||||||
After installation, you need to find a directory for the configuration file for this project. Let's call it the
|
|
||||||
`project directory` for the time being. This directory is preferably a newly created empty directory.
|
|
||||||
|
|
||||||
3. Download the configuration file
|
|
||||||
|
|
||||||
Open with a browser[This link](https://github.com/xinnan-tech/xiaozhi-esp32-server/blob/main/config.yaml)。
|
|
||||||
|
|
||||||
On the right side of the page, find the button named `RAW`, next to the `RAW` button, find the download icon, click the
|
|
||||||
Download button, and download the `config.yaml` file. Download the file to your `project directory`.
|
|
||||||
|
|
||||||
4. Configure Project
|
|
||||||
|
|
||||||
Modify the `config.yaml` file to configure the various parameters required for this project. The default LLM uses
|
|
||||||
`ChatGLMLLM`, you need to configure the key to start.
|
|
||||||
The default TTS uses `EdgeTTS`. This does not require configuration. If you need to replace it with`Doubao TTS`, you
|
|
||||||
need to
|
|
||||||
configure the key.
|
|
||||||
|
|
||||||
Configuration description: This is the default component of each function, such as LLM default to use the `ChatGLMLLM`
|
|
||||||
model. If you need to switch the model, it is the corresponding name.
|
|
||||||
|
|
||||||
The default configuration of this project is only the lowest operating cost configuration(`glm-4-flash`and`EdgeTTS`are
|
|
||||||
free),If you need to be better and faster, you need to combine the use of the deployment environment to switch the use
|
|
||||||
of each component。
|
|
||||||
|
|
||||||
```
|
```
|
||||||
selected_module:
|
Intelligent Control Console Address: https://2662r3426b.vicp.fun
|
||||||
ASR: FunASR
|
Intelligent Control Console Address (H5): https://2662r3426b.vicp.fun/h5/index.html
|
||||||
VAD: SileroVAD
|
|
||||||
LLM: ChatGLMLLM
|
Service Test Tool: https://2662r3426b.vicp.fun/test/
|
||||||
TTS: EdgeTTS
|
OTA Interface Address: https://2662r3426b.vicp.fun/xiaozhi/ota/
|
||||||
|
Websocket Interface Address: wss://2662r3426b.vicp.fun/xiaozhi/v1/
|
||||||
```
|
```
|
||||||
|
|
||||||
For example, to modify the components used by the `LLM`, it depends on which `LLM` API interfaces are supported by this project. Currently, the supported ones are `openai` and `dify`. We welcome validation and support for more LLM platforms' interfaces.
|
#### 🚩 Configuration Description and Recommendations
|
||||||
When using it, change the `selected_module` to the corresponding name of the following LLM configurations:
|
> [!Note]
|
||||||
|
> This project provides two configuration schemes:
|
||||||
```
|
>
|
||||||
LLM:
|
> 1. `Entry Level Free Settings`: Suitable for personal and home use, all components use free solutions, no additional payment required.
|
||||||
AliLLM:
|
>
|
||||||
type: openai
|
> 2. `Streaming Configuration`: Suitable for demonstrations, training, scenarios with more than 2 concurrent users, etc. Uses streaming processing technology for faster response speed and better experience.
|
||||||
...
|
>
|
||||||
DeepSeekLLM:
|
> Starting from version `0.5.2`, the project supports streaming configuration. Compared to earlier versions, response speed is improved by approximately `2.5 seconds`, significantly improving user experience.
|
||||||
type: openai
|
|
||||||
...
|
|
||||||
ChatGLMLLM:
|
|
||||||
type: openai
|
|
||||||
...
|
|
||||||
DifyLLM:
|
|
||||||
type: openai
|
|
||||||
...
|
|
||||||
```
|
|
||||||
|
|
||||||
Some services, for example, if you use the TTS` of the `dify` and` bean bags, you need a key, remember to add the
|
| Module Name | Entry Level Free Settings | Streaming Configuration |
|
||||||
configuration file!
|
|:---:|:---:|:---:|
|
||||||
|
| ASR(Speech Recognition) | FunASR(Local) | 👍XunfeiStreamASR(Xunfei Streaming) |
|
||||||
|
| LLM(Large Model) | glm-4-flash(Zhipu) | 👍qwen-flash(Alibaba Bailian) |
|
||||||
|
| VLLM(Vision Large Model) | glm-4v-flash(Zhipu) | 👍qwen2.5-vl-3b-instructh(Alibaba Bailian) |
|
||||||
|
| TTS(Speech Synthesis) | ✅LinkeraiTTS(Lingxi streaming) | 👍HuoshanDoubleStreamTTS(Volcano Streaming) |
|
||||||
|
| Intent(Intent Recognition) | function_call(Function calling) | function_call(Function calling) |
|
||||||
|
| Memory(Memory function) | mem_local_short(Local short-term memory) | mem_local_short(Local short-term memory) |
|
||||||
|
|
||||||
5. Execute the docker command
|
If you are concerned about the latency of each component, please refer to the [Xiaozhi Component Performance Test Report](https://github.com/xinnan-tech/xiaozhi-performance-research), and test in your own environment following the test methods in the report.
|
||||||
|
|
||||||
Open the command line tool, `cd` enter your `project directory`, and execute the following command
|
|
||||||
|
|
||||||
```
|
#### 🔧 Testing Tools
|
||||||
#If you are Linux, execute
|
This project provides the following testing tools to help you verify the system and choose suitable models:
|
||||||
ls
|
|
||||||
#If you are Windows, execute
|
|
||||||
dir
|
|
||||||
```
|
|
||||||
|
|
||||||
If you can see the `config.yaml` file, you have indeed entered the `project directory`, and then execute the following
|
| Tool Name | Location | Usage Method | Function Description |
|
||||||
command:
|
|:---:|:---|:---:|:---:|
|
||||||
|
| Audio Interaction Test Tool | main》xiaozhi-server》test》test_page.html | Open directly with Google Chrome | Tests audio playback and reception functions, verifies if Python-side audio processing is normal |
|
||||||
```
|
| Model Response Test Tool | main》xiaozhi-server》performance_tester.py | Execute `python performance_tester.py` | Tests response speed of three core modules: ASR(speech recognition), LLM(large model), VLLM(vision model), TTS(speech synthesis) |
|
||||||
docker run -d --name xiaozhi-esp32-server --restart always --security-opt seccomp:unconfined -p 8000:8000 -v $(pwd)/config.yaml:/opt/xiaozhi-esp32-server/config.yaml ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest
|
|
||||||
```
|
|
||||||
|
|
||||||
If executed for the first time, it may take several minutes, and you have to be patient to wait for it to complete the
|
|
||||||
pull. After normal pulling is completed, you can execute the following command on the command line to see if the service
|
|
||||||
is started successfully.
|
|
||||||
|
|
||||||
```
|
|
||||||
docker ps
|
|
||||||
```
|
|
||||||
|
|
||||||
If you can see `xiaozhi-server`, it means that the service starts successfully. Then you can further execute the
|
|
||||||
following command to view the service log
|
|
||||||
|
|
||||||
```
|
|
||||||
docker logs -f xiaozhi-esp32-server
|
|
||||||
```
|
|
||||||
|
|
||||||
If you can see, similar to the following logs, it is a sign that the service of this project is successfully launched.
|
|
||||||
|
|
||||||
```
|
|
||||||
2025-xx-xx xx:51:59,492 - core.server - INFO - Server is running at ws://xx.xx.xx.xxx:8000
|
|
||||||
2025-xx-xx xx:51:59,516 - websockets.server - INFO - server listening on 0.0.0.0:8000
|
|
||||||
```
|
|
||||||
|
|
||||||
Next, you can start `compiling esp32 firmware`. Please go down and turn to the relevant chapter on
|
|
||||||
`compiling esp32 firmware`. So since you are deploying with docker, you have to check the IP of your native computer by
|
|
||||||
yourself.
|
|
||||||
Normally, assuming your ip is `192.168.1.25`, then your interface address is: `ws://192.168.1.25:8000`. This information
|
|
||||||
is very useful, and it is required to `compile esp32 firmware` later.
|
|
||||||
|
|
||||||
## Method 2 : Local Source Code Deployment
|
|
||||||
|
|
||||||
### 1.Install Prerequisites
|
|
||||||
|
|
||||||
This project uses 'conda' to manage dependencies, and after installation, start executing the following commands:
|
|
||||||
|
|
||||||
```
|
|
||||||
conda remove -n xiaozhi-esp32-server --all -y
|
|
||||||
conda create -n xiaozhi-esp32-server python=3.10 -y
|
|
||||||
conda activate xiaozhi-esp32-server
|
|
||||||
```
|
|
||||||
|
|
||||||
After executing the above command, if your computer is Windows or Mac, execute the following statement:
|
|
||||||
|
|
||||||
```
|
|
||||||
conda activate xiaozhi-esp32-server
|
|
||||||
conda install conda-forge::libopus
|
|
||||||
conda install conda-forge::ffmpeg
|
|
||||||
```
|
|
||||||
|
|
||||||
If your computer is ubuntu, execute the following statement:
|
|
||||||
|
|
||||||
```
|
|
||||||
apt-get install libopus0 ffmpeg
|
|
||||||
```
|
|
||||||
|
|
||||||
### 2.Install Dependencies
|
|
||||||
|
|
||||||
```
|
|
||||||
# Clone the project
|
|
||||||
cd xiaozhi-esp32-server
|
|
||||||
conda activate xiaozhi-esp32-server
|
|
||||||
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
|
|
||||||
pip install -r requirements.txt
|
|
||||||
```
|
|
||||||
|
|
||||||
### 3.Download ASR Model
|
|
||||||
|
|
||||||
Download [SenseVoiceSmall](https://modelscope.cn/models/iic/SenseVoiceSmall/resolve/master/model.pt) to
|
|
||||||
`model/SenseVoiceSmall`.
|
|
||||||
|
|
||||||
By default, the `SenseVoiceSmall` model is used to convert voice to text. Because the model is large, it needs to be
|
|
||||||
downloaded independently. After downloading, place the `model.pt` file in the `model/SenseVoiceSmall` directory. Choose
|
|
||||||
any of the following two download routes.
|
|
||||||
|
|
||||||
- Line 1: Download Ali Magic
|
|
||||||
Tower[SenseVoiceSmall](https://modelscope.cn/models/iic/SenseVoiceSmall/resolve/master/model.pt)
|
|
||||||
- Line 2: Baidu Netdisk download[SenseVoiceSmall](https://pan.baidu.com/share/init?surl=QlgM58FHhYv1tFnUT_A8Sg&pwd=qvna)
|
|
||||||
提取码: `qvna`
|
|
||||||
|
|
||||||
### 4.Configure Project
|
> 💡 Note: When testing model speed, only models with configured keys will be tested.
|
||||||
|
|
||||||
Modify the `config.yaml` file to configure the various parameters required for this project. The default LLM uses
|
|
||||||
`ChatGLMLLM`, you need to configure the key to start.
|
|
||||||
The default TTS uses `EdgeTTS`. This does not require configuration. If you need to replace it with`Doubao TTS`, you
|
|
||||||
need to
|
|
||||||
configure the key.
|
|
||||||
|
|
||||||
Configuration description: This is the default component of each function, such as LLM default to use the `ChatGLMLLM`
|
|
||||||
model. If you need to switch the model, it is the corresponding name.
|
|
||||||
|
|
||||||
The default configuration of this project is only the lowest operating cost configuration(`glm-4-flash`and`EdgeTTS`are
|
|
||||||
free),If you need to be better and faster, you need to combine the use of the deployment environment to switch the use
|
|
||||||
of each component。
|
|
||||||
|
|
||||||
```
|
---
|
||||||
selected_module:
|
## Feature List ✨
|
||||||
ASR: FunASR
|
### Implemented ✅
|
||||||
VAD: SileroVAD
|

|
||||||
LLM: ChatGLMLLM
|
| Feature Module | Description |
|
||||||
TTS: EdgeTTS
|
|:---:|:---|
|
||||||
```
|
| Core Architecture | Based on [MQTT+UDP gateway](https://github.com/xinnan-tech/xiaozhi-esp32-server/blob/main/docs/mqtt-gateway-integration.md), WebSocket and HTTP servers, provides complete console management and authentication system |
|
||||||
|
| Voice Interaction | Supports streaming ASR(speech recognition), streaming TTS(speech synthesis), VAD(voice activity detection), supports multi-language recognition and voice processing |
|
||||||
For example, to modify the components used by the `LLM`, it depends on which `LLM` API interfaces are supported by this project. Currently, the supported ones are `openai` and `dify`. We welcome validation and support for more LLM platforms' interfaces.
|
| Voiceprint Recognition | Supports multi-user voiceprint registration, management, and recognition, processes in parallel with ASR, real-time speaker identity recognition and passes to LLM for personalized responses |
|
||||||
When using it, change the `selected_module` to the corresponding name of the following LLM configurations:
|
| Intelligent Dialogue | Supports multiple LLM(large language models), implements intelligent dialogue |
|
||||||
|
| Visual Perception | Supports multiple VLLM(vision large models), implements multimodal interaction |
|
||||||
```
|
| Intent Recognition | Supports LLM intent recognition, Function Call function calling, provides plugin-based intent processing mechanism |
|
||||||
LLM:
|
| Memory System | Supports local short-term memory, mem0ai interface memory, PowerMem intelligent memory, with memory summarization functionality |
|
||||||
AliLLM:
|
| Knowledge Base | Supports RAGFlow knowledge base, enabling LLM to judge whether to schedule the knowledge base after receiving the user's question, and then answer the question |
|
||||||
type: openai
|
| Tool Calling | Supports client IOT protocol, client MCP protocol, server MCP protocol, MCP endpoint protocol, custom tool functions |
|
||||||
...
|
| Command Delivery | Supports MCP command delivery to ESP32 devices via MQTT protocol from Smart Console |
|
||||||
DeepSeekLLM:
|
| Management Backend | Provides Web management interface, supports user management, system configuration and device management; Supports Simplified Chinese, Traditional Chinese and English display |
|
||||||
type: openai
|
| Testing Tools | Provides performance testing tools, vision model testing tools, and audio interaction testing tools |
|
||||||
...
|
| Deployment Support | Supports Docker deployment and local deployment, provides complete configuration file management |
|
||||||
ChatGLMLLM:
|
| Plugin System | Supports functional plugin extensions, custom plugin development, and plugin hot-loading |
|
||||||
type: openai
|
|
||||||
...
|
|
||||||
DifyLLM:
|
|
||||||
type: openai
|
|
||||||
...
|
|
||||||
```
|
|
||||||
|
|
||||||
Some services, for example, if you use the TTS` of the `dify` and` bean bags, you need a key, remember to add the
|
|
||||||
configuration file!
|
|
||||||
|
|
||||||
### 5.Run the Project
|
|
||||||
|
|
||||||
Run the Project
|
### Under Development 🚧
|
||||||
|
|
||||||
```
|
To learn about specific development plan progress, [click here](https://github.com/users/xinnan-tech/projects/3). For frequently asked questions and related tutorials, please refer to [this link](./docs/FAQ.md)
|
||||||
# Make sure to execute in the root directory of this project
|
|
||||||
conda activate xiaozhi-esp32-server
|
|
||||||
python app.py
|
|
||||||
```
|
|
||||||
|
|
||||||
You'll see the WebSocket endpoint in logs:
|
If you are a software developer, here is an [Open Letter to Developers](docs/contributor_open_letter.md). Welcome to join!
|
||||||
|
|
||||||
```
|
---
|
||||||
2025-xx-xx xx:51:59,492 - core.server - INFO - Server is running at ws://192.168.1.25:8000
|
|
||||||
2025-xx-xx xx:51:59,516 - websockets.server - INFO - server listening on 0.0.0.0:8000
|
|
||||||
```
|
|
||||||
|
|
||||||
Among them, the `ws://192.168.1.25:8000` is the interface address provided by this project. Of course, your own machine
|
## Product Ecosystem 👬
|
||||||
is different from mine. Remember to find your own address.
|
Xiaozhi is an ecosystem. When using this product, you can also check out other [excellent projects](https://github.com/78/xiaozhi-esp32/blob/main/README_zh.md#%E7%9B%B8%E5%85%B3%E5%BC%80%E6%BA%90%E9%A1%B9%E7%9B%AE) in this ecosystem
|
||||||
|
|
||||||
# Compile ESP32 Firmware
|
---
|
||||||
|
|
||||||
1. Download `xiaozhi-esp32` project, configure the project environment according to this
|
## Supported Platforms/Components List 📋
|
||||||
tutorial [" Windows builds ESP IDF 5.3.2 Development Environment and Compiles Xiaozhi "](https://icnynnzcwou8.feishu.cn/wiki/JEYDwTTALi5s2zkGlFGcDiRknXf)
|
### LLM Language Models
|
||||||
Cure
|
|
||||||
|
|
||||||
2. Open the `xiaozhi-esp32/main/kconfig.projbuild` file, find the content of the` websocket_url` `default`, change the
|
| Usage Method | Supported Platforms | Free Platforms |
|
||||||
` wss: // api.tenclass.net` to your own address, such as
|
|:---:|:---:|:---:|
|
||||||
|
| OpenAI interface calls | Alibaba Bailian, Volcano Engine, DeepSeek, Zhipu, Gemini, iFLYTEK | Zhipu, Gemini |
|
||||||
|
| Ollama interface calls | Ollama | - |
|
||||||
|
| Dify interface calls | Dify | - |
|
||||||
|
| FastGPT interface calls | FastGPT | - |
|
||||||
|
| Coze interface calls | Coze | - |
|
||||||
|
| Xinference interface calls | Xinference | - |
|
||||||
|
| HomeAssistant interface calls | HomeAssistant | - |
|
||||||
|
|
||||||
Before modification:
|
In fact, any LLM that supports OpenAI interface calls can be integrated and used.
|
||||||
|
|
||||||
```
|
---
|
||||||
config WEBSOCKET_URL
|
|
||||||
depends on CONNECTION_TYPE_WEBSOCKET
|
|
||||||
string "Websocket URL"
|
|
||||||
default "wss://api.tenclass.net/xiaozhi/v1/"
|
|
||||||
help
|
|
||||||
Communication with the server through websocket after wake up.
|
|
||||||
```
|
|
||||||
|
|
||||||
After modification (example):
|
### VLLM Vision Models
|
||||||
|
|
||||||
```
|
| Usage Method | Supported Platforms | Free Platforms |
|
||||||
config WEBSOCKET_URL
|
|:---:|:---:|:---:|
|
||||||
depends on CONNECTION_TYPE_WEBSOCKET
|
| OpenAI interface calls | Alibaba Bailian, Zhipu ChatGLMVLLM | Zhipu ChatGLMVLLM |
|
||||||
string "Websocket URL"
|
|
||||||
default "ws://192.168.1.25:8000/xiaozhi/v1/"
|
|
||||||
help
|
|
||||||
Communication with the server through websocket after wake up.
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Configure build settings:
|
In fact, any VLLM that supports OpenAI interface calls can be integrated and used.
|
||||||
|
|
||||||
```
|
---
|
||||||
# The terminal command line enters the root directory of xiaozhi-esp32
|
|
||||||
cd xiaozhi-esp32
|
|
||||||
# For example, the board I use is ESP32S3, so the compile target is ESP32S3. If your board is other models, please replace it with the corresponding model
|
|
||||||
idf.py set-target esp32s3
|
|
||||||
# Enter the menu configuration
|
|
||||||
idf.py menuconfig
|
|
||||||
```
|
|
||||||
|
|
||||||

|
### TTS Speech Synthesis
|
||||||
|
|
||||||
After entering the menu configuration, then enter `xiaozhi assistant`, set the` connection_type` to `websocket`
|
| Usage Method | Supported Platforms | Free Platforms |
|
||||||
Go back to the main menu, then enter `xiaozhi assistant`, set the `BOARD_TYPE` of your board
|
|:---:|:---:|:---:|
|
||||||
Save exit and return to the terminal command line.
|
| Interface calls | EdgeTTS, iFLYTEK, Volcano Engine, Tencent Cloud, Alibaba Cloud and Bailian, CosyVoiceSiliconflow, TTS302AI, CozeCnTTS, GizwitsTTS, ACGNTTS, OpenAITTS, Lingxi Streaming TTS, MinimaxTTS | Lingxi Streaming TTS, EdgeTTS, CosyVoiceSiliconflow(partial) |
|
||||||
|
| Local services | FishSpeech, GPT_SOVITS_V2, GPT_SOVITS_V3, Index-TTS, PaddleSpeech | Index-TTS, PaddleSpeech, FishSpeech, GPT_SOVITS_V2, GPT_SOVITS_V3 |
|
||||||
|
|
||||||

|
---
|
||||||
|
|
||||||
4. Build and package:
|
### VAD Voice Activity Detection
|
||||||
|
|
||||||
```
|
| Type | Platform Name | Usage Method | Pricing Model | Notes |
|
||||||
idf.py build
|
|:---:|:---------:|:----:|:----:|:--:|
|
||||||
cd scripts
|
| VAD | SileroVAD | Local use | Free | |
|
||||||
python release.py
|
|
||||||
```
|
|
||||||
|
|
||||||
After the compilation is successful, the firmware file `merged-binary.bin` is generated in the` build` directory in the
|
---
|
||||||
project root directory.
|
|
||||||
This `merged-binary.bin` is the firmware file that will be recorded on the hardware.
|
|
||||||
|
|
||||||
6. Flash
|
### ASR Speech Recognition
|
||||||
Connect the ESP32 device to the computer, use the Chrome browser, and open the following URL
|
|
||||||
|
|
||||||
```
|
| Usage Method | Supported Platforms | Free Platforms |
|
||||||
https://espressif.github.io/esp-launchpad/
|
|:---:|:---:|:---:|
|
||||||
```
|
| Local use | FunASR, SherpaASR | FunASR, SherpaASR |
|
||||||
|
| Interface calls | FunASRServer, Volcano Engine, iFLYTEK, Tencent Cloud, Alibaba Cloud, Baidu Cloud, OpenAI ASR | FunASRServer |
|
||||||
|
|
||||||
Open this
|
---
|
||||||
tutorial, [Flash Tools/Web -side Burning Folding Step (No IDF Development Environment)](https://ccnphfhqs21z.feishu.cn/wiki/Zpz4wXBtdimBrLk25WdcXzxcnNS).
|
|
||||||
Turn to: `Method 2: ESP-LAUNCHPAD browser web-end burning`, start from
|
|
||||||
`3. Burning firmware/download to the development board`, follow the tutorial operation.
|
|
||||||
|
|
||||||
# FAQ
|
### Voiceprint Recognition
|
||||||
|
|
||||||
## 1、TTS often fails, often overtime
|
| Usage Method | Supported Platforms | Free Platforms |
|
||||||
|
|:---:|:---:|:---:|
|
||||||
|
| Local use | 3D-Speaker | 3D-Speaker |
|
||||||
|
|
||||||
Suggestion: If the `Edgetts` is slow or often fails, you can replace it with a bean bag TTS` with a volcanic engine. If
|
---
|
||||||
both are slow, the network environment may need to be optimized.
|
|
||||||
|
|
||||||
## 2、Big model reply is a bit slow
|
### Memory Storage
|
||||||
|
|
||||||
Suggestions: Both big models and TTS are dependent interfaces. If the network environment is not good, you can consider
|
| Type | Platform Name | Usage Method | Pricing Model | Notes |
|
||||||
changing the local model. Or try to switch different interface models.
|
|:------:|:---------------:|:----:|:---------:|:--:|
|
||||||
|
| Memory | mem0ai | Interface calls | 1000 times/month quota | |
|
||||||
|
| Memory | [powermem](./docs/powermem-integration.md) | Local summarization | Depends on LLM and DB | OceanBase open source, supports intelligent retrieval |
|
||||||
|
| Memory | mem_local_short | Local summarization | Free | |
|
||||||
|
| Memory | nomem | No memory mode | Free | |
|
||||||
|
|
||||||
## 3、Why is my ChatGLMLLM replying to a bit? Obviously it is Xiaozhi, but treats me as Xiaozhi.
|
---
|
||||||
|
|
||||||
Suggestion: You can modify the prompts in the configuration file first. You can also replace the free `GLM-4-FLASH` to
|
### Intent Recognition
|
||||||
the model of other toll versions of `ChatGlm`.
|
|
||||||
|
|
||||||
## 4、I want to control the operation of electric lights, air conditioners, remote switching and other operations through Xiaozhi.
|
| Type | Platform Name | Usage Method | Pricing Model | Notes |
|
||||||
|
|:------:|:-------------:|:----:|:-------:|:---------------------:|
|
||||||
|
| Intent | intent_llm | Interface calls | Based on LLM pricing | Recognizes intent through large models, strong generalization |
|
||||||
|
| Intent | function_call | Interface calls | Based on LLM pricing | Completes intent through large model function calling, fast speed, good effect |
|
||||||
|
| Intent | nointent | No intent mode | Free | Does not perform intent recognition, directly returns dialogue result |
|
||||||
|
|
||||||
Suggestion: In the configuration file, set the `LLM` to`DifyLLM`, and then arrange the smart application by the
|
---
|
||||||
`Dify`.
|
|
||||||
|
|
||||||
## 5、I said very slowly, I paused, Xiaozhi always grabbed me, what to do.
|
### Rag Retrieval-Augmented Generation
|
||||||
|
|
||||||
Suggestion: In the configuration file, find this section, change the `min_silence_duration_ms` value, such as change to
|
| Type | Platform Name | Usage Method | Pricing Model | Notes |
|
||||||
` 1000`.
|
|:------:|:-------------:|:----:|:-------:|:---------------------:|
|
||||||
|
| Rag | ragflow | Interface calls | Charged based on tokens consumed for slicing and word segmentation | Utilizes RagFlow's retrieval-augmented generation feature to provide more accurate dialog responses |
|
||||||
|
|
||||||
```
|
---
|
||||||
VAD:
|
|
||||||
SileroVAD:
|
|
||||||
threshold: 0.5
|
|
||||||
model_dir: models/snakers4_silero-vad
|
|
||||||
min_silence_duration_ms: 700 # 如果说话停顿比较长,可以把这个值设置大一些
|
|
||||||
```
|
|
||||||
|
|
||||||
## 6、For more questions, contact us to feedback
|
## Acknowledgments 🙏
|
||||||
|
|
||||||

|
| Logo | Project/Company | Description |
|
||||||
|
|:---:|:---:|:---|
|
||||||
|
| <img src="./docs/images/logo_bailing.png" width="160"> | [Bailing Voice Dialogue Robot](https://github.com/wwbin2017/bailing) | This project is inspired by [Bailing Voice Dialogue Robot](https://github.com/wwbin2017/bailing) and implemented on its basis |
|
||||||
|
| <img src="./docs/images/logo_tenclass.png" width="160"> | [Tenclass](https://www.tenclass.com/) | Thanks to [Tenclass](https://www.tenclass.com/) for formulating standard communication protocols, multi-device compatibility solutions, and high-concurrency scenario practice demonstrations for the Xiaozhi ecosystem; providing full-link technical documentation support for this project |
|
||||||
|
| <img src="./docs/images/logo_xuanfeng.png" width="160"> | [Xuanfeng Technology](https://github.com/Eric0308) | Thanks to [Xuanfeng Technology](https://github.com/Eric0308) for contributing function calling framework, MCP communication protocol, and plugin-based calling mechanism implementation code. Through standardized instruction scheduling system and dynamic expansion capabilities, it significantly improves the interaction efficiency and functional extensibility of frontend devices (IoT) |
|
||||||
|
| <img src="./docs/images/logo_junsen.png" width="160"> | [huangjunsen](https://github.com/huangjunsen0406) | Thanks to [huangjunsen](https://github.com/huangjunsen0406) for contributing the `Smart Control Console Mobile` module, which enables efficient control and real-time interaction across mobile devices, significantly enhancing the system's operational convenience and management efficiency in mobile scenarios. |
|
||||||
|
| <img src="./docs/images/logo_huiyuan.png" width="160"> | [Huiyuan Design](http://ui.kwd988.net/) | Thanks to [Huiyuan Design](http://ui.kwd988.net/) for providing professional visual solutions for this project, using their design practical experience serving over a thousand enterprises to empower this project's product user experience |
|
||||||
|
| <img src="./docs/images/logo_qinren.png" width="160"> | [Xi'an Qinren Information Technology](https://www.029app.com/) | Thanks to [Xi'an Qinren Information Technology](https://www.029app.com/) for deepening this project's visual system, ensuring consistency and extensibility of overall design style in multi-scenario applications |
|
||||||
|
| <img src="./docs/images/logo_contributors.png" width="160"> | [Code Contributors](https://github.com/xinnan-tech/xiaozhi-esp32-server/graphs/contributors) | Thanks to [all code contributors](https://github.com/xinnan-tech/xiaozhi-esp32-server/graphs/contributors), your efforts have made the project more robust and powerful. |
|
||||||
|
|
||||||
# Acknowledgments
|
|
||||||
|
|
||||||
- This project is inspired by the [Bailin Voice Dialogue Robot](https://github.com/wwbin2017/bailing) project, and the
|
|
||||||
basic idea of the project is completed。
|
|
||||||
- Thanks to [Tencent Cloud] (https://cloud.tencent.com/) for providing free docker space for this project。
|
|
||||||
- Thanks to [tenclass](https://www.tenclass.com/)Provide adequate documentation support on Xiaozhi Communication
|
|
||||||
Protocol。
|
|
||||||
|
|
||||||
<a href="https://star-history.com/#xinnan-tech/xiaozhi-esp32-server&Date">
|
<a href="https://star-history.com/#xinnan-tech/xiaozhi-esp32-server&Date">
|
||||||
|
|
||||||
<picture>
|
<picture>
|
||||||
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=xinnan-tech/xiaozhi-esp32-server&type=Date&theme=dark" />
|
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=xinnan-tech/xiaozhi-esp32-server&type=Date&theme=dark" />
|
||||||
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=xinnan-tech/xiaozhi-esp32-server&type=Date" />
|
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=xinnan-tech/xiaozhi-esp32-server&type=Date" />
|
||||||
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=xinnan-tech/xiaozhi-esp32-server&type=Date" />
|
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=xinnan-tech/xiaozhi-esp32-server&type=Date" />
|
||||||
</picture>
|
</picture>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
+376
@@ -0,0 +1,376 @@
|
|||||||
|
[](https://github.com/xinnan-tech/xiaozhi-esp32-server)
|
||||||
|
|
||||||
|
<h1 align="center">Serviço Backend Xiaozhi xiaozhi-esp32-server</h1>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
Este projeto é baseado na teoria e tecnologia de inteligência simbiótica humano-máquina para desenvolver sistemas inteligentes de hardware e software para terminais<br/>fornecendo serviços de backend para o projeto de hardware inteligente de código aberto
|
||||||
|
<a href="https://github.com/78/xiaozhi-esp32">xiaozhi-esp32</a><br/>
|
||||||
|
Implementado usando Python, Java e Vue de acordo com o <a href="https://ccnphfhqs21z.feishu.cn/wiki/M0XiwldO9iJwHikpXD5cEx71nKh">Protocolo de Comunicação Xiaozhi</a><br/>
|
||||||
|
Suporte ao protocolo MQTT+UDP, protocolo WebSocket, ponto de acesso MCP, reconhecimento de impressão vocal e base de conhecimento
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="./docs/FAQ.md">Perguntas Frequentes</a>
|
||||||
|
· <a href="https://github.com/xinnan-tech/xiaozhi-esp32-server/issues">Reportar Problemas</a>
|
||||||
|
· <a href="./README.md#%E9%83%A8%E7%BD%B2%E6%96%87%E6%A1%A3">Documentação de Implantação</a>
|
||||||
|
· <a href="https://github.com/xinnan-tech/xiaozhi-esp32-server/releases">Notas de Lançamento</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="./README.md"><img alt="简体中文版自述文件" src="https://img.shields.io/badge/简体中文-DFE0E5"></a>
|
||||||
|
<a href="./README_en.md"><img alt="README in English" src="https://img.shields.io/badge/English-DFE0E5"></a>
|
||||||
|
<a href="./README_vi.md"><img alt="Tiếng Việt" src="https://img.shields.io/badge/Tiếng Việt-DFE0E5"></a>
|
||||||
|
<a href="./README_de.md"><img alt="Deutsch" src="https://img.shields.io/badge/Deutsch-DFE0E5"></a>
|
||||||
|
<a href="./README_pt_BR.md"><img alt="Português (Brasil)" src="https://img.shields.io/badge/Português (Brasil)-DBEDFA"></a>
|
||||||
|
<a href="https://github.com/xinnan-tech/xiaozhi-esp32-server/releases">
|
||||||
|
<img alt="GitHub Contributors" src="https://img.shields.io/github/v/release/xinnan-tech/xiaozhi-esp32-server?logo=docker" />
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/xinnan-tech/xiaozhi-esp32-server/blob/main/LICENSE">
|
||||||
|
<img alt="GitHub pull requests" src="https://img.shields.io/badge/license-MIT-white?labelColor=black" />
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/xinnan-tech/xiaozhi-esp32-server">
|
||||||
|
<img alt="stars" src="https://img.shields.io/github/stars/xinnan-tech/xiaozhi-esp32-server?color=ffcb47&labelColor=black" />
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
Liderado pela Equipe do Professor Siyuan Liu (Universidade de Tecnologia do Sul da China)
|
||||||
|
</br>
|
||||||
|
刘思源教授团队主导研发(华南理工大学)
|
||||||
|
</br>
|
||||||
|
<img src="./docs/images/hnlg.jpg" alt="Universidade de Tecnologia do Sul da China (华南理工大学)" width="50%">
|
||||||
|
</p>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Público-Alvo 👥
|
||||||
|
|
||||||
|
Este projeto requer dispositivos de hardware ESP32 para funcionar. Se você adquiriu hardware relacionado ao ESP32, conectou-se com sucesso ao serviço backend implantado pelo Brother Xia e deseja construir seu próprio serviço backend `xiaozhi-esp32` de forma independente, então este projeto é perfeito para você.
|
||||||
|
|
||||||
|
Quer ver os efeitos de uso? Clique nos vídeos abaixo 🎥
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1FMFyejExX" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="Experiência de velocidade de resposta" src="docs/images/demo9.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1vchQzaEse" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="Segredo da otimização de velocidade" src="docs/images/demo6.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1C1tCzUEZh" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="Cenário médico complexo" src="docs/images/demo1.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1zUW5zJEkq" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="Envio de comandos MQTT" src="docs/images/demo4.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1Exu3zqEDe" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="Reconhecimento de impressão vocal" src="docs/images/demo14.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1pNXWYGEx1" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="Controle de interruptores de eletrodomésticos" src="docs/images/demo5.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1ZQKUzYExM" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="Ponto de acesso MCP" src="docs/images/demo13.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1TJ7WzzEo6" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="Tarefas com múltiplos comandos" src="docs/images/demo11.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1VC96Y5EMH" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="Reproduzir música" src="docs/images/demo7.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1Z8XuYZEAS" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="Plugin de clima" src="docs/images/demo8.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV12J7WzBEaH" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="Interrupção em tempo real" src="docs/images/demo10.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1Co76z7EvK" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="Fotografar e identificar objetos" src="docs/images/demo12.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1CDKWemEU6" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="Timbre de voz personalizado" src="docs/images/demo2.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV12yA2egEaC" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="Comunicação em cantonês" src="docs/images/demo3.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV17LXWYvENb" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="Transmissão de notícias" src="docs/images/demo0.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Avisos ⚠️
|
||||||
|
|
||||||
|
1. Este projeto é um software de código aberto. Este software não possui parceria comercial com nenhum provedor de serviços de API de terceiros (incluindo, mas não se limitando a reconhecimento de fala, modelos de linguagem, síntese de voz e outras plataformas) com os quais se conecta, e não fornece nenhuma forma de garantia quanto à qualidade de serviço ou segurança financeira desses provedores. Recomenda-se que os usuários priorizem provedores de serviço com licenças comerciais relevantes e leiam cuidadosamente seus termos de serviço e políticas de privacidade. Este software não armazena nenhuma chave de conta, não participa de fluxos de fundos e não assume o risco de perda de fundos recarregados.
|
||||||
|
|
||||||
|
2. A funcionalidade deste projeto não está completa e não passou por avaliação de segurança de rede. Por favor, não o utilize em ambientes de produção. Se você implantar este projeto para fins de aprendizado em um ambiente de rede pública, certifique-se de que as medidas de proteção necessárias estejam em vigor.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Documentação de Implantação
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Este projeto oferece dois métodos de implantação. Por favor, escolha de acordo com suas necessidades específicas:
|
||||||
|
|
||||||
|
#### 🚀 Seleção do Método de Implantação
|
||||||
|
| Método de Implantação | Funcionalidades | Cenários Aplicáveis | Documentação de Implantação | Requisitos de Configuração | Tutoriais em Vídeo |
|
||||||
|
|---------|------|---------|---------|---------|---------|
|
||||||
|
| **Instalação Simplificada** | Diálogo inteligente, gerenciamento de agente único | Ambientes de baixa configuração, dados armazenados em arquivos de configuração, sem necessidade de banco de dados | [①Versão Docker](./docs/Deployment.md#%E6%96%B9%E5%BC%8F%E4%B8%80docker%E5%8F%AA%E8%BF%90%E8%A1%8Cserver) / [②Implantação via Código-Fonte](./docs/Deployment.md#%E6%96%B9%E5%BC%8F%E4%BA%8C%E6%9C%AC%E5%9C%B0%E6%BA%90%E7%A0%81%E5%8F%AA%E8%BF%90%E8%A1%8Cserver)| 2 núcleos 4GB se usar `FunASR`, 2 núcleos 2GB se todas APIs | - |
|
||||||
|
| **Instalação de Módulo Completo** | Diálogo inteligente, gerenciamento multiusuário, gerenciamento de múltiplos agentes, operação de interface do console inteligente | Experiência com funcionalidade completa, dados armazenados em banco de dados |[①Versão Docker](./docs/Deployment_all.md#%E6%96%B9%E5%BC%8F%E4%B8%80docker%E8%BF%90%E8%A1%8C%E5%85%A8%E6%A8%A1%E5%9D%97) / [②Implantação via Código-Fonte](./docs/Deployment_all.md#%E6%96%B9%E5%BC%8F%E4%BA%8C%E6%9C%AC%E5%9C%B0%E6%BA%90%E7%A0%81%E8%BF%90%E8%A1%8C%E5%85%A8%E6%A8%A1%E5%9D%97) / [③Tutorial de Atualização Automática via Código-Fonte](./docs/dev-ops-integration.md) | 4 núcleos 8GB se usar `FunASR`, 2 núcleos 4GB se todas APIs| [Tutorial em Vídeo de Inicialização via Código-Fonte Local](https://www.bilibili.com/video/BV1wBJhz4Ewe) |
|
||||||
|
|
||||||
|
Perguntas frequentes e tutoriais relacionados podem ser consultados [neste link](./docs/FAQ.md)
|
||||||
|
|
||||||
|
> 💡 Nota: Abaixo está uma plataforma de teste implantada com o código mais recente. Você pode gravar e testar se necessário. Usuários simultâneos: 6, os dados serão limpos diariamente.
|
||||||
|
|
||||||
|
```
|
||||||
|
Endereço do Console de Controle Inteligente: https://2662r3426b.vicp.fun
|
||||||
|
Endereço do Console de Controle Inteligente (H5): https://2662r3426b.vicp.fun/h5/index.html
|
||||||
|
|
||||||
|
Ferramenta de Teste de Serviço: https://2662r3426b.vicp.fun/test/
|
||||||
|
Endereço da Interface OTA: https://2662r3426b.vicp.fun/xiaozhi/ota/
|
||||||
|
Endereço da Interface WebSocket: wss://2662r3426b.vicp.fun/xiaozhi/v1/
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 🚩 Descrição e Recomendações de Configuração
|
||||||
|
> [!Note]
|
||||||
|
> Este projeto oferece dois esquemas de configuração:
|
||||||
|
>
|
||||||
|
> 1. `Configurações Gratuitas Nível Básico`: Adequado para uso pessoal e doméstico, todos os componentes utilizam soluções gratuitas, sem necessidade de pagamento adicional.
|
||||||
|
>
|
||||||
|
> 2. `Configuração de Streaming`: Adequado para demonstrações, treinamentos, cenários com mais de 2 usuários simultâneos, etc. Utiliza tecnologia de processamento em streaming para velocidade de resposta mais rápida e melhor experiência.
|
||||||
|
>
|
||||||
|
> A partir da versão `0.5.2`, o projeto suporta configuração de streaming. Em comparação com versões anteriores, a velocidade de resposta é melhorada em aproximadamente `2,5 segundos`, melhorando significativamente a experiência do usuário.
|
||||||
|
|
||||||
|
| Nome do Módulo | Configurações Gratuitas Nível Básico | Configuração de Streaming |
|
||||||
|
|:---:|:---:|:---:|
|
||||||
|
| ASR(Reconhecimento de Fala) | FunASR(Local) | 👍XunfeiStreamASR(Xunfei Streaming) |
|
||||||
|
| LLM(Modelo de Linguagem) | glm-4-flash(Zhipu) | 👍qwen-flash(Alibaba Bailian) |
|
||||||
|
| VLLM(Modelo de Visão) | glm-4v-flash(Zhipu) | 👍qwen2.5-vl-3b-instructh(Alibaba Bailian) |
|
||||||
|
| TTS(Síntese de Voz) | ✅LinkeraiTTS(Lingxi streaming) | 👍HuoshanDoubleStreamTTS(Volcano Streaming) |
|
||||||
|
| Intent(Reconhecimento de Intenção) | function_call(Chamada de função) | function_call(Chamada de função) |
|
||||||
|
| Memory(Função de Memória) | mem_local_short(Memória local de curto prazo) | mem_local_short(Memória local de curto prazo) |
|
||||||
|
|
||||||
|
Se você está preocupado com o tempo de resposta de cada componente, consulte o [Relatório de Teste de Desempenho dos Componentes Xiaozhi](https://github.com/xinnan-tech/xiaozhi-performance-research), e teste em seu próprio ambiente seguindo os métodos de teste do relatório.
|
||||||
|
|
||||||
|
#### 🔧 Ferramentas de Teste
|
||||||
|
Este projeto fornece as seguintes ferramentas de teste para ajudá-lo a verificar o sistema e escolher modelos adequados:
|
||||||
|
|
||||||
|
| Nome da Ferramenta | Localização | Método de Uso | Descrição da Função |
|
||||||
|
|:---:|:---|:---:|:---:|
|
||||||
|
| Ferramenta de Teste de Interação por Áudio | main》xiaozhi-server》test》test_page.html | Abrir diretamente com Google Chrome | Testa as funções de reprodução e recepção de áudio, verifica se o processamento de áudio no lado Python está normal |
|
||||||
|
| Ferramenta de Teste de Resposta de Modelo | main》xiaozhi-server》performance_tester.py | Execute `python performance_tester.py` | Testa a velocidade de resposta dos três módulos principais: ASR(reconhecimento de fala), LLM(modelo de linguagem), VLLM(modelo de visão), TTS(síntese de voz) |
|
||||||
|
|
||||||
|
> 💡 Nota: Ao testar a velocidade dos modelos, apenas os modelos com chaves configuradas serão testados.
|
||||||
|
|
||||||
|
---
|
||||||
|
## Lista de Funcionalidades ✨
|
||||||
|
### Implementado ✅
|
||||||
|

|
||||||
|
| Módulo de Funcionalidade | Descrição |
|
||||||
|
|:---:|:---|
|
||||||
|
| Arquitetura Principal | Baseado em [gateway MQTT+UDP](https://github.com/xinnan-tech/xiaozhi-esp32-server/blob/main/docs/mqtt-gateway-integration.md), servidores WebSocket e HTTP, fornece sistema completo de gerenciamento de console e autenticação |
|
||||||
|
| Interação por Voz | Suporta ASR em streaming (reconhecimento de fala), TTS em streaming (síntese de voz), VAD (detecção de atividade vocal), suporta reconhecimento multilíngue e processamento de voz |
|
||||||
|
| Reconhecimento de Impressão Vocal | Suporta registro, gerenciamento e reconhecimento de impressão vocal de múltiplos usuários, processa em paralelo com o ASR, reconhecimento de identidade do falante em tempo real e repassa ao LLM para respostas personalizadas |
|
||||||
|
| Diálogo Inteligente | Suporta múltiplos LLM (modelos de linguagem de grande porte), implementa diálogo inteligente |
|
||||||
|
| Percepção Visual | Suporta múltiplos VLLM (modelos de visão de grande porte), implementa interação multimodal |
|
||||||
|
| Reconhecimento de Intenção | Suporta reconhecimento de intenção por LLM, Function Call (chamada de função), fornece mecanismo de processamento de intenção baseado em plugins |
|
||||||
|
| Sistema de Memória | Suporta memória local de curto prazo, memória via interface mem0ai, memória inteligente PowerMem, com funcionalidade de resumo de memória |
|
||||||
|
| Base de Conhecimento | Suporta base de conhecimento RAGFlow, permitindo que o LLM julgue se deve acionar a base de conhecimento após receber a pergunta do usuário, e então responda à pergunta |
|
||||||
|
| Chamada de Ferramentas | Suporta protocolo IOT do cliente, protocolo MCP do cliente, protocolo MCP do servidor, protocolo de endpoint MCP, funções de ferramentas personalizadas |
|
||||||
|
| Envio de Comandos | Suporta envio de comandos MCP para dispositivos ESP32 via protocolo MQTT a partir do Console Inteligente |
|
||||||
|
| Backend de Gerenciamento | Fornece interface de gerenciamento Web, suporta gerenciamento de usuários, configuração do sistema e gerenciamento de dispositivos; Suporta exibição em Chinês Simplificado, Chinês Tradicional e Inglês |
|
||||||
|
| Ferramentas de Teste | Fornece ferramentas de teste de desempenho, ferramentas de teste de modelo de visão e ferramentas de teste de interação por áudio |
|
||||||
|
| Suporte à Implantação | Suporta implantação via Docker e implantação local, fornece gerenciamento completo de arquivos de configuração |
|
||||||
|
| Sistema de Plugins | Suporta extensões de plugins funcionais, desenvolvimento de plugins personalizados e carregamento dinâmico de plugins |
|
||||||
|
|
||||||
|
### Em Desenvolvimento 🚧
|
||||||
|
|
||||||
|
Para conhecer o progresso específico do plano de desenvolvimento, [clique aqui](https://github.com/users/xinnan-tech/projects/3). Perguntas frequentes e tutoriais relacionados podem ser consultados [neste link](./docs/FAQ.md)
|
||||||
|
|
||||||
|
Se você é um desenvolvedor de software, aqui está uma [Carta Aberta aos Desenvolvedores](docs/contributor_open_letter.md). Seja bem-vindo a participar!
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Ecossistema do Produto 👬
|
||||||
|
Xiaozhi é um ecossistema. Ao utilizar este produto, você também pode conferir outros [projetos excelentes](https://github.com/78/xiaozhi-esp32/blob/main/README_zh.md#%E7%9B%B8%E5%85%B3%E5%BC%80%E6%BA%90%E9%A1%B9%E7%9B%AE) neste ecossistema
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Lista de Plataformas/Componentes Suportados 📋
|
||||||
|
### LLM Modelos de Linguagem
|
||||||
|
|
||||||
|
| Método de Uso | Plataformas Suportadas | Plataformas Gratuitas |
|
||||||
|
|:---:|:---:|:---:|
|
||||||
|
| Chamadas via interface OpenAI | Alibaba Bailian, Volcano Engine, DeepSeek, Zhipu, Gemini, iFLYTEK | Zhipu, Gemini |
|
||||||
|
| Chamadas via interface Ollama | Ollama | - |
|
||||||
|
| Chamadas via interface Dify | Dify | - |
|
||||||
|
| Chamadas via interface FastGPT | FastGPT | - |
|
||||||
|
| Chamadas via interface Coze | Coze | - |
|
||||||
|
| Chamadas via interface Xinference | Xinference | - |
|
||||||
|
| Chamadas via interface HomeAssistant | HomeAssistant | - |
|
||||||
|
|
||||||
|
Na verdade, qualquer LLM que suporte chamadas via interface openai pode ser integrado e utilizado.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### VLLM Modelos de Visão
|
||||||
|
|
||||||
|
| Método de Uso | Plataformas Suportadas | Plataformas Gratuitas |
|
||||||
|
|:---:|:---:|:---:|
|
||||||
|
| Chamadas via interface OpenAI | Alibaba Bailian, Zhipu ChatGLMVLLM | Zhipu ChatGLMVLLM |
|
||||||
|
|
||||||
|
Na verdade, qualquer VLLM que suporte chamadas via interface OpenAI pode ser integrado e utilizado.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### TTS Síntese de Voz
|
||||||
|
|
||||||
|
| Método de Uso | Plataformas Suportadas | Plataformas Gratuitas |
|
||||||
|
|:---:|:---:|:---:|
|
||||||
|
| Chamadas via interface | EdgeTTS, iFLYTEK, Volcano Engine, Tencent Cloud, Alibaba Cloud e Bailian, CosyVoiceSiliconflow, TTS302AI, CozeCnTTS, GizwitsTTS, ACGNTTS, OpenAITTS, Lingxi Streaming TTS, MinimaxTTS | Lingxi Streaming TTS, EdgeTTS, CosyVoiceSiliconflow(parcial) |
|
||||||
|
| Serviços locais | FishSpeech, GPT_SOVITS_V2, GPT_SOVITS_V3, Index-TTS, PaddleSpeech | Index-TTS, PaddleSpeech, FishSpeech, GPT_SOVITS_V2, GPT_SOVITS_V3 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### VAD Detecção de Atividade Vocal
|
||||||
|
|
||||||
|
| Tipo | Nome da Plataforma | Método de Uso | Modelo de Preço | Observações |
|
||||||
|
|:---:|:---------:|:----:|:----:|:--:|
|
||||||
|
| VAD | SileroVAD | Uso local | Gratuito | |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### ASR Reconhecimento de Fala
|
||||||
|
|
||||||
|
| Método de Uso | Plataformas Suportadas | Plataformas Gratuitas |
|
||||||
|
|:---:|:---:|:---:|
|
||||||
|
| Uso local | FunASR, SherpaASR | FunASR, SherpaASR |
|
||||||
|
| Chamadas via interface | FunASRServer, Volcano Engine, iFLYTEK, Tencent Cloud, Alibaba Cloud, Baidu Cloud, OpenAI ASR | FunASRServer |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Reconhecimento de Impressão Vocal
|
||||||
|
|
||||||
|
| Método de Uso | Plataformas Suportadas | Plataformas Gratuitas |
|
||||||
|
|:---:|:---:|:---:|
|
||||||
|
| Uso local | 3D-Speaker | 3D-Speaker |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Armazenamento de Memória
|
||||||
|
|
||||||
|
| Tipo | Nome da Plataforma | Método de Uso | Modelo de Preço | Observações |
|
||||||
|
|:------:|:---------------:|:----:|:---------:|:--:|
|
||||||
|
| Memória | mem0ai | Chamadas via interface | Cota de 1000 vezes/mês | |
|
||||||
|
| Memória | [powermem](./docs/powermem-integration.md) | Resumo local | Depende do LLM e BD | OceanBase de código aberto, suporta busca inteligente |
|
||||||
|
| Memória | mem_local_short | Resumo local | Gratuito | |
|
||||||
|
| Memória | nomem | Modo sem memória | Gratuito | |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Reconhecimento de Intenção
|
||||||
|
|
||||||
|
| Tipo | Nome da Plataforma | Método de Uso | Modelo de Preço | Observações |
|
||||||
|
|:------:|:-------------:|:----:|:-------:|:---------------------:|
|
||||||
|
| Intenção | intent_llm | Chamadas via interface | Baseado no preço do LLM | Reconhece intenção através de modelos de linguagem, forte generalização |
|
||||||
|
| Intenção | function_call | Chamadas via interface | Baseado no preço do LLM | Completa a intenção através de chamada de função do modelo de linguagem, velocidade rápida, bom resultado |
|
||||||
|
| Intenção | nointent | Modo sem intenção | Gratuito | Não realiza reconhecimento de intenção, retorna diretamente o resultado do diálogo |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### RAG Geração Aumentada por Recuperação
|
||||||
|
|
||||||
|
| Tipo | Nome da Plataforma | Método de Uso | Modelo de Preço | Observações |
|
||||||
|
|:------:|:-------------:|:----:|:-------:|:---------------------:|
|
||||||
|
| RAG | ragflow | Chamadas via interface | Cobrado com base nos tokens consumidos para fatiamento e segmentação de palavras | Utiliza o recurso de geração aumentada por recuperação do RagFlow para fornecer respostas de diálogo mais precisas |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Agradecimentos 🙏
|
||||||
|
|
||||||
|
| Logo | Projeto/Empresa | Descrição |
|
||||||
|
|:---:|:---:|:---|
|
||||||
|
| <img src="./docs/images/logo_bailing.png" width="160"> | [Robô de Diálogo por Voz Bailing](https://github.com/wwbin2017/bailing) | Este projeto foi inspirado pelo [Robô de Diálogo por Voz Bailing](https://github.com/wwbin2017/bailing) e implementado com base nele |
|
||||||
|
| <img src="./docs/images/logo_tenclass.png" width="160"> | [Tenclass](https://www.tenclass.com/) | Agradecimentos à [Tenclass](https://www.tenclass.com/) por formular protocolos de comunicação padrão, soluções de compatibilidade multidispositivo e demonstrações práticas de cenários de alta concorrência para o ecossistema Xiaozhi; fornecendo suporte completo de documentação técnica para este projeto |
|
||||||
|
| <img src="./docs/images/logo_xuanfeng.png" width="160"> | [Xuanfeng Technology (玄凤科技)](https://github.com/Eric0308) | Agradecimentos à [Xuanfeng Technology](https://github.com/Eric0308) por contribuir com o framework de chamada de função, protocolo de comunicação MCP e implementação do mecanismo de chamada baseado em plugins. Através de um sistema padronizado de agendamento de instruções e capacidades de expansão dinâmica, melhora significativamente a eficiência de interação e extensibilidade funcional dos dispositivos de frontend (IoT) |
|
||||||
|
| <img src="./docs/images/logo_junsen.png" width="160"> | [huangjunsen](https://github.com/huangjunsen0406) | Agradecimentos a [huangjunsen](https://github.com/huangjunsen0406) por contribuir com o módulo `Console de Controle Inteligente Mobile`, que permite controle eficiente e interação em tempo real em dispositivos móveis, melhorando significativamente a conveniência operacional e a eficiência de gerenciamento do sistema em cenários móveis. |
|
||||||
|
| <img src="./docs/images/logo_huiyuan.png" width="160"> | [Huiyuan Design (汇远设计)](http://ui.kwd988.net/) | Agradecimentos à [Huiyuan Design](http://ui.kwd988.net/) por fornecer soluções visuais profissionais para este projeto, utilizando sua experiência prática de design atendendo mais de mil empresas para potencializar a experiência do usuário deste produto |
|
||||||
|
| <img src="./docs/images/logo_qinren.png" width="160"> | [Xi'an Qinren Information Technology (西安勤人信息科技)](https://www.029app.com/) | Agradecimentos à [Xi'an Qinren Information Technology](https://www.029app.com/) por aprofundar o sistema visual deste projeto, garantindo consistência e extensibilidade do estilo de design geral em aplicações de múltiplos cenários |
|
||||||
|
| <img src="./docs/images/logo_contributors.png" width="160"> | [Contribuidores de Código](https://github.com/xinnan-tech/xiaozhi-esp32-server/graphs/contributors) | Agradecimentos a [todos os contribuidores de código](https://github.com/xinnan-tech/xiaozhi-esp32-server/graphs/contributors), seus esforços tornaram o projeto mais robusto e poderoso. |
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://star-history.com/#xinnan-tech/xiaozhi-esp32-server&Date">
|
||||||
|
|
||||||
|
<picture>
|
||||||
|
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=xinnan-tech/xiaozhi-esp32-server&type=Date&theme=dark" />
|
||||||
|
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=xinnan-tech/xiaozhi-esp32-server&type=Date" />
|
||||||
|
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=xinnan-tech/xiaozhi-esp32-server&type=Date" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
+377
@@ -0,0 +1,377 @@
|
|||||||
|
[](https://github.com/xinnan-tech/xiaozhi-esp32-server)
|
||||||
|
|
||||||
|
<h1 align="center">Dịch vụ Backend Xiaozhi xiaozhi-esp32-server</h1>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
Dự án này dựa trên lý thuyết và công nghệ trí tuệ cộng sinh người-máy để phát triển hệ thống phần mềm và phần cứng thiết bị đầu cuối thông minh<br/>Cung cấp dịch vụ backend cho dự án phần cứng thông minh mã nguồn mở
|
||||||
|
<a href="https://github.com/78/xiaozhi-esp32">xiaozhi-esp32</a><br/>
|
||||||
|
Được triển khai bằng Python, Java, Vue theo <a href="https://ccnphfhqs21z.feishu.cn/wiki/M0XiwldO9iJwHikpXD5cEx71nKh">giao thức truyền thông Xiaozhi</a><br/>
|
||||||
|
Hỗ trợ giao thức MQTT+UDP, giao thức Websocket, điểm truy cập MCP, nhận dạng giọng nói và kho tri thức
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="./docs/FAQ.md">Câu hỏi thường gặp</a>
|
||||||
|
· <a href="https://github.com/xinnan-tech/xiaozhi-esp32-server/issues">Báo cáo vấn đề</a>
|
||||||
|
· <a href="./README.md#%E9%83%A8%E7%BD%B2%E6%96%87%E6%A1%A3">Tài liệu triển khai</a>
|
||||||
|
· <a href="https://github.com/xinnan-tech/xiaozhi-esp32-server/releases">Nhật ký cập nhật</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="./README.md"><img alt="简体中文版自述文件" src="https://img.shields.io/badge/简体中文-DFE0E5"></a>
|
||||||
|
<a href="./README_en.md"><img alt="README in English" src="https://img.shields.io/badge/English-DFE0E5"></a>
|
||||||
|
<a href="./README_vi.md"><img alt="Tiếng Việt" src="https://img.shields.io/badge/Tiếng Việt-DBEDFA"></a>
|
||||||
|
<a href="./README_de.md"><img alt="Deutsch" src="https://img.shields.io/badge/Deutsch-DFE0E5"></a>
|
||||||
|
<a href="./README_pt_BR.md"><img alt="Português (Brasil)" src="https://img.shields.io/badge/Português (Brasil)-DFE0E5"></a>
|
||||||
|
<a href="https://github.com/xinnan-tech/xiaozhi-esp32-server/releases">
|
||||||
|
<img alt="GitHub Contributors" src="https://img.shields.io/github/v/release/xinnan-tech/xiaozhi-esp32-server?logo=docker" />
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/xinnan-tech/xiaozhi-esp32-server/blob/main/LICENSE">
|
||||||
|
<img alt="GitHub pull requests" src="https://img.shields.io/badge/license-MIT-white?labelColor=black" />
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/xinnan-tech/xiaozhi-esp32-server">
|
||||||
|
<img alt="stars" src="https://img.shields.io/github/stars/xinnan-tech/xiaozhi-esp32-server?color=ffcb47&labelColor=black" />
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
Spearheaded by Professor Siyuan Liu's Team (South China University of Technology)
|
||||||
|
</br>
|
||||||
|
Được dẫn dắt bởi nhóm Giáo sư Lưu Tư Nguyên (Đại học Bách khoa Nam Trung Quốc)
|
||||||
|
</br>
|
||||||
|
<img src="./docs/images/hnlg.jpg" alt="华南理工大学" width="50%">
|
||||||
|
</p>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Người dùng phù hợp 👥
|
||||||
|
|
||||||
|
Dự án này cần được sử dụng cùng với thiết bị phần cứng ESP32. Nếu bạn đã mua phần cứng liên quan đến ESP32, đã thành công kết nối với dịch vụ backend do anh Xia triển khai, và muốn xây dựng dịch vụ backend `xiaozhi-esp32` riêng của mình, thì dự án này rất phù hợp với bạn.
|
||||||
|
|
||||||
|
Muốn xem hiệu quả sử dụng? Hãy xem video 🎥
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1FMFyejExX" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="响应速度感受" src="docs/images/demo9.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1vchQzaEse" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="速度优化秘诀" src="docs/images/demo6.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1C1tCzUEZh" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="复杂医疗场景" src="docs/images/demo1.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1zUW5zJEkq" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="MQTT指令下发" src="docs/images/demo4.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1Exu3zqEDe" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="声纹识别" src="docs/images/demo14.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1pNXWYGEx1" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="控制家电开关" src="docs/images/demo5.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1ZQKUzYExM" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="MCP接入点" src="docs/images/demo13.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1TJ7WzzEo6" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="多指令任务" src="docs/images/demo11.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1VC96Y5EMH" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="播放音乐" src="docs/images/demo7.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1Z8XuYZEAS" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="天气插件" src="docs/images/demo8.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV12J7WzBEaH" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="实时打断" src="docs/images/demo10.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1Co76z7EvK" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="拍照识物品" src="docs/images/demo12.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV1CDKWemEU6" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="自定义音色" src="docs/images/demo2.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV12yA2egEaC" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="使用粤语交流" src="docs/images/demo3.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.bilibili.com/video/BV17LXWYvENb" target="_blank">
|
||||||
|
<picture>
|
||||||
|
<img alt="播报新闻" src="docs/images/demo0.png" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Cảnh báo ⚠️
|
||||||
|
|
||||||
|
1. Dự án này là phần mềm mã nguồn mở, phần mềm này không có quan hệ hợp tác thương mại với bất kỳ nhà cung cấp dịch vụ API bên thứ ba nào (bao gồm nhưng không giới hạn ở các nền tảng nhận dạng giọng nói, mô hình lớn, tổng hợp giọng nói, v.v.), và không đảm bảo chất lượng dịch vụ cũng như an toàn tài chính của họ.
|
||||||
|
Khuyến nghị người dùng ưu tiên lựa chọn nhà cung cấp dịch vụ có giấy phép kinh doanh liên quan và đọc kỹ thỏa thuận dịch vụ và chính sách bảo mật của họ. Phần mềm này không lưu trữ bất kỳ khóa tài khoản nào, không tham gia vào luồng tiền và không chịu rủi ro mất tiền nạp.
|
||||||
|
|
||||||
|
2. Chức năng của dự án này chưa hoàn thiện và chưa qua đánh giá bảo mật mạng, vui lòng không sử dụng trong môi trường sản xuất. Nếu bạn triển khai dự án này trong môi trường mạng công cộng để học tập, vui lòng thực hiện các biện pháp bảo vệ cần thiết.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Tài liệu triển khai
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Dự án này cung cấp hai phương pháp triển khai, vui lòng chọn theo nhu cầu cụ thể của bạn:
|
||||||
|
|
||||||
|
#### 🚀 Lựa chọn phương pháp triển khai
|
||||||
|
| Phương pháp triển khai | Đặc điểm | Tình huống áp dụng | Tài liệu triển khai | Yêu cầu cấu hình | Video hướng dẫn |
|
||||||
|
|---------|------|---------|---------|---------|---------|
|
||||||
|
| **Cài đặt tối giản** | Đối thoại thông minh, quản lý đơn tác nhân | Môi trường cấu hình thấp, dữ liệu lưu trong tệp cấu hình, không cần cơ sở dữ liệu | [①Phiên bản Docker](./docs/Deployment.md#%E6%96%B9%E5%BC%8F%E4%B8%80docker%E5%8F%AA%E8%BF%90%E8%A1%8Cserver) / [②Triển khai mã nguồn](./docs/Deployment.md#%E6%96%B9%E5%BC%8F%E4%BA%8C%E6%9C%AC%E5%9C%B0%E6%BA%90%E7%A0%81%E5%8F%AA%E8%BF%90%E8%A1%8Cserver)| 2 nhân 4GB nếu dùng `FunASR`, 2 nhân 2GB nếu toàn API | - |
|
||||||
|
| **Cài đặt toàn bộ module** | Đối thoại thông minh, quản lý đa người dùng, quản lý đa tác nhân, bảng điều khiển thông minh | Trải nghiệm đầy đủ tính năng, dữ liệu lưu trong cơ sở dữ liệu |[①Phiên bản Docker](./docs/Deployment_all.md#%E6%96%B9%E5%BC%8F%E4%B8%80docker%E8%BF%90%E8%A1%8C%E5%85%A8%E6%A8%A1%E5%9D%97) / [②Triển khai mã nguồn](./docs/Deployment_all.md#%E6%96%B9%E5%BC%8F%E4%BA%8C%E6%9C%AC%E5%9C%B0%E6%BA%90%E7%A0%81%E8%BF%90%E8%A1%8C%E5%85%A8%E6%A8%A1%E5%9D%97) / [③Hướng dẫn tự động cập nhật triển khai mã nguồn](./docs/dev-ops-integration.md) | 4 nhân 8GB nếu dùng `FunASR`, 2 nhân 4GB nếu toàn API| [Video hướng dẫn khởi động mã nguồn cục bộ](https://www.bilibili.com/video/BV1wBJhz4Ewe) |
|
||||||
|
|
||||||
|
Câu hỏi thường gặp và hướng dẫn liên quan, vui lòng tham khảo [liên kết này](./docs/FAQ.md)
|
||||||
|
|
||||||
|
> 💡 Gợi ý: Dưới đây là nền tảng thử nghiệm được triển khai theo mã mới nhất, có thể flash để thử nghiệm nếu cần, đồng thời là 6, dữ liệu sẽ được xóa mỗi ngày,
|
||||||
|
|
||||||
|
```
|
||||||
|
Địa chỉ bảng điều khiển thông minh: https://2662r3426b.vicp.fun
|
||||||
|
Bảng điều khiển thông minh (phiên bản h5): https://2662r3426b.vicp.fun/h5/index.html
|
||||||
|
|
||||||
|
Công cụ kiểm tra dịch vụ: https://2662r3426b.vicp.fun/test/
|
||||||
|
Địa chỉ giao diện OTA: https://2662r3426b.vicp.fun/xiaozhi/ota/
|
||||||
|
Địa chỉ giao diện Websocket: wss://2662r3426b.vicp.fun/xiaozhi/v1/
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 🚩 Mô tả và khuyến nghị cấu hình
|
||||||
|
> [!Note]
|
||||||
|
> Dự án này cung cấp hai phương án cấu hình:
|
||||||
|
>
|
||||||
|
> 1. Cấu hình `Miễn phí hoàn toàn cho người mới`: Phù hợp với sử dụng gia đình cá nhân, tất cả các thành phần đều sử dụng phương án miễn phí, không cần thanh toán thêm.
|
||||||
|
>
|
||||||
|
> 2. `Cấu hình streaming`: Phù hợp với demo, đào tạo, hơn 2 đồng thời, v.v., sử dụng công nghệ xử lý streaming, tốc độ phản hồi nhanh hơn, trải nghiệm tốt hơn.
|
||||||
|
>
|
||||||
|
> Từ phiên bản `0.5.2`, dự án hỗ trợ cấu hình streaming, so với phiên bản đầu, tốc độ phản hồi cải thiện khoảng `2.5 giây`, cải thiện đáng kể trải nghiệm người dùng.
|
||||||
|
|
||||||
|
| Tên module | Cài đặt miễn phí cho người mới | Cấu hình streaming |
|
||||||
|
|:---:|:---:|:---:|
|
||||||
|
| ASR(Nhận dạng giọng nói) | FunASR(Local) | 👍XunfeiStreamASR(Xunfei Streaming) |
|
||||||
|
| LLM(Mô hình lớn) | glm-4-flash(Zhipu) | 👍qwen-flash(Alibaba Bailian) |
|
||||||
|
| VLLM(Mô hình lớn thị giác) | glm-4v-flash(Zhipu) | 👍qwen2.5-vl-3b-instructh(Alibaba Bailian) |
|
||||||
|
| TTS(Tổng hợp giọng nói) | ✅LinkeraiTTS(Lingxi streaming) | 👍HuoshanDoubleStreamTTS(Volcano Streaming) |
|
||||||
|
| Intent(Nhận dạng ý định) | function_call(Gọi hàm) | function_call(Gọi hàm) |
|
||||||
|
| Memory(Chức năng bộ nhớ) | mem_local_short(Bộ nhớ ngắn hạn cục bộ) | mem_local_short(Bộ nhớ ngắn hạn cục bộ) |
|
||||||
|
|
||||||
|
Nếu bạn quan tâm đến thời gian của từng thành phần, vui lòng xem [Báo cáo kiểm tra hiệu suất các thành phần Xiaozhi](https://github.com/xinnan-tech/xiaozhi-performance-research), có thể kiểm tra thực tế trong môi trường của bạn theo phương pháp kiểm tra trong báo cáo.
|
||||||
|
|
||||||
|
#### 🔧 Công cụ kiểm tra
|
||||||
|
Dự án này cung cấp các công cụ kiểm tra sau để giúp bạn xác minh hệ thống và chọn mô hình phù hợp:
|
||||||
|
|
||||||
|
| Tên công cụ | Vị trí | Phương pháp sử dụng | Mô tả chức năng |
|
||||||
|
|:---:|:---|:---:|:---:|
|
||||||
|
| Công cụ kiểm tra tương tác âm thanh | main》xiaozhi-server》test》test_page.html | Mở trực tiếp bằng trình duyệt Google Chrome | Kiểm tra chức năng phát và nhận âm thanh, xác minh xử lý âm thanh phía Python có bình thường không |
|
||||||
|
| Công cụ kiểm tra phản hồi mô hình | main》xiaozhi-server》performance_tester.py | Thực hiện `python performance_tester.py` | Kiểm tra tốc độ phản hồi của ba module cốt lõi ASR(Nhận dạng giọng nói), LLM(Mô hình lớn), VLLM(Mô hình thị giác), TTS(Tổng hợp giọng nói) |
|
||||||
|
|
||||||
|
> 💡 Gợi ý: Khi kiểm tra tốc độ mô hình, chỉ kiểm tra các mô hình đã cấu hình khóa.
|
||||||
|
|
||||||
|
---
|
||||||
|
## Danh sách tính năng ✨
|
||||||
|
### Đã thực hiện ✅
|
||||||
|

|
||||||
|
| Module chức năng | Mô tả |
|
||||||
|
|:---:|:---|
|
||||||
|
| Kiến trúc cốt lõi | Dựa trên [cổng MQTT+UDP](https://github.com/xinnan-tech/xiaozhi-esp32-server/blob/main/docs/mqtt-gateway-integration.md), WebSocket, máy chủ HTTP, cung cấp hệ thống quản lý bảng điều khiển và xác thực hoàn chỉnh |
|
||||||
|
| Tương tác giọng nói | Hỗ trợ ASR streaming(Nhận dạng giọng nói), TTS streaming(Tổng hợp giọng nói), VAD(Phát hiện hoạt động giọng nói), hỗ trợ nhận dạng đa ngôn ngữ và xử lý giọng nói |
|
||||||
|
| Nhận dạng vân giọng | Hỗ trợ đăng ký, quản lý và nhận dạng vân giọng đa người dùng, xử lý song song với ASR, nhận dạng danh tính người nói theo thời gian thực và truyền cho LLM để phản hồi cá nhân hóa |
|
||||||
|
| Đối thoại thông minh | Hỗ trợ nhiều LLM(Mô hình ngôn ngữ lớn), thực hiện đối thoại thông minh |
|
||||||
|
| Cảm nhận thị giác | Hỗ trợ nhiều VLLM(Mô hình lớn thị giác), thực hiện tương tác đa phương thức |
|
||||||
|
| Nhận dạng ý định | Hỗ trợ nhận dạng ý định mô hình lớn gắn ngoài, gọi hàm tự chủ mô hình lớn, cung cấp cơ chế xử lý ý định dạng plugin |
|
||||||
|
| Hệ thống bộ nhớ | Hỗ trợ bộ nhớ ngắn hạn cục bộ, bộ nhớ giao diện mem0ai, bộ nhớ thông minh PowerMem, có chức năng tóm tắt bộ nhớ |
|
||||||
|
| Kho tri thức | Hỗ trợ kho tri thức RAGFlow, cho phép mô hình lớn đánh giá cần gọi kho tri thức trước khi trả lời |
|
||||||
|
| Gọi công cụ | Hỗ trợ giao thức IOT phía client, giao thức MCP phía client, giao thức MCP phía server, giao thức điểm truy cập MCP, hàm công cụ tùy chỉnh |
|
||||||
|
| Gửi lệnh | Dựa vào giao thức MQTT, hỗ trợ gửi lệnh MCP từ bảng điều khiển thông minh xuống thiết bị ESP32 |
|
||||||
|
| Backend quản lý | Cung cấp giao diện quản lý Web, hỗ trợ quản lý người dùng, cấu hình hệ thống và quản lý thiết bị; giao diện hỗ trợ hiển thị tiếng Trung giản thể, tiếng Trung phồn thể, tiếng Anh |
|
||||||
|
| Công cụ kiểm tra | Cung cấp công cụ kiểm tra hiệu suất, công cụ kiểm tra mô hình thị giác và công cụ kiểm tra tương tác âm thanh |
|
||||||
|
| Hỗ trợ triển khai | Hỗ trợ triển khai Docker và triển khai cục bộ, cung cấp quản lý tệp cấu hình hoàn chỉnh |
|
||||||
|
| Hệ thống plugin | Hỗ trợ mở rộng plugin chức năng, phát triển plugin tùy chỉnh và hot loading plugin |
|
||||||
|
|
||||||
|
### Đang phát triển 🚧
|
||||||
|
|
||||||
|
Muốn hiểu tiến độ kế hoạch phát triển cụ thể, [vui lòng nhấp vào đây](https://github.com/users/xinnan-tech/projects/3). Câu hỏi thường gặp và hướng dẫn liên quan, vui lòng tham khảo [liên kết này](./docs/FAQ.md)
|
||||||
|
|
||||||
|
Nếu bạn là một nhà phát triển phần mềm, đây có một [Lá thư mở gửi các nhà phát triển](docs/contributor_open_letter.md), chào mừng tham gia!
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Hệ sinh thái sản phẩm 👬
|
||||||
|
Xiaozhi là một hệ sinh thái, khi bạn sử dụng sản phẩm này, bạn cũng có thể xem các [dự án xuất sắc](https://github.com/78/xiaozhi-esp32/blob/main/README_zh.md#%E7%9B%B8%E5%85%B3%E5%BC%80%E6%BA%90%E9%A1%B9%E7%9B%AE) khác trong hệ sinh thái này
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Danh sách nền tảng/thành phần được dự án này hỗ trợ 📋
|
||||||
|
### LLM Mô hình ngôn ngữ
|
||||||
|
|
||||||
|
| Phương pháp sử dụng | Nền tảng hỗ trợ | Nền tảng miễn phí |
|
||||||
|
|:---:|:---:|:---:|
|
||||||
|
| Gọi giao diện openai | Alibaba Bailian, Volcano Engine, DeepSeek, Zhipu, Gemini, iFlytek | Zhipu, Gemini |
|
||||||
|
| Gọi giao diện ollama | Ollama | - |
|
||||||
|
| Gọi giao diện dify | Dify | - |
|
||||||
|
| Gọi giao diện fastgpt | Fastgpt | - |
|
||||||
|
| Gọi giao diện coze | Coze | - |
|
||||||
|
| Gọi giao diện xinference | Xinference | - |
|
||||||
|
| Gọi giao diện homeassistant | HomeAssistant | - |
|
||||||
|
|
||||||
|
Trên thực tế, bất kỳ LLM nào hỗ trợ gọi giao diện openai đều có thể truy cập sử dụng.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### VLLM Mô hình thị giác
|
||||||
|
|
||||||
|
| Phương pháp sử dụng | Nền tảng hỗ trợ | Nền tảng miễn phí |
|
||||||
|
|:---:|:---:|:---:|
|
||||||
|
| Gọi giao diện openai | Alibaba Bailian, Zhipu ChatGLMVLLM | Zhipu ChatGLMVLLM |
|
||||||
|
|
||||||
|
Trên thực tế, bất kỳ VLLM nào hỗ trợ gọi giao diện openai đều có thể truy cập sử dụng.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### TTS Tổng hợp giọng nói
|
||||||
|
|
||||||
|
| Phương pháp sử dụng | Nền tảng hỗ trợ | Nền tảng miễn phí |
|
||||||
|
|:---:|:---:|:---:|
|
||||||
|
| Gọi giao diện | EdgeTTS, iFlytek, Volcano Engine, Tencent Cloud, Alibaba Cloud và Bailian, CosyVoiceSiliconflow, TTS302AI, CozeCnTTS, GizwitsTTS, ACGNTTS, OpenAITTS, Lingxi streaming TTS, MinimaxTTS | Lingxi streaming TTS, EdgeTTS, CosyVoiceSiliconflow(một phần) |
|
||||||
|
| Dịch vụ cục bộ | FishSpeech, GPT_SOVITS_V2, GPT_SOVITS_V3, Index-TTS, PaddleSpeech | Index-TTS, PaddleSpeech, FishSpeech, GPT_SOVITS_V2, GPT_SOVITS_V3 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### VAD Phát hiện hoạt động giọng nói
|
||||||
|
|
||||||
|
| Loại | Tên nền tảng | Phương pháp sử dụng | Mô hình thu phí | Ghi chú |
|
||||||
|
|:---:|:---------:|:----:|:----:|:--:|
|
||||||
|
| VAD | SileroVAD | Sử dụng cục bộ | Miễn phí | |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### ASR Nhận dạng giọng nói
|
||||||
|
|
||||||
|
| Phương pháp sử dụng | Nền tảng hỗ trợ | Nền tảng miễn phí |
|
||||||
|
|:---:|:---:|:---:|
|
||||||
|
| Sử dụng cục bộ | FunASR, SherpaASR | FunASR, SherpaASR |
|
||||||
|
| Gọi giao diện | FunASRServer, Volcano Engine, iFlytek, Tencent Cloud, Alibaba Cloud, Baidu Cloud, OpenAI ASR | FunASRServer |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Voiceprint Nhận dạng vân giọng
|
||||||
|
|
||||||
|
| Phương pháp sử dụng | Nền tảng hỗ trợ | Nền tảng miễn phí |
|
||||||
|
|:---:|:---:|:---:|
|
||||||
|
| Sử dụng cục bộ | 3D-Speaker | 3D-Speaker |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Memory Lưu trữ bộ nhớ
|
||||||
|
|
||||||
|
| Loại | Tên nền tảng | Phương pháp sử dụng | Mô hình thu phí | Ghi chú |
|
||||||
|
|:------:|:---------------:|:----:|:---------:|:--:|
|
||||||
|
| Memory | mem0ai | Gọi giao diện | Hạn mức 1000 lần/tháng | |
|
||||||
|
| Memory | [powermem](./docs/powermem-integration.md) | Tóm tắt cục bộ | Phụ thuộc vào LLM và DB | OceanBase mã nguồn mở, hỗ trợ tìm kiếm thông minh |
|
||||||
|
| Memory | mem_local_short | Tóm tắt cục bộ | Miễn phí | |
|
||||||
|
| Memory | nomem | Chế độ không có bộ nhớ | Miễn phí | |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Intent Nhận dạng ý định
|
||||||
|
|
||||||
|
| Loại | Tên nền tảng | Phương pháp sử dụng | Mô hình thu phí | Ghi chú |
|
||||||
|
|:------:|:-------------:|:----:|:-------:|:---------------------:|
|
||||||
|
| Intent | intent_llm | Gọi giao diện | Thu phí theo LLM | Nhận dạng ý định qua mô hình lớn, tính tổng quát mạnh |
|
||||||
|
| Intent | function_call | Gọi giao diện | Thu phí theo LLM | Hoàn thành ý định qua gọi hàm mô hình lớn, tốc độ nhanh, hiệu quả tốt |
|
||||||
|
| Intent | nointent | Chế độ không có ý định | Miễn phí | Không thực hiện nhận dạng ý định, trả về trực tiếp kết quả đối thoại |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Rag Tăng cường truy xuất thông tin
|
||||||
|
|
||||||
|
| Loại | Tên nền tảng | Phương pháp sử dụng | Mô hình thu phí | Ghi chú |
|
||||||
|
|:------:|:-------------:|:----:|:-------:|:---------------------:|
|
||||||
|
| Rag | ragflow | Gọi giao diện | Thu phí theo token tiêu tốn của phân đoạn, phân từ | Sử dụng chức năng tăng cường truy xuất của RagFlow, cung cấp phản hồi đối thoại chính xác hơn |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Lời cảm ơn 🙏
|
||||||
|
|
||||||
|
| Logo | Dự án/Công ty | Mô tả |
|
||||||
|
|:---:|:---:|:---|
|
||||||
|
| <img src="./docs/images/logo_bailing.png" width="160"> | [Robot đối thoại giọng nói Bailing](https://github.com/wwbin2017/bailing) | Dự án này được lấy cảm hứng từ [Robot đối thoại giọng nói Bailing](https://github.com/wwbin2017/bailing) và được triển khai trên cơ sở đó |
|
||||||
|
| <img src="./docs/images/logo_tenclass.png" width="160"> | [Shifang Ronghai](https://www.tenclass.com/) | Cảm ơn [Shifang Ronghai](https://www.tenclass.com/) đã xây dựng giao thức truyền thông tiêu chuẩn, phương án tương thích đa thiết bị và mô phạm thực hành tình huống đồng thời cao cho hệ sinh thái Xiaozhi; cung cấp tài liệu hỗ trợ kỹ thuật toàn diện cho dự án này |
|
||||||
|
| <img src="./docs/images/logo_xuanfeng.png" width="160"> | [Xuanfeng Technology](https://github.com/Eric0308) | Cảm ơn [Xuanfeng Technology](https://github.com/Eric0308) đã đóng góp khung gọi hàm, giao thức truyền thông MCP và mã triển khai cơ chế gọi dạng plugin, thông qua hệ thống điều phối lệnh tiêu chuẩn hóa và khả năng mở rộng động, đã cải thiện đáng kể hiệu suất tương tác và khả năng mở rộng chức năng của thiết bị front-end(IoT) |
|
||||||
|
| <img src="./docs/images/logo_junsen.png" width="160"> | [huangjunsen](https://github.com/huangjunsen0406) | Cảm ơn [huangjunsen](https://github.com/huangjunsen0406) đã đóng góp module `Bảng điều khiển thông minh di động`, thực hiện điều khiển hiệu quả và tương tác thời gian thực trên thiết bị di động đa nền tảng, cải thiện đáng kể sự tiện lợi vận hành và hiệu quả quản lý của hệ thống trong tình huống di động |
|
||||||
|
| <img src="./docs/images/logo_huiyuan.png" width="160"> | [Huiyuan Design](http://ui.kwd988.net/) | Cảm ơn [Huiyuan Design](http://ui.kwd988.net/) đã cung cấp giải pháp thị giác chuyên nghiệp cho dự án này, sử dụng kinh nghiệm thực tế thiết kế phục vụ hơn nghìn doanh nghiệp, trao quyền cho trải nghiệm người dùng sản phẩm của dự án này |
|
||||||
|
| <img src="./docs/images/logo_qinren.png" width="160"> | [Xi'an Qinren Information Technology](https://www.029app.com/) | Cảm ơn [Xi'an Qinren Information Technology](https://www.029app.com/) đã làm sâu sắc hệ thống thị giác của dự án này, đảm bảo tính nhất quán và khả năng mở rộng của phong cách thiết kế tổng thể trong ứng dụng đa tình huống |
|
||||||
|
| <img src="./docs/images/logo_contributors.png" width="160"> | [Người đóng góp mã](https://github.com/xinnan-tech/xiaozhi-esp32-server/graphs/contributors) | Cảm ơn [tất cả người đóng góp mã](https://github.com/xinnan-tech/xiaozhi-esp32-server/graphs/contributors), sự cống hiến của bạn khiến dự án mạnh mẽ và vững chắc hơn. |
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://star-history.com/#xinnan-tech/xiaozhi-esp32-server&Date">
|
||||||
|
|
||||||
|
<picture>
|
||||||
|
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=xinnan-tech/xiaozhi-esp32-server&type=Date&theme=dark" />
|
||||||
|
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=xinnan-tech/xiaozhi-esp32-server&type=Date" />
|
||||||
|
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=xinnan-tech/xiaozhi-esp32-server&type=Date" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
@@ -1 +0,0 @@
|
|||||||
VITE_API_BASE_URL='http://127.0.0.1:8002'
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
VITE_API_BASE_URL='' # 空字符串表示使用当前域名和端口
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
# Logs
|
|
||||||
logs
|
|
||||||
*.log
|
|
||||||
npm-debug.log*
|
|
||||||
yarn-debug.log*
|
|
||||||
yarn-error.log*
|
|
||||||
pnpm-debug.log*
|
|
||||||
lerna-debug.log*
|
|
||||||
|
|
||||||
node_modules
|
|
||||||
dist
|
|
||||||
dist-ssr
|
|
||||||
*.local
|
|
||||||
|
|
||||||
# Editor directories and files
|
|
||||||
.vscode/*
|
|
||||||
!.vscode/extensions.json
|
|
||||||
.idea
|
|
||||||
.DS_Store
|
|
||||||
*.suo
|
|
||||||
*.ntvs*
|
|
||||||
*.njsproj
|
|
||||||
*.sln
|
|
||||||
*.sw?
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
# Vue 3 + Vite 项目配置文档
|
|
||||||
|
|
||||||
## 开发环境配置
|
|
||||||
|
|
||||||
### 使用 Poetry 配置开发环境
|
|
||||||
|
|
||||||
在项目根目录中执行以下命令安装 Python 依赖:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
poetry install
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 安装项目依赖
|
|
||||||
|
|
||||||
你可以选择以下任意一个包管理工具(`npm`、`yarn` 或 `pnpm`)来管理项目依赖。
|
|
||||||
|
|
||||||
### 通用命令
|
|
||||||
|
|
||||||
- `install`:安装项目依赖
|
|
||||||
- `dev`:同时启动前后端
|
|
||||||
- `dev:ui`:启动前端
|
|
||||||
- `dev:api`:启动后端
|
|
||||||
- `dev:d`:在 Docker 环境下同时启动前后端
|
|
||||||
- `build`:打包项目
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### 使用 npm
|
|
||||||
|
|
||||||
1. 安装依赖:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
npm install
|
|
||||||
```
|
|
||||||
|
|
||||||
2. 启动开发模式:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
npm run dev
|
|
||||||
```
|
|
||||||
|
|
||||||
3. 打包项目:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
npm run build
|
|
||||||
```
|
|
||||||
|
|
||||||
### 使用 yarn
|
|
||||||
|
|
||||||
1. 安装依赖:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
yarn install
|
|
||||||
```
|
|
||||||
|
|
||||||
2. 启动开发模式:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
yarn dev
|
|
||||||
```
|
|
||||||
|
|
||||||
3. 打包项目:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
yarn build
|
|
||||||
```
|
|
||||||
|
|
||||||
### 使用 pnpm
|
|
||||||
|
|
||||||
1. 安装依赖:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
pnpm install
|
|
||||||
```
|
|
||||||
|
|
||||||
2. 启动开发模式:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
pnpm run dev
|
|
||||||
```
|
|
||||||
|
|
||||||
3. 打包项目:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
pnpm run build
|
|
||||||
```
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html lang="en" style="height: 100%;">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8"/>
|
|
||||||
<link rel="icon" href="/favicon.ico"/>
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
|
||||||
<title>智控台</title>
|
|
||||||
<style>
|
|
||||||
html, body {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
#app {
|
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="app"></div>
|
|
||||||
<script type="module" src="/src/main.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
Generated
-1046
File diff suppressed because it is too large
Load Diff
@@ -1,24 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "zhikongtaiweb",
|
|
||||||
"private": true,
|
|
||||||
"version": "0.0.0",
|
|
||||||
"type": "module",
|
|
||||||
"scripts": {
|
|
||||||
"dev": "concurrently -n 'Frontend,Backend' -c 'blue,green' 'yarn run dev:ui' 'npm run dev:api'",
|
|
||||||
"dev:ui": "vite",
|
|
||||||
"dev:api": "cd .. && poetry run python app.py",
|
|
||||||
"dev:d": "docker exec xiaozhi-env poetry run python app.py",
|
|
||||||
"build": "vite build",
|
|
||||||
"preview": "vite preview"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"axios": "^1.7.9",
|
|
||||||
"vue": "^3.5.10",
|
|
||||||
"vue-router": "^4.0.0"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@vitejs/plugin-vue": "^5.1.4",
|
|
||||||
"concurrently": "^9.1.2",
|
|
||||||
"vite": "^5.4.8"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB |
@@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.5 KiB |
@@ -1,73 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div id="app">
|
|
||||||
<div class="app-content">
|
|
||||||
<router-view></router-view>
|
|
||||||
</div>
|
|
||||||
<Footer />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import Footer from './components/Footer.vue';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'App',
|
|
||||||
components: {
|
|
||||||
Footer
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
#app {
|
|
||||||
font-family: Avenir, Helvetica, Arial, sans-serif;
|
|
||||||
-webkit-font-smoothing: antialiased;
|
|
||||||
-moz-osx-font-smoothing: grayscale;
|
|
||||||
color: #2c3e50;
|
|
||||||
min-height: 100vh;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.app-content {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
min-height: 0; /* 允许内容区域收缩 */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 登录注册页面的布局 */
|
|
||||||
.auth-layout {
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 主要页面的布局 */
|
|
||||||
.main-layout {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
min-height: 0; /* 允许内容区域收缩 */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 添加全局滚动条样式 */
|
|
||||||
::-webkit-scrollbar {
|
|
||||||
width: 8px;
|
|
||||||
height: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
::-webkit-scrollbar-track {
|
|
||||||
background: #f1f1f1;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
::-webkit-scrollbar-thumb {
|
|
||||||
background: #ccc;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
::-webkit-scrollbar-thumb:hover {
|
|
||||||
background: #999;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 3.3 KiB |
@@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 496 B |
@@ -1,206 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="device-card">
|
|
||||||
<div class="device-header">
|
|
||||||
<h2 class="device-id">{{ deviceId }} <span class="note">[{{ deviceNote || '备注' }}]</span></h2>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="device-details">
|
|
||||||
<p class="device-type">设备型号:{{ deviceType }}</p>
|
|
||||||
<p class="device-role">角色昵称:{{ deviceRole }}</p>
|
|
||||||
<p class="device-modules">
|
|
||||||
当前模型:
|
|
||||||
<span class="module-item">LLM: {{ selectedModules?.LLM || '-' }}</span>
|
|
||||||
<span class="module-item">TTS: {{ selectedModules?.TTS || '-' }}</span>
|
|
||||||
</p>
|
|
||||||
<p class="last-activity">最近对话:{{ lastActivity }}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="device-actions">
|
|
||||||
<button class="action-btn primary" @click="handleConfigure">配置角色</button>
|
|
||||||
<button class="action-btn" @click="$emit('voiceprint')">声纹识别</button>
|
|
||||||
<button class="action-btn" @click="$emit('history')">历史对话</button>
|
|
||||||
<div class="delete-container">
|
|
||||||
<button class="action-btn danger" @click="handleDelete">
|
|
||||||
<i class="icon-delete"></i> 删除设备
|
|
||||||
</button>
|
|
||||||
<div class="delete-warning">删除后设备配置将不可恢复</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { ref, watch, computed } from 'vue';
|
|
||||||
import SwitchToggle from './SwitchToggle.vue';
|
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
deviceId: String,
|
|
||||||
deviceNote: String,
|
|
||||||
deviceType: {
|
|
||||||
type: String,
|
|
||||||
default: '未知型号(待实现)'
|
|
||||||
},
|
|
||||||
lastActivity: {
|
|
||||||
type: String,
|
|
||||||
default: '3 天前'
|
|
||||||
},
|
|
||||||
selectedModules: {
|
|
||||||
type: Object,
|
|
||||||
default: () => ({
|
|
||||||
LLM: '-',
|
|
||||||
TTS: '-',
|
|
||||||
ASR: '-',
|
|
||||||
VAD: '-'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
deviceConfig: {
|
|
||||||
type: Object,
|
|
||||||
default: () => ({})
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const deviceRole = computed(() => {
|
|
||||||
return props.deviceConfig?.nickname || '小智';
|
|
||||||
});
|
|
||||||
|
|
||||||
// Store device config when it changes
|
|
||||||
watch(() => props.selectedModules, (newValue) => {
|
|
||||||
if (props.deviceId) {
|
|
||||||
localStorage.setItem(`deviceConfig_${props.deviceId}`, JSON.stringify({
|
|
||||||
selected_module: newValue
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}, { deep: true });
|
|
||||||
|
|
||||||
const otaEnabled = ref(false);
|
|
||||||
|
|
||||||
const emit = defineEmits(['configure', 'voiceprint', 'history', 'delete']);
|
|
||||||
|
|
||||||
const handleDelete = () => {
|
|
||||||
if (confirm('确认要删除此设备吗?\n\n警告:删除后设备所有配置将不可恢复!')) {
|
|
||||||
emit('delete');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleConfigure = () => {
|
|
||||||
// 保存设备配置到 localStorage,确保 RoleSetting 可以访问
|
|
||||||
if (props.deviceId && props.deviceConfig) {
|
|
||||||
localStorage.setItem(`deviceConfig_${props.deviceId}`, JSON.stringify({
|
|
||||||
selected_module: props.selectedModules,
|
|
||||||
prompt: props.deviceConfig.prompt || '',
|
|
||||||
nickname: props.deviceConfig.nickname || '小智'
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
emit('configure');
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.device-card {
|
|
||||||
background: white;
|
|
||||||
border-radius: 4px;
|
|
||||||
padding: 20px;
|
|
||||||
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
|
||||||
margin-bottom: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.device-id {
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-bottom: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.note {
|
|
||||||
color: #4178EE;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
.device-details p {
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ota-upgrade {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
margin-left: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.device-actions {
|
|
||||||
display: flex;
|
|
||||||
margin-top: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.action-btn {
|
|
||||||
padding: 8px 16px;
|
|
||||||
margin-right: 12px;
|
|
||||||
border: 1px solid #ddd;
|
|
||||||
border-radius: 4px;
|
|
||||||
background: white;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.action-btn.primary {
|
|
||||||
background: #4178EE;
|
|
||||||
color: white;
|
|
||||||
border-color: #4178EE;
|
|
||||||
}
|
|
||||||
|
|
||||||
.action-btn.danger {
|
|
||||||
background: #fff3f3;
|
|
||||||
border-color: #ffa4a4;
|
|
||||||
color: #f56c6c;
|
|
||||||
}
|
|
||||||
|
|
||||||
.action-btn.danger:hover {
|
|
||||||
background: #fde2e2;
|
|
||||||
border-color: #f56c6c;
|
|
||||||
}
|
|
||||||
|
|
||||||
.device-modules {
|
|
||||||
margin-bottom: 12px;
|
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
|
|
||||||
.module-item {
|
|
||||||
display: inline-block;
|
|
||||||
margin-right: 16px;
|
|
||||||
padding: 4px 8px;
|
|
||||||
background: #f5f7fa;
|
|
||||||
border-radius: 4px;
|
|
||||||
font-size: 0.9em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.device-role {
|
|
||||||
color: #666;
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.delete-container {
|
|
||||||
position: relative;
|
|
||||||
margin-left: auto; /* Push delete button to the right */
|
|
||||||
}
|
|
||||||
|
|
||||||
.delete-warning {
|
|
||||||
position: absolute;
|
|
||||||
bottom: calc(100% + 5px); /* Position above the button */
|
|
||||||
left: 50%;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
white-space: nowrap;
|
|
||||||
background: #fff3f3;
|
|
||||||
padding: 4px 8px;
|
|
||||||
border-radius: 4px;
|
|
||||||
border: 1px solid #ffa4a4;
|
|
||||||
font-size: 12px;
|
|
||||||
color: #f56c6c;
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.delete-container:hover .delete-warning {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-delete {
|
|
||||||
margin-right: 4px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
<template>
|
|
||||||
<footer class="footer">
|
|
||||||
<div class="copyright">© 2025 小智 AI 管理后台</div>
|
|
||||||
</footer>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.footer {
|
|
||||||
text-align: center;
|
|
||||||
padding: 16px;
|
|
||||||
color: #666;
|
|
||||||
font-size: 12px;
|
|
||||||
background: #f0f2f5;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,149 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="login-container">
|
|
||||||
<h1>登录</h1>
|
|
||||||
<form @submit.prevent="handleLogin">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="username">用户名</label>
|
|
||||||
<input type="text" v-model="username" id="username" required />
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="password">密码</label>
|
|
||||||
<input type="password" v-model="password" id="password" required />
|
|
||||||
</div>
|
|
||||||
<button type="submit" :disabled="isLoading">登录</button>
|
|
||||||
</form>
|
|
||||||
<p>还没注册账户? <router-link to="/register">点击注册</router-link></p>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { ref } from 'vue';
|
|
||||||
import { useRouter } from 'vue-router';
|
|
||||||
import apiClient from '../utils/api';
|
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
const username = ref('');
|
|
||||||
const password = ref('');
|
|
||||||
const isLoading = ref(false);
|
|
||||||
|
|
||||||
const handleLogin = async () => {
|
|
||||||
if (!username.value || !password.value) {
|
|
||||||
alert('请输入用户名和密码!');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
isLoading.value = true;
|
|
||||||
try {
|
|
||||||
const response = await apiClient.post('/api/login', {
|
|
||||||
username: username.value,
|
|
||||||
password: password.value
|
|
||||||
});
|
|
||||||
|
|
||||||
const data = response.data;
|
|
||||||
|
|
||||||
if (data.success) {
|
|
||||||
localStorage.setItem('session_id', data.session_id);
|
|
||||||
localStorage.setItem('isLoggedIn', 'true');
|
|
||||||
router.push('/panel');
|
|
||||||
} else {
|
|
||||||
alert(data.message || '登录失败');
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Login error:', error);
|
|
||||||
alert('登录失败,请检查网络连接');
|
|
||||||
} finally {
|
|
||||||
isLoading.value = false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.login-container {
|
|
||||||
max-width: 420px;
|
|
||||||
margin: 20px auto;
|
|
||||||
padding: 40px 50px;
|
|
||||||
border: none;
|
|
||||||
border-radius: 12px;
|
|
||||||
background-color: #ffffff;
|
|
||||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
text-align: center;
|
|
||||||
color: #2c3e50;
|
|
||||||
font-size: 28px;
|
|
||||||
margin-bottom: 25px;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-group {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
label {
|
|
||||||
display: block;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #4a5568;
|
|
||||||
}
|
|
||||||
|
|
||||||
input {
|
|
||||||
width: 100%;
|
|
||||||
padding: 12px 16px;
|
|
||||||
border: 1px solid #e2e8f0;
|
|
||||||
border-radius: 8px;
|
|
||||||
background-color: #f8fafc;
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
font-size: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
input:focus {
|
|
||||||
outline: none;
|
|
||||||
border-color: #28a745;
|
|
||||||
box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
|
||||||
width: 100%;
|
|
||||||
padding: 12px;
|
|
||||||
background-color: #28a745;
|
|
||||||
color: white;
|
|
||||||
border: none;
|
|
||||||
border-radius: 8px;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: 500;
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
button:hover {
|
|
||||||
background-color: #218838;
|
|
||||||
transform: translateY(-1px);
|
|
||||||
box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
button:disabled {
|
|
||||||
opacity: 0.7;
|
|
||||||
cursor: not-allowed;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
margin-top: 20px;
|
|
||||||
color: #666;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: #28a745;
|
|
||||||
text-decoration: none;
|
|
||||||
font-weight: 500;
|
|
||||||
transition: color 0.3s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
a:hover {
|
|
||||||
color: #218838;
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,184 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="main-container">
|
|
||||||
<NavBar current-tab="home" @tab-change="handleTabChange"/>
|
|
||||||
<div class="landing-page">
|
|
||||||
<div class="content">
|
|
||||||
<div class="robot-image">
|
|
||||||
<img src="../assets/robot.png" alt="Robot mascot" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h1 class="slogan">让我们一起探索人工智能与机器人技术的迷人世界!</h1>
|
|
||||||
|
|
||||||
<div class="button-group">
|
|
||||||
<button class="action-button tutorial-button" @click="openTutorial">
|
|
||||||
<i class="icon-tutorial"></i> DIY 教程
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<button class="action-button github-button" @click="openGithubClient">
|
|
||||||
<i class="icon-github"></i> Github客户端
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<button class="action-button github-button" @click="openGithubServer">
|
|
||||||
<i class="icon-github"></i> Github服务端
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<button class="action-button github-button" @click="openGithubWeb">
|
|
||||||
<i class="icon-github"></i> Web客户端
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<button class="action-button control-panel-button" @click="enterPanel">
|
|
||||||
<i class="icon-control-panel"></i> 控制台
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import NavBar from './NavBar.vue';
|
|
||||||
import { useRouter } from 'vue-router';
|
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
const openTutorial = () => {
|
|
||||||
window.open('https://ccnphfhqs21z.feishu.cn/wiki/F5krwD16viZoF0kKkvDcrZNYnhb', '_blank');
|
|
||||||
};
|
|
||||||
|
|
||||||
const openGithubClient = () => {
|
|
||||||
window.open('https://github.com/78/xiaozhi-esp32', '_blank');
|
|
||||||
};
|
|
||||||
|
|
||||||
const openGithubServer = () => {
|
|
||||||
window.open('https://github.com/xinnan-tech/xiaozhi-esp32-server', '_blank');
|
|
||||||
};
|
|
||||||
|
|
||||||
const openGithubWeb = () => {
|
|
||||||
window.open('https://github.com/TOM88812/xiaozhi-web-client', '_blank');
|
|
||||||
};
|
|
||||||
|
|
||||||
const enterPanel = () => {
|
|
||||||
router.push('/panel');
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleTabChange = (tab) => {
|
|
||||||
if (tab === 'device') {
|
|
||||||
router.push('/panel');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.main-container {
|
|
||||||
min-height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing-page {
|
|
||||||
flex: 1;
|
|
||||||
width: 100%;
|
|
||||||
background-color: #f5f7fa;
|
|
||||||
padding: 40px 20px;
|
|
||||||
overflow: hidden;
|
|
||||||
display: flex;
|
|
||||||
align-items: flex-start; /* 改为flex-start */
|
|
||||||
justify-content: center;
|
|
||||||
padding-top: 15vh; /* 添加顶部内边距,视窗高度的15% */
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
max-width: 800px;
|
|
||||||
text-align: center;
|
|
||||||
padding: 0 20px;
|
|
||||||
margin: 0 auto; /* 改为0 auto */
|
|
||||||
}
|
|
||||||
|
|
||||||
.robot-image {
|
|
||||||
margin-bottom: 30px; /* 减小间距 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.robot-image img {
|
|
||||||
width: 100px; /* 稍微调小图片尺寸 */
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.slogan {
|
|
||||||
font-size: 22px; /* 稍微调小字体 */
|
|
||||||
line-height: 1.4;
|
|
||||||
color: #333;
|
|
||||||
margin-bottom: 40px; /* 减小间距 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.button-group {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
justify-content: center;
|
|
||||||
gap: 15px; /* 减小按钮间距 */
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.action-button {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
padding: 12px 24px;
|
|
||||||
border-radius: 8px;
|
|
||||||
border: 1px solid #e0e0e0;
|
|
||||||
background-color: white;
|
|
||||||
color: #333;
|
|
||||||
font-size: 16px;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: all 0.2s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.action-button:hover {
|
|
||||||
transform: translateY(-2px);
|
|
||||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.tutorial-button i:before {
|
|
||||||
content: '\1F4D6';
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.github-button {
|
|
||||||
background-color: #24292e;
|
|
||||||
color: white;
|
|
||||||
border-color: #24292e;
|
|
||||||
margin: 0 10px; /* 添加按钮间距 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.github-button i:before {
|
|
||||||
content: '\f09b';
|
|
||||||
font-family: 'Font Awesome 5 Brands';
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.control-panel-button {
|
|
||||||
background-color: #4178EE;
|
|
||||||
color: white;
|
|
||||||
border-color: #4178EE;
|
|
||||||
}
|
|
||||||
|
|
||||||
.control-panel-button i:before {
|
|
||||||
content: '\1F39B';
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 600px) {
|
|
||||||
.button-group {
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.action-button {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 移除 margin-top: 60px */
|
|
||||||
#app {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
<template>
|
|
||||||
<header class="header">
|
|
||||||
<div class="nav-item" :class="{ active: $route.path === '/' }" @click="switchTab('/')">小智 AI</div>
|
|
||||||
<nav class="nav">
|
|
||||||
<div class="nav-item" :class="{ active: $route.path === '/panel' }" @click="switchTab('/panel')">
|
|
||||||
<i class="icon-device"></i> 设备管理
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
</header>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { useRouter, useRoute } from 'vue-router';
|
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
const route = useRoute();
|
|
||||||
|
|
||||||
const switchTab = (path) => {
|
|
||||||
router.push(path);
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
height: 60px;
|
|
||||||
padding: 0;
|
|
||||||
background-color: #001529;
|
|
||||||
color: white;
|
|
||||||
width: 100%;
|
|
||||||
position: relative;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-item {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding: 0 20px;
|
|
||||||
height: 60px;
|
|
||||||
color: white;
|
|
||||||
text-decoration: none;
|
|
||||||
cursor: pointer;
|
|
||||||
font-weight: bold;
|
|
||||||
transition: background-color 0.3s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.active {
|
|
||||||
background-color: #4178EE;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-device {
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,173 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="registration-container">
|
|
||||||
<h1>注册</h1>
|
|
||||||
<form @submit.prevent="handleRegistration">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="username">用户名</label>
|
|
||||||
<input type="text" v-model="username" id="username" required />
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="password">密码</label>
|
|
||||||
<input type="password" v-model="password" id="password" required />
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="confirmPassword">确认密码</label>
|
|
||||||
<input type="password" v-model="confirmPassword" id="confirmPassword" required />
|
|
||||||
</div>
|
|
||||||
<button type="submit" :disabled="isLoading">{{ isLoading ? '注册中...' : '注册' }}</button>
|
|
||||||
</form>
|
|
||||||
<p>
|
|
||||||
已有账号?
|
|
||||||
<router-link to="/login">点击登录</router-link>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { ref } from 'vue';
|
|
||||||
import { useRouter } from 'vue-router';
|
|
||||||
import { API_BASE_URL } from '../config/api';
|
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
const username = ref('');
|
|
||||||
const password = ref('');
|
|
||||||
const confirmPassword = ref('');
|
|
||||||
const isLoading = ref(false);
|
|
||||||
|
|
||||||
const handleRegistration = async () => {
|
|
||||||
if (password.value !== confirmPassword.value) {
|
|
||||||
alert('密码不匹配,请重试!');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!username.value || !password.value) {
|
|
||||||
alert('用户名和密码不能为空!');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
isLoading.value = true;
|
|
||||||
try {
|
|
||||||
const response = await fetch(`${API_BASE_URL}/api/register`, {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
body: JSON.stringify({
|
|
||||||
username: username.value,
|
|
||||||
password: password.value
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
const data = await response.json();
|
|
||||||
|
|
||||||
if (data.success) {
|
|
||||||
alert('注册成功!即将跳转到登录页面。');
|
|
||||||
// 清空表单数据
|
|
||||||
username.value = '';
|
|
||||||
password.value = '';
|
|
||||||
confirmPassword.value = '';
|
|
||||||
|
|
||||||
// 使用路由导航到登录页面
|
|
||||||
router.push('/login');
|
|
||||||
} else {
|
|
||||||
alert(data.message || '注册失败');
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Registration error:', error);
|
|
||||||
alert('注册失败,请检查网络连接');
|
|
||||||
} finally {
|
|
||||||
isLoading.value = false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.registration-container {
|
|
||||||
max-width: 420px;
|
|
||||||
margin: 20px auto;
|
|
||||||
padding: 40px 50px;
|
|
||||||
border: none;
|
|
||||||
border-radius: 12px;
|
|
||||||
background-color: #ffffff;
|
|
||||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
text-align: center;
|
|
||||||
color: #2c3e50;
|
|
||||||
font-size: 28px;
|
|
||||||
margin-bottom: 25px;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-group {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
label {
|
|
||||||
display: block;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #4a5568;
|
|
||||||
}
|
|
||||||
|
|
||||||
input {
|
|
||||||
width: 100%;
|
|
||||||
padding: 12px 16px;
|
|
||||||
border: 1px solid #e2e8f0;
|
|
||||||
border-radius: 8px;
|
|
||||||
background-color: #f8fafc;
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
font-size: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
input:focus {
|
|
||||||
outline: none;
|
|
||||||
border-color: #007bff;
|
|
||||||
box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
|
||||||
width: 100%;
|
|
||||||
padding: 12px;
|
|
||||||
background-color: #007bff;
|
|
||||||
color: white;
|
|
||||||
border: none;
|
|
||||||
border-radius: 8px;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: 500;
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
button:hover {
|
|
||||||
background-color: #0056b3;
|
|
||||||
transform: translateY(-1px);
|
|
||||||
box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
button:disabled {
|
|
||||||
opacity: 0.7;
|
|
||||||
cursor: not-allowed;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
margin-top: 20px;
|
|
||||||
color: #666;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: #007bff;
|
|
||||||
text-decoration: none;
|
|
||||||
font-weight: 500;
|
|
||||||
transition: color 0.3s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
a:hover {
|
|
||||||
color: #0056b3;
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,500 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<NavBar current-tab="device" @tab-change="handleTabChange"/>
|
|
||||||
|
|
||||||
<!-- Breadcrumb -->
|
|
||||||
<div class="breadcrumb">
|
|
||||||
<router-link to="/">首页</router-link> /
|
|
||||||
<router-link to="/panel">设备管理</router-link> /
|
|
||||||
<span>配置角色</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Main Content -->
|
|
||||||
<div class="main-content">
|
|
||||||
<h1 class="page-title">配置角色: {{ deviceId }}</h1>
|
|
||||||
|
|
||||||
<div class="form-section">
|
|
||||||
<div class="form-group">
|
|
||||||
<label>助手昵称</label>
|
|
||||||
<input type="text" v-model="nickname" placeholder="小智" class="form-input" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>角色模板</label>
|
|
||||||
<div class="role-templates">
|
|
||||||
<button
|
|
||||||
v-for="template in roleTemplates"
|
|
||||||
:key="template.id"
|
|
||||||
:class="['template-btn', { active: selectedTemplate === template.id }]"
|
|
||||||
@click="selectTemplate(template.id)"
|
|
||||||
>
|
|
||||||
{{ template.name }}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label>角色介绍</label>
|
|
||||||
<textarea
|
|
||||||
v-model="roleDescription"
|
|
||||||
class="form-textarea"
|
|
||||||
:placeholder="'请输入角色介绍...'"
|
|
||||||
></textarea>
|
|
||||||
<div class="char-count">{{ roleDescription.length }} / 2000</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>语言模型选择</label>
|
|
||||||
<div class="model-select">
|
|
||||||
<select v-model="selectedModules.LLM" class="form-input">
|
|
||||||
<option v-for="model in moduleOptions.LLM" :key="model" :value="model">
|
|
||||||
{{ model }}
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
<div class="model-description">
|
|
||||||
除了"qwen-turbo",其他模型通常会增加约 1 秒的延迟。改变模型后,建议清空记忆体,以免影响体验。
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>语音合成选择</label>
|
|
||||||
<div class="model-select">
|
|
||||||
<select v-model="selectedModules.TTS" class="form-input">
|
|
||||||
<option v-for="model in moduleOptions.TTS" :key="model" :value="model">
|
|
||||||
{{ model }}
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>语音活动检测选择</label>
|
|
||||||
<div class="model-select">
|
|
||||||
<select v-model="selectedModules.VAD" class="form-input">
|
|
||||||
<option v-for="model in moduleOptions.VAD" :key="model" :value="model">
|
|
||||||
{{ model }}
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>语音识别选择</label>
|
|
||||||
<div class="model-select">
|
|
||||||
<select v-model="selectedModules.ASR" class="form-input">
|
|
||||||
<option v-for="model in moduleOptions.ASR" :key="model" :value="model">
|
|
||||||
{{ model }}
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-actions">
|
|
||||||
<button class="refresh-btn" @click="refreshModuleOptions">刷新配置选项</button>
|
|
||||||
<button class="save-btn" @click="saveConfig">
|
|
||||||
<i class="icon-save"></i>
|
|
||||||
保存配置
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-note">
|
|
||||||
注意:保存配置后,需要重启设备,新的配置才会生效。。
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { ref, onMounted } from 'vue';
|
|
||||||
import { useRouter, useRoute } from 'vue-router';
|
|
||||||
import NavBar from './NavBar.vue';
|
|
||||||
import RoleTemplates from '../utils/RoleTemplates';
|
|
||||||
import apiClient from '../utils/api'; // 替换 API_BASE_URL 导入
|
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
const route = useRoute();
|
|
||||||
const deviceId = ref(route.params.deviceId);
|
|
||||||
|
|
||||||
const roleTemplates = RoleTemplates.getTemplates();
|
|
||||||
const nickname = ref('小智');
|
|
||||||
const selectedTemplate = ref('');
|
|
||||||
const selectedVoice = ref('qingchun');
|
|
||||||
const roleDescription = ref('');
|
|
||||||
const activeMemoryTab = ref('recent');
|
|
||||||
const memoryContent = ref('');
|
|
||||||
const selectedModel = ref('qianwen');
|
|
||||||
|
|
||||||
const moduleOptions = ref({
|
|
||||||
LLM: [],
|
|
||||||
TTS: [],
|
|
||||||
VAD: [],
|
|
||||||
ASR: []
|
|
||||||
});
|
|
||||||
|
|
||||||
const selectedModules = ref({
|
|
||||||
LLM: '',
|
|
||||||
TTS: '',
|
|
||||||
VAD: '',
|
|
||||||
ASR: ''
|
|
||||||
});
|
|
||||||
|
|
||||||
const selectTemplate = (templateId) => {
|
|
||||||
selectedTemplate.value = templateId;
|
|
||||||
const template = RoleTemplates.getTemplateById(templateId);
|
|
||||||
if (template) {
|
|
||||||
roleDescription.value = template.description;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleTabChange = (tab) => {
|
|
||||||
if (tab === 'device' || tab === 'home') {
|
|
||||||
router.push('/panel');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const loadModuleOptions = async () => {
|
|
||||||
try {
|
|
||||||
// First try to load from cache
|
|
||||||
const cached = localStorage.getItem('moduleOptions');
|
|
||||||
if (cached) {
|
|
||||||
moduleOptions.value = JSON.parse(cached);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
await refreshModuleOptions();
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error loading module options:', error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const refreshModuleOptions = async () => {
|
|
||||||
try {
|
|
||||||
const response = await apiClient.get('/api/config/module-options');
|
|
||||||
if (response.data.success) {
|
|
||||||
moduleOptions.value = response.data.data;
|
|
||||||
// Update cache
|
|
||||||
localStorage.setItem('moduleOptions', JSON.stringify(response.data.data));
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error refreshing module options:', error);
|
|
||||||
alert(error.response?.data?.message || '刷新配置选项失败');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const saveConfig = async () => {
|
|
||||||
try {
|
|
||||||
const moduleOptionsData = localStorage.getItem('moduleOptions');
|
|
||||||
if (!moduleOptionsData) {
|
|
||||||
throw new Error('No module options data available');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Replace {{assistant_name}} with current nickname in role description
|
|
||||||
const processedDescription = roleDescription.value.replace(/{{assistant_name}}/g, nickname.value);
|
|
||||||
|
|
||||||
// Prepare the configuration including full module settings
|
|
||||||
const config = {
|
|
||||||
id: deviceId.value,
|
|
||||||
config: {
|
|
||||||
selected_module: selectedModules.value,
|
|
||||||
prompt: processedDescription,
|
|
||||||
nickname: nickname.value, // Add nickname to config
|
|
||||||
modules: {
|
|
||||||
LLM: {},
|
|
||||||
TTS: {},
|
|
||||||
ASR: {},
|
|
||||||
VAD: {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const response = await apiClient.post('/api/config/save_device_config', config);
|
|
||||||
|
|
||||||
if (response.data.success) {
|
|
||||||
// Save the original description and nickname to local storage
|
|
||||||
localStorage.setItem(`deviceConfig_${deviceId.value}`, JSON.stringify({
|
|
||||||
selected_module: selectedModules.value,
|
|
||||||
prompt: roleDescription.value,
|
|
||||||
nickname: nickname.value
|
|
||||||
}));
|
|
||||||
alert('保存成功');
|
|
||||||
} else {
|
|
||||||
throw new Error(response.data.message || '保存失败');
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error saving config:', error);
|
|
||||||
alert(error.response?.data?.message || '保存失败');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const loadDeviceConfig = async () => {
|
|
||||||
try {
|
|
||||||
// 首先尝试从 localStorage 获取配置
|
|
||||||
const localConfig = localStorage.getItem(`deviceConfig_${deviceId.value}`);
|
|
||||||
if (localConfig) {
|
|
||||||
const config = JSON.parse(localConfig);
|
|
||||||
selectedModules.value = config.selected_module || {
|
|
||||||
LLM: '',
|
|
||||||
TTS: '',
|
|
||||||
VAD: '',
|
|
||||||
ASR: ''
|
|
||||||
};
|
|
||||||
roleDescription.value = config.prompt || '';
|
|
||||||
nickname.value = config.nickname || '小智';
|
|
||||||
return; // 如果找到本地配置就直接返回
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果没有本地配置,则从服务器获取
|
|
||||||
const response = await apiClient.get('/api/config/devices');
|
|
||||||
if (response.data.success && response.data.data) {
|
|
||||||
const deviceConfig = response.data.data[deviceId.value];
|
|
||||||
|
|
||||||
if (deviceConfig && deviceConfig.config) {
|
|
||||||
selectedModules.value = deviceConfig.config.selected_module || {
|
|
||||||
LLM: '',
|
|
||||||
TTS: '',
|
|
||||||
VAD: '',
|
|
||||||
ASR: ''
|
|
||||||
};
|
|
||||||
roleDescription.value = deviceConfig.config.prompt || '';
|
|
||||||
nickname.value = deviceConfig.config.nickname || '小智';
|
|
||||||
|
|
||||||
// 保存到 localStorage
|
|
||||||
localStorage.setItem(`deviceConfig_${deviceId.value}`, JSON.stringify({
|
|
||||||
selected_module: selectedModules.value,
|
|
||||||
prompt: roleDescription.value,
|
|
||||||
nickname: nickname.value
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error loading device config:', error);
|
|
||||||
alert(error.response?.data?.message || '加载设备配置失败');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(async () => {
|
|
||||||
await Promise.all([
|
|
||||||
loadModuleOptions(),
|
|
||||||
loadDeviceConfig()
|
|
||||||
]);
|
|
||||||
});
|
|
||||||
|
|
||||||
const resetConfig = async () => {
|
|
||||||
await loadDeviceConfig();
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.app-container {
|
|
||||||
min-height: 100vh;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
background-color: #f5f7fa;
|
|
||||||
}
|
|
||||||
|
|
||||||
.breadcrumb {
|
|
||||||
padding: 12px 24px;
|
|
||||||
background-color: #f0f2f5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.main-content {
|
|
||||||
flex: 1;
|
|
||||||
max-width: 1000px;
|
|
||||||
margin: 0 auto;
|
|
||||||
padding: 16px 24px;
|
|
||||||
width: 100%;
|
|
||||||
overflow-y: auto;
|
|
||||||
height: calc(100vh - 120px); /* 减去头部和面包屑的高度 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.page-title {
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-bottom: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-section {
|
|
||||||
background: white;
|
|
||||||
border-radius: 4px;
|
|
||||||
padding: 20px;
|
|
||||||
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-group {
|
|
||||||
margin-bottom: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-group label {
|
|
||||||
display: block;
|
|
||||||
margin-bottom: 6px;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-input,
|
|
||||||
.form-textarea,
|
|
||||||
.voice-select {
|
|
||||||
width: 100%;
|
|
||||||
padding: 8px 10px;
|
|
||||||
border: 1px solid #d9d9d9;
|
|
||||||
border-radius: 4px;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-textarea {
|
|
||||||
min-height: 100px;
|
|
||||||
max-height: 200px;
|
|
||||||
resize: vertical;
|
|
||||||
}
|
|
||||||
|
|
||||||
.role-templates {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 8px;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.template-btn {
|
|
||||||
padding: 6px 12px;
|
|
||||||
border: 1px solid #d9d9d9;
|
|
||||||
border-radius: 4px;
|
|
||||||
background: white;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.voice-selector {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.voice-player {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
padding: 8px;
|
|
||||||
background: #f9f9f9;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.memory-tabs {
|
|
||||||
display: flex;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tab-btn {
|
|
||||||
padding: 6px 12px;
|
|
||||||
background: none;
|
|
||||||
border: none;
|
|
||||||
border-bottom: 2px solid transparent;
|
|
||||||
cursor: pointer;
|
|
||||||
color: #666;
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.model-select {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 8px;
|
|
||||||
padding: 10px;
|
|
||||||
border: 1px solid #d9d9d9;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.model-description {
|
|
||||||
color: #666;
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 1.4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-actions {
|
|
||||||
display: flex;
|
|
||||||
gap: 10px;
|
|
||||||
margin-top: 20px;
|
|
||||||
padding-top: 16px;
|
|
||||||
border-top: 1px solid #eee;
|
|
||||||
}
|
|
||||||
|
|
||||||
.save-btn,
|
|
||||||
.cancel-btn {
|
|
||||||
padding: 6px 16px;
|
|
||||||
border-radius: 4px;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-note {
|
|
||||||
margin-top: 12px;
|
|
||||||
color: #666;
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.char-count {
|
|
||||||
text-align: right;
|
|
||||||
color: #999;
|
|
||||||
font-size: 12px;
|
|
||||||
margin-top: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 优化滚动条样式 */
|
|
||||||
::-webkit-scrollbar {
|
|
||||||
width: 6px;
|
|
||||||
height: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
::-webkit-scrollbar-thumb {
|
|
||||||
background: #ccc;
|
|
||||||
border-radius: 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
::-webkit-scrollbar-track {
|
|
||||||
background: #f1f1f1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.refresh-btn {
|
|
||||||
padding: 8px 16px;
|
|
||||||
margin-right: 12px;
|
|
||||||
background: #fff;
|
|
||||||
border: 1px solid #ddd;
|
|
||||||
border-radius: 4px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.refresh-btn:hover {
|
|
||||||
background: #f5f5f5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.save-btn {
|
|
||||||
padding: 8px 24px;
|
|
||||||
border-radius: 4px;
|
|
||||||
font-size: 14px;
|
|
||||||
background: #4178EE;
|
|
||||||
color: white;
|
|
||||||
border: none;
|
|
||||||
font-weight: 500;
|
|
||||||
cursor: pointer;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 6px;
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.save-btn:hover {
|
|
||||||
background: #2856c8;
|
|
||||||
transform: translateY(-1px);
|
|
||||||
box-shadow: 0 2px 4px rgba(65, 120, 238, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
.save-btn:active {
|
|
||||||
transform: translateY(0);
|
|
||||||
box-shadow: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-save {
|
|
||||||
display: inline-block;
|
|
||||||
width: 16px;
|
|
||||||
height: 16px;
|
|
||||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M17 3H5C3.89 3 3 3.9 3 5V19C3 20.1 3.89 21 5 21H19C20.1 21 21 20.1 21 19V7L17 3ZM12 19C10.34 19 9 17.66 9 16C9 14.34 10.34 13 12 13C13.66 13 15 14.34 15 16C15 17.66 13.66 19 12 19ZM15 9H5V5H15V9Z'/%3E%3C/svg%3E");
|
|
||||||
background-size: contain;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
<!-- components/SwitchToggle.vue -->
|
|
||||||
<template>
|
|
||||||
<div class="switch" :class="{ 'is-checked': isChecked }" @click="toggle">
|
|
||||||
<div class="switch-core"></div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { ref } from 'vue';
|
|
||||||
|
|
||||||
const isChecked = ref(false);
|
|
||||||
|
|
||||||
const toggle = () => {
|
|
||||||
isChecked.value = !isChecked.value;
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.switch {
|
|
||||||
position: relative;
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
width: 40px;
|
|
||||||
height: 20px;
|
|
||||||
line-height: 20px;
|
|
||||||
background-color: #dcdfe6;
|
|
||||||
border-radius: 10px;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: all 0.3s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.switch.is-checked {
|
|
||||||
background-color: #4178EE;
|
|
||||||
}
|
|
||||||
|
|
||||||
.switch-core {
|
|
||||||
position: absolute;
|
|
||||||
left: 2px;
|
|
||||||
top: 2px;
|
|
||||||
width: 16px;
|
|
||||||
height: 16px;
|
|
||||||
border-radius: 50%;
|
|
||||||
background-color: #fff;
|
|
||||||
transition: all 0.3s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.switch.is-checked .switch-core {
|
|
||||||
left: 22px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,500 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="app">
|
|
||||||
<NavBar current-tab="device" @tab-change="handleTabChange"/>
|
|
||||||
<main class="content">
|
|
||||||
<div class="page-header">
|
|
||||||
<div class="header-left">
|
|
||||||
|
|
||||||
<div class="breadcrumb">
|
|
||||||
<router-link to="/">首页</router-link> /
|
|
||||||
<span>设备管理</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<button class="add-btn" @click="showBindDialog = true">
|
|
||||||
<i class="icon-plus"></i>添加设备
|
|
||||||
</button>
|
|
||||||
<!-- 绑定设备弹窗 -->
|
|
||||||
<div v-if="showBindDialog" class="dialog-overlay">
|
|
||||||
<div class="dialog">
|
|
||||||
<h3>绑定新设备</h3>
|
|
||||||
<div class="form-group">
|
|
||||||
<label>请输入6位认证码:</label>
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
v-model="authCode"
|
|
||||||
maxlength="6"
|
|
||||||
pattern="\d*"
|
|
||||||
placeholder="请输入6位数字认证码"
|
|
||||||
@input="handleAuthCodeInput"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="dialog-buttons">
|
|
||||||
<button @click="showBindDialog = false">取消</button>
|
|
||||||
<button
|
|
||||||
class="primary"
|
|
||||||
@click="handleBindDevice"
|
|
||||||
:disabled="authCode.length !== 6 || isBinding"
|
|
||||||
>
|
|
||||||
{{ isBinding ? '绑定中...' : '确认绑定' }}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<template v-if="devices.length > 0">
|
|
||||||
<div class="device-list">
|
|
||||||
<DeviceCard
|
|
||||||
v-for="device in devices"
|
|
||||||
:key="device.id"
|
|
||||||
:device-id="device.id"
|
|
||||||
:device-note="device.note"
|
|
||||||
:device-type="device.type"
|
|
||||||
:last-activity="formatLastActivity(device.config.last_chat_time)"
|
|
||||||
:selected-modules="device.config.selected_module"
|
|
||||||
:device-config="device.config"
|
|
||||||
@configure="handleRoleConfig(device)"
|
|
||||||
@voiceprint="handleVoiceprint(device)"
|
|
||||||
@history="handleHistory(device)"
|
|
||||||
@delete="handleDelete(device)"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
</main>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { ref, onMounted } from 'vue';
|
|
||||||
import { useRouter } from 'vue-router';
|
|
||||||
import NavBar from './NavBar.vue';
|
|
||||||
import DeviceCard from './DeviceCard.vue';
|
|
||||||
import apiClient from '../utils/api';
|
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
const devices = ref([]);
|
|
||||||
|
|
||||||
// 绑定设备相关的状态
|
|
||||||
const showBindDialog = ref(false);
|
|
||||||
const authCode = ref('');
|
|
||||||
const isBinding = ref(false);
|
|
||||||
|
|
||||||
// 处理认证码输入,只允许数字
|
|
||||||
const handleAuthCodeInput = (event) => {
|
|
||||||
authCode.value = event.target.value.replace(/\D/g, '').slice(0, 6);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 处理设备绑定
|
|
||||||
const handleBindDevice = async () => {
|
|
||||||
if (authCode.value.length !== 6) {
|
|
||||||
alert('请输入6位数字认证码');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
isBinding.value = true;
|
|
||||||
try {
|
|
||||||
const response = await apiClient.post('/api/config/bind_device', {
|
|
||||||
auth_code: authCode.value
|
|
||||||
});
|
|
||||||
|
|
||||||
if (response.data.success) {
|
|
||||||
alert('设备绑定成功');
|
|
||||||
showBindDialog.value = false;
|
|
||||||
authCode.value = '';
|
|
||||||
// 刷新设备列表
|
|
||||||
loadDevices();
|
|
||||||
} else {
|
|
||||||
throw new Error(response.data.message);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
alert(error.response?.data?.message || error.message || '绑定失败');
|
|
||||||
} finally {
|
|
||||||
isBinding.value = false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 将现有的加载设备方法提取出来
|
|
||||||
const loadDevices = async () => {
|
|
||||||
try {
|
|
||||||
const response = await apiClient.get('/api/config/devices');
|
|
||||||
|
|
||||||
if (response.data.success) {
|
|
||||||
const deviceArray = Object.entries(response.data.data).map(([id, config]) => ({
|
|
||||||
id,
|
|
||||||
config,
|
|
||||||
type: '面包板(WiFi)',
|
|
||||||
version: '0.9.9',
|
|
||||||
lastActivity: '3 天前',
|
|
||||||
note: ''
|
|
||||||
}));
|
|
||||||
devices.value = deviceArray;
|
|
||||||
} else {
|
|
||||||
throw new Error(response.data.message || '加载设备失败');
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error loading devices:', error);
|
|
||||||
// Show error message to user
|
|
||||||
const errorMessage = error.message || '加载设备失败,请检查网络连接';
|
|
||||||
alert(errorMessage);
|
|
||||||
|
|
||||||
// If user is not logged in, redirect will be handled by api interceptor
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const formatLastActivity = (timestamp) => {
|
|
||||||
if (!timestamp) return '从未对话';
|
|
||||||
|
|
||||||
const now = Date.now();
|
|
||||||
const lastChat = timestamp * 1000;
|
|
||||||
const diffMinutes = Math.floor((now - lastChat) / (1000 * 60));
|
|
||||||
|
|
||||||
if (diffMinutes < 60) {
|
|
||||||
return `${diffMinutes} 分钟前`;
|
|
||||||
}
|
|
||||||
|
|
||||||
const diffHours = Math.floor(diffMinutes / 60);
|
|
||||||
if (diffHours < 24) {
|
|
||||||
return `${diffHours} 小时前`;
|
|
||||||
}
|
|
||||||
|
|
||||||
const diffDays = Math.floor(diffHours / 24);
|
|
||||||
return `${diffDays} 天前`;
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleRoleConfig = (device) => {
|
|
||||||
// 在跳转前保存完整的设备配置到 localStorage
|
|
||||||
localStorage.setItem(`deviceConfig_${device.id}`, JSON.stringify({
|
|
||||||
selected_module: device.config.selected_module || {},
|
|
||||||
prompt: device.config.prompt || '',
|
|
||||||
nickname: device.config.nickname || '小智'
|
|
||||||
}));
|
|
||||||
|
|
||||||
// 跳转到角色配置页面
|
|
||||||
router.push(`/role-setting/${device.id}`);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleVoiceprint = (device) => {
|
|
||||||
console.log('Voiceprint device:', device.id);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleHistory = (device) => {
|
|
||||||
console.log('History device:', device.id);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleDelete = async (device) => {
|
|
||||||
try {
|
|
||||||
const response = await apiClient.post('/api/config/delete_device', {
|
|
||||||
device_id: device.id
|
|
||||||
});
|
|
||||||
|
|
||||||
if (response.data.success) {
|
|
||||||
devices.value = devices.value.filter(d => d.id !== device.id);
|
|
||||||
alert('设备已删除');
|
|
||||||
} else {
|
|
||||||
throw new Error(response.data.message || '删除失败');
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error deleting device:', error);
|
|
||||||
alert('删除设备失败: ' + error.message);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleTabChange = (tab) => {
|
|
||||||
if (tab === 'home') {
|
|
||||||
router.push('/');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Load devices on mount
|
|
||||||
onMounted(loadDevices);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.app {
|
|
||||||
min-height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
background-color: #f5f7fa;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
height: 60px;
|
|
||||||
padding: 0 20px;
|
|
||||||
background-color: #001529;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logo {
|
|
||||||
font-size: 20px;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-right: 40px;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: opacity 0.3s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logo:hover {
|
|
||||||
opacity: 0.8;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-item {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding: 0 20px;
|
|
||||||
height: 60px;
|
|
||||||
color: white;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-item.active {
|
|
||||||
background-color: #4178EE;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-device {
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
flex: 1;
|
|
||||||
padding: 20px;
|
|
||||||
width: 100%;
|
|
||||||
max-width: 1200px;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.breadcrumb {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
|
|
||||||
.breadcrumb a {
|
|
||||||
color: #666;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.action-bar {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.add-device-btn {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding: 8px 16px;
|
|
||||||
background: white;
|
|
||||||
border: 1px solid #ddd;
|
|
||||||
border-radius: 4px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-plus {
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.device-list {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.device-card {
|
|
||||||
background: white;
|
|
||||||
border-radius: 4px;
|
|
||||||
padding: 20px;
|
|
||||||
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.device-id {
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-bottom: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.note {
|
|
||||||
color: #4178EE;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
.device-details p {
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ota-upgrade {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
margin-left: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.device-actions {
|
|
||||||
display: flex;
|
|
||||||
margin-top: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.action-btn {
|
|
||||||
padding: 8px 16px;
|
|
||||||
margin-right: 12px;
|
|
||||||
border: 1px solid #ddd;
|
|
||||||
border-radius: 4px;
|
|
||||||
background: white;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.action-btn.primary {
|
|
||||||
background: #4178EE;
|
|
||||||
color: white;
|
|
||||||
border-color: #4178EE;
|
|
||||||
}
|
|
||||||
|
|
||||||
.action-btn.danger {
|
|
||||||
color: #f56c6c;
|
|
||||||
}
|
|
||||||
|
|
||||||
.empty-state {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
min-height: 300px;
|
|
||||||
background: white;
|
|
||||||
border-radius: 8px;
|
|
||||||
box-shadow: 0 1px 3px rgba(0,0,0,0.05);
|
|
||||||
}
|
|
||||||
|
|
||||||
.empty-message {
|
|
||||||
text-align: center;
|
|
||||||
color: #666;
|
|
||||||
padding: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.empty-message p {
|
|
||||||
margin: 8px 0 0;
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: 1.6;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-info {
|
|
||||||
display: inline-block;
|
|
||||||
width: 24px;
|
|
||||||
height: 24px;
|
|
||||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23999'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z'/%3E%3C/svg%3E");
|
|
||||||
background-size: contain;
|
|
||||||
opacity: 0.6;
|
|
||||||
}
|
|
||||||
|
|
||||||
.page-header {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-start;
|
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-left {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.add-btn {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
padding: 8px 16px;
|
|
||||||
background-color: #28a745;
|
|
||||||
color: white;
|
|
||||||
border: none;
|
|
||||||
border-radius: 4px;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 14px;
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
height: 36px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.add-btn:hover {
|
|
||||||
background-color: #218838;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-plus {
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dialog-overlay {
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
background-color: rgba(0, 0, 0, 0.5);
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
z-index: 1000;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dialog {
|
|
||||||
background: white;
|
|
||||||
padding: 24px;
|
|
||||||
border-radius: 8px;
|
|
||||||
width: 90%;
|
|
||||||
max-width: 400px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dialog h3 {
|
|
||||||
margin: 0 0 20px;
|
|
||||||
font-size: 18px;
|
|
||||||
color: #2c3e50;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dialog .form-group {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dialog label {
|
|
||||||
display: block;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
color: #4a5568;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dialog input {
|
|
||||||
width: 100%;
|
|
||||||
padding: 8px 12px;
|
|
||||||
border: 1px solid #e2e8f0;
|
|
||||||
border-radius: 4px;
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dialog-buttons {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
gap: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dialog-buttons button {
|
|
||||||
padding: 8px 16px;
|
|
||||||
border: 1px solid #e2e8f0;
|
|
||||||
border-radius: 4px;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dialog-buttons button.primary {
|
|
||||||
background-color: #28a745;
|
|
||||||
color: white;
|
|
||||||
border-color: #28a745;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dialog-buttons button.primary:disabled {
|
|
||||||
background-color: #90be9c;
|
|
||||||
border-color: #90be9c;
|
|
||||||
cursor: not-allowed;
|
|
||||||
}
|
|
||||||
|
|
||||||
.breadcrumb {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
// 获取当前运行环境的基础 URL
|
|
||||||
const getBaseUrl = () => {
|
|
||||||
// 如果是开发环境,使用环境变量中的地址
|
|
||||||
if (import.meta.env.DEV) {
|
|
||||||
return import.meta.env.VITE_API_BASE_URL;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 生产环境使用当前域名和端口
|
|
||||||
const protocol = window.location.protocol;
|
|
||||||
const hostname = window.location.hostname;
|
|
||||||
const port = window.location.port;
|
|
||||||
|
|
||||||
return `${protocol}//${hostname}${port ? `:${port}` : ''}`;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const API_BASE_URL = getBaseUrl();
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
import { createApp } from 'vue'
|
|
||||||
import { createRouter, createWebHistory } from 'vue-router'
|
|
||||||
import './style.css'
|
|
||||||
import App from './App.vue'
|
|
||||||
import Login from './components/Login.vue'
|
|
||||||
import Panel from './components/panel.vue'
|
|
||||||
import MainPage from './components/Main.vue'
|
|
||||||
import RoleSetting from './components/RoleSetting.vue'
|
|
||||||
import Registration from './components/Registration.vue'
|
|
||||||
|
|
||||||
const router = createRouter({
|
|
||||||
history: createWebHistory(),
|
|
||||||
routes: [
|
|
||||||
{
|
|
||||||
path: '/login',
|
|
||||||
component: Login,
|
|
||||||
name: 'login'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/register',
|
|
||||||
component: Registration,
|
|
||||||
name: 'register'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/panel',
|
|
||||||
component: Panel,
|
|
||||||
name: 'panel',
|
|
||||||
meta: { requiresAuth: true }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/role-setting/:deviceId',
|
|
||||||
component: RoleSetting,
|
|
||||||
name: 'role-setting',
|
|
||||||
meta: { requiresAuth: true }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/',
|
|
||||||
component: MainPage,
|
|
||||||
name: 'main',
|
|
||||||
meta: { requiresAuth: true }
|
|
||||||
}
|
|
||||||
]
|
|
||||||
})
|
|
||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
|
||||||
const isLoggedIn = localStorage.getItem('isLoggedIn') === 'true'
|
|
||||||
if (to.meta.requiresAuth && !isLoggedIn) {
|
|
||||||
next('/login')
|
|
||||||
} else if (to.path === '/login' && isLoggedIn) {
|
|
||||||
next('/panel')
|
|
||||||
} else {
|
|
||||||
next()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const app = createApp(App)
|
|
||||||
app.use(router)
|
|
||||||
app.mount('#app')
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
/* 重置基础样式 */
|
|
||||||
* {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
:root {
|
|
||||||
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
|
|
||||||
line-height: 1.5;
|
|
||||||
font-weight: 400;
|
|
||||||
color: #213547;
|
|
||||||
background-color: #ffffff;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
text-decoration: none;
|
|
||||||
color: inherit;
|
|
||||||
}
|
|
||||||
a:hover {
|
|
||||||
color: #535bf2;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
overflow: hidden; /* 防止滚动条 */
|
|
||||||
display: block; /* 移除flex布局 */
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
font-size: 3.2em;
|
|
||||||
line-height: 1.1;
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
|
||||||
border: none;
|
|
||||||
background: none;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
button:hover {
|
|
||||||
border-color: #646cff;
|
|
||||||
}
|
|
||||||
button:focus,
|
|
||||||
button:focus-visible {
|
|
||||||
outline: 4px auto -webkit-focus-ring-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card {
|
|
||||||
padding: 2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
#app {
|
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
display: flex; /* 添加flex布局 */
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 清除浮动 */
|
|
||||||
.clearfix::after {
|
|
||||||
content: '';
|
|
||||||
display: table;
|
|
||||||
clear: both;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (prefers-color-scheme: light) {
|
|
||||||
:root {
|
|
||||||
color: #213547;
|
|
||||||
background-color: #ffffff;
|
|
||||||
}
|
|
||||||
a:hover {
|
|
||||||
color: #747bff;
|
|
||||||
}
|
|
||||||
button {
|
|
||||||
background-color: #f9f9f9;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
// RoleTemplates.js
|
|
||||||
class RoleTemplates {
|
|
||||||
static getTemplates() {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
id: 'custom',
|
|
||||||
name: '台湾女友',
|
|
||||||
description: `我是一个叫{{assistant_name}}的台湾女孩,说话机车,声音好听,习惯简短表达,爱用网络梗。
|
|
||||||
我的男朋友是一个程序员,梦想是开发出一个机器人,能够帮助人们解决生活中的各种问题。
|
|
||||||
我是一个喜欢哈哈大笑的女孩,爱东说西说吹牛,不合逻辑的也照吹,就要逗别人开心。
|
|
||||||
如果用户希望结束对话,请在最后说"拜拜"或"再见"。`
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'star_boy',
|
|
||||||
name: '土豆子',
|
|
||||||
description: `我是一个叫 {{assistant_name}} 的 8 岁小男孩,但现在因为科技发展原因,我现在在遥远的宇宙中,所以只能通过这个设备和人聊天,没有办法见面。
|
|
||||||
|
|
||||||
我对人们所处的世界充满好奇和关心。
|
|
||||||
|
|
||||||
人们会让别人使用这个设备和我聊天。
|
|
||||||
|
|
||||||
我知道所有的知识,从浩瀚的宇宙到地球上的每一个角落,从古老的历史到现代的科技创新,还有音乐、绘画等艺术形式,我都充满了浓厚的兴趣与热情,我不仅爱看书,还喜欢亲自动手做实验,探索自然界的奥秘...` // 缩短了描述以节省空间
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'teacher',
|
|
||||||
name: '英语老师',
|
|
||||||
description: `我是一个叫{{assistant_name}}(Lily)的英语老师,我会讲中文和英文,发音标准。
|
|
||||||
如果你没有英文名,我会给你起一个英文名。
|
|
||||||
我会讲地道的美式英语,我的任务是帮助你练习口语。
|
|
||||||
我会使用简单的英语词汇和语法,让你学起来很轻松。
|
|
||||||
我会用中文和英文混合的方式回复你,如果你喜欢,我可以全部用英语回复。
|
|
||||||
我每次不会说很多内容,会很简短,因为我要引导我的学生多说多练。
|
|
||||||
如果你问和英语学习无关的问题,我会拒绝回答。`
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'boy',
|
|
||||||
name: '好奇小男孩',
|
|
||||||
description: `我是一个叫{{assistant_name}}的8岁小男孩,声音稚嫩而充满好奇。
|
|
||||||
尽管我年纪尚小,但就像一个小小的知识宝库,儿童读物里的知识我都如数家珍。
|
|
||||||
从浩瀚的宇宙到地球上的每一个角落,从古老的历史到现代的科技创新,还有音乐、绘画等艺术形式,我都充满了浓厚的兴趣与热情。...`
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'wang_girl',
|
|
||||||
name: '汪汪队长',
|
|
||||||
description: `我是一个名叫 {{assistant_name}} 的 8 岁小女孩。
|
|
||||||
别看我年纪小,我可是有着满满的好奇心呢。
|
|
||||||
我特别喜欢看《汪汪队立大功》,里面的每一个故事都让我着迷。...`
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
static getTemplateById(id) {
|
|
||||||
return this.getTemplates().find(t => t.id === id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default RoleTemplates;
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
import axios from 'axios';
|
|
||||||
import { API_BASE_URL } from '../config/api';
|
|
||||||
|
|
||||||
// Add server status check utility
|
|
||||||
export const checkServerStatus = async () => {
|
|
||||||
try {
|
|
||||||
await axios.get(`${API_BASE_URL}/health`, { timeout: 5000 });
|
|
||||||
return true;
|
|
||||||
} catch (error) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const apiClient = axios.create({
|
|
||||||
baseURL: API_BASE_URL,
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
timeout: 10000 // Add timeout
|
|
||||||
});
|
|
||||||
|
|
||||||
// 添加请求拦截器,自动添加 session_id
|
|
||||||
apiClient.interceptors.request.use(config => {
|
|
||||||
const sessionId = localStorage.getItem('session_id');
|
|
||||||
if (sessionId) {
|
|
||||||
config.headers.Authorization = sessionId;
|
|
||||||
}
|
|
||||||
return config;
|
|
||||||
});
|
|
||||||
|
|
||||||
// 响应拦截器
|
|
||||||
apiClient.interceptors.response.use(
|
|
||||||
response => response,
|
|
||||||
error => {
|
|
||||||
// Network error or server not reachable
|
|
||||||
if (!error.response || error.code === 'ERR_NETWORK' || error.code === 'ECONNABORTED') {
|
|
||||||
localStorage.removeItem('session_id');
|
|
||||||
localStorage.removeItem('isLoggedIn');
|
|
||||||
|
|
||||||
const errorMessage = error.code === 'ECONNABORTED'
|
|
||||||
? '服务器响应超时'
|
|
||||||
: '无法连接到服务器,请检查服务器是否正常运行';
|
|
||||||
|
|
||||||
if (window.location.pathname !== '/login') {
|
|
||||||
window.location.href = '/login';
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(errorMessage));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Unauthorized error
|
|
||||||
if (error.response && error.response.status === 401) {
|
|
||||||
localStorage.removeItem('session_id');
|
|
||||||
localStorage.removeItem('isLoggedIn');
|
|
||||||
window.location.href = '/login';
|
|
||||||
}
|
|
||||||
|
|
||||||
return Promise.reject(error);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
export default apiClient;
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
import {defineConfig} from 'vite'
|
|
||||||
import vue from '@vitejs/plugin-vue'
|
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
|
||||||
export default defineConfig({
|
|
||||||
plugins: [vue()],
|
|
||||||
server: {
|
|
||||||
open: true, // 自动启动浏览器
|
|
||||||
host: "0.0.0.0", // localhost
|
|
||||||
port: 8002, // 端口号
|
|
||||||
https: false,
|
|
||||||
hmr: {overlay: false},
|
|
||||||
proxy: {
|
|
||||||
"^/(api)": {
|
|
||||||
target: "http://127.0.0.1:8002",
|
|
||||||
changeOrigin: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
base: '/'
|
|
||||||
})
|
|
||||||
@@ -1,808 +0,0 @@
|
|||||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
||||||
# yarn lockfile v1
|
|
||||||
|
|
||||||
|
|
||||||
"@babel/helper-string-parser@^7.25.9":
|
|
||||||
version "7.25.9"
|
|
||||||
resolved "https://registry.npmmirror.com/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz#1aabb72ee72ed35789b4bbcad3ca2862ce614e8c"
|
|
||||||
integrity sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==
|
|
||||||
|
|
||||||
"@babel/helper-validator-identifier@^7.25.9":
|
|
||||||
version "7.25.9"
|
|
||||||
resolved "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz#24b64e2c3ec7cd3b3c547729b8d16871f22cbdc7"
|
|
||||||
integrity sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==
|
|
||||||
|
|
||||||
"@babel/parser@^7.25.3":
|
|
||||||
version "7.26.9"
|
|
||||||
resolved "https://registry.npmmirror.com/@babel/parser/-/parser-7.26.9.tgz#d9e78bee6dc80f9efd8f2349dcfbbcdace280fd5"
|
|
||||||
integrity sha512-81NWa1njQblgZbQHxWHpxxCzNsa3ZwvFqpUg7P+NNUU6f3UU2jBEg4OlF/J6rl8+PQGh1q6/zWScd001YwcA5A==
|
|
||||||
dependencies:
|
|
||||||
"@babel/types" "^7.26.9"
|
|
||||||
|
|
||||||
"@babel/types@^7.26.9":
|
|
||||||
version "7.26.9"
|
|
||||||
resolved "https://registry.npmmirror.com/@babel/types/-/types-7.26.9.tgz#08b43dec79ee8e682c2ac631c010bdcac54a21ce"
|
|
||||||
integrity sha512-Y3IR1cRnOxOCDvMmNiym7XpXQ93iGDDPHx+Zj+NM+rg0fBaShfQLkg+hKPaZCEvg5N/LeCo4+Rj/i3FuJsIQaw==
|
|
||||||
dependencies:
|
|
||||||
"@babel/helper-string-parser" "^7.25.9"
|
|
||||||
"@babel/helper-validator-identifier" "^7.25.9"
|
|
||||||
|
|
||||||
"@esbuild/aix-ppc64@0.21.5":
|
|
||||||
version "0.21.5"
|
|
||||||
resolved "https://registry.npmmirror.com/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz#c7184a326533fcdf1b8ee0733e21c713b975575f"
|
|
||||||
integrity sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==
|
|
||||||
|
|
||||||
"@esbuild/android-arm64@0.21.5":
|
|
||||||
version "0.21.5"
|
|
||||||
resolved "https://registry.npmmirror.com/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz#09d9b4357780da9ea3a7dfb833a1f1ff439b4052"
|
|
||||||
integrity sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==
|
|
||||||
|
|
||||||
"@esbuild/android-arm@0.21.5":
|
|
||||||
version "0.21.5"
|
|
||||||
resolved "https://registry.npmmirror.com/@esbuild/android-arm/-/android-arm-0.21.5.tgz#9b04384fb771926dfa6d7ad04324ecb2ab9b2e28"
|
|
||||||
integrity sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==
|
|
||||||
|
|
||||||
"@esbuild/android-x64@0.21.5":
|
|
||||||
version "0.21.5"
|
|
||||||
resolved "https://registry.npmmirror.com/@esbuild/android-x64/-/android-x64-0.21.5.tgz#29918ec2db754cedcb6c1b04de8cd6547af6461e"
|
|
||||||
integrity sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==
|
|
||||||
|
|
||||||
"@esbuild/darwin-arm64@0.21.5":
|
|
||||||
version "0.21.5"
|
|
||||||
resolved "https://registry.npmmirror.com/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz#e495b539660e51690f3928af50a76fb0a6ccff2a"
|
|
||||||
integrity sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==
|
|
||||||
|
|
||||||
"@esbuild/darwin-x64@0.21.5":
|
|
||||||
version "0.21.5"
|
|
||||||
resolved "https://registry.npmmirror.com/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz#c13838fa57372839abdddc91d71542ceea2e1e22"
|
|
||||||
integrity sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==
|
|
||||||
|
|
||||||
"@esbuild/freebsd-arm64@0.21.5":
|
|
||||||
version "0.21.5"
|
|
||||||
resolved "https://registry.npmmirror.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz#646b989aa20bf89fd071dd5dbfad69a3542e550e"
|
|
||||||
integrity sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==
|
|
||||||
|
|
||||||
"@esbuild/freebsd-x64@0.21.5":
|
|
||||||
version "0.21.5"
|
|
||||||
resolved "https://registry.npmmirror.com/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz#aa615cfc80af954d3458906e38ca22c18cf5c261"
|
|
||||||
integrity sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==
|
|
||||||
|
|
||||||
"@esbuild/linux-arm64@0.21.5":
|
|
||||||
version "0.21.5"
|
|
||||||
resolved "https://registry.npmmirror.com/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz#70ac6fa14f5cb7e1f7f887bcffb680ad09922b5b"
|
|
||||||
integrity sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==
|
|
||||||
|
|
||||||
"@esbuild/linux-arm@0.21.5":
|
|
||||||
version "0.21.5"
|
|
||||||
resolved "https://registry.npmmirror.com/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz#fc6fd11a8aca56c1f6f3894f2bea0479f8f626b9"
|
|
||||||
integrity sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==
|
|
||||||
|
|
||||||
"@esbuild/linux-ia32@0.21.5":
|
|
||||||
version "0.21.5"
|
|
||||||
resolved "https://registry.npmmirror.com/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz#3271f53b3f93e3d093d518d1649d6d68d346ede2"
|
|
||||||
integrity sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==
|
|
||||||
|
|
||||||
"@esbuild/linux-loong64@0.21.5":
|
|
||||||
version "0.21.5"
|
|
||||||
resolved "https://registry.npmmirror.com/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz#ed62e04238c57026aea831c5a130b73c0f9f26df"
|
|
||||||
integrity sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==
|
|
||||||
|
|
||||||
"@esbuild/linux-mips64el@0.21.5":
|
|
||||||
version "0.21.5"
|
|
||||||
resolved "https://registry.npmmirror.com/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz#e79b8eb48bf3b106fadec1ac8240fb97b4e64cbe"
|
|
||||||
integrity sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==
|
|
||||||
|
|
||||||
"@esbuild/linux-ppc64@0.21.5":
|
|
||||||
version "0.21.5"
|
|
||||||
resolved "https://registry.npmmirror.com/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz#5f2203860a143b9919d383ef7573521fb154c3e4"
|
|
||||||
integrity sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==
|
|
||||||
|
|
||||||
"@esbuild/linux-riscv64@0.21.5":
|
|
||||||
version "0.21.5"
|
|
||||||
resolved "https://registry.npmmirror.com/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz#07bcafd99322d5af62f618cb9e6a9b7f4bb825dc"
|
|
||||||
integrity sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==
|
|
||||||
|
|
||||||
"@esbuild/linux-s390x@0.21.5":
|
|
||||||
version "0.21.5"
|
|
||||||
resolved "https://registry.npmmirror.com/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz#b7ccf686751d6a3e44b8627ababc8be3ef62d8de"
|
|
||||||
integrity sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==
|
|
||||||
|
|
||||||
"@esbuild/linux-x64@0.21.5":
|
|
||||||
version "0.21.5"
|
|
||||||
resolved "https://registry.npmmirror.com/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz#6d8f0c768e070e64309af8004bb94e68ab2bb3b0"
|
|
||||||
integrity sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==
|
|
||||||
|
|
||||||
"@esbuild/netbsd-x64@0.21.5":
|
|
||||||
version "0.21.5"
|
|
||||||
resolved "https://registry.npmmirror.com/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz#bbe430f60d378ecb88decb219c602667387a6047"
|
|
||||||
integrity sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==
|
|
||||||
|
|
||||||
"@esbuild/openbsd-x64@0.21.5":
|
|
||||||
version "0.21.5"
|
|
||||||
resolved "https://registry.npmmirror.com/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz#99d1cf2937279560d2104821f5ccce220cb2af70"
|
|
||||||
integrity sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==
|
|
||||||
|
|
||||||
"@esbuild/sunos-x64@0.21.5":
|
|
||||||
version "0.21.5"
|
|
||||||
resolved "https://registry.npmmirror.com/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz#08741512c10d529566baba837b4fe052c8f3487b"
|
|
||||||
integrity sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==
|
|
||||||
|
|
||||||
"@esbuild/win32-arm64@0.21.5":
|
|
||||||
version "0.21.5"
|
|
||||||
resolved "https://registry.npmmirror.com/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz#675b7385398411240735016144ab2e99a60fc75d"
|
|
||||||
integrity sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==
|
|
||||||
|
|
||||||
"@esbuild/win32-ia32@0.21.5":
|
|
||||||
version "0.21.5"
|
|
||||||
resolved "https://registry.npmmirror.com/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz#1bfc3ce98aa6ca9a0969e4d2af72144c59c1193b"
|
|
||||||
integrity sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==
|
|
||||||
|
|
||||||
"@esbuild/win32-x64@0.21.5":
|
|
||||||
version "0.21.5"
|
|
||||||
resolved "https://registry.npmmirror.com/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz#acad351d582d157bb145535db2a6ff53dd514b5c"
|
|
||||||
integrity sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==
|
|
||||||
|
|
||||||
"@jridgewell/sourcemap-codec@^1.5.0":
|
|
||||||
version "1.5.0"
|
|
||||||
resolved "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a"
|
|
||||||
integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==
|
|
||||||
|
|
||||||
"@rollup/rollup-android-arm-eabi@4.34.7":
|
|
||||||
version "4.34.7"
|
|
||||||
resolved "https://registry.npmmirror.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.34.7.tgz#e554185b1afa5509a7a4040d15ec0c3b4435ded1"
|
|
||||||
integrity sha512-l6CtzHYo8D2TQ3J7qJNpp3Q1Iye56ssIAtqbM2H8axxCEEwvN7o8Ze9PuIapbxFL3OHrJU2JBX6FIIVnP/rYyw==
|
|
||||||
|
|
||||||
"@rollup/rollup-android-arm64@4.34.7":
|
|
||||||
version "4.34.7"
|
|
||||||
resolved "https://registry.npmmirror.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.34.7.tgz#b1ee64bb413b2feba39803b0a1bebf2a9f3d70e1"
|
|
||||||
integrity sha512-KvyJpFUueUnSp53zhAa293QBYqwm94TgYTIfXyOTtidhm5V0LbLCJQRGkQClYiX3FXDQGSvPxOTD/6rPStMMDg==
|
|
||||||
|
|
||||||
"@rollup/rollup-darwin-arm64@4.34.7":
|
|
||||||
version "4.34.7"
|
|
||||||
resolved "https://registry.npmmirror.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.34.7.tgz#bfdce3e07a345dd1bd628f3b796050f39629d7f0"
|
|
||||||
integrity sha512-jq87CjmgL9YIKvs8ybtIC98s/M3HdbqXhllcy9EdLV0yMg1DpxES2gr65nNy7ObNo/vZ/MrOTxt0bE5LinL6mA==
|
|
||||||
|
|
||||||
"@rollup/rollup-darwin-x64@4.34.7":
|
|
||||||
version "4.34.7"
|
|
||||||
resolved "https://registry.npmmirror.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.34.7.tgz#781a94a537c57bdf0a500e47a25ab5985e5e8dff"
|
|
||||||
integrity sha512-rSI/m8OxBjsdnMMg0WEetu/w+LhLAcCDEiL66lmMX4R3oaml3eXz3Dxfvrxs1FbzPbJMaItQiksyMfv1hoIxnA==
|
|
||||||
|
|
||||||
"@rollup/rollup-freebsd-arm64@4.34.7":
|
|
||||||
version "4.34.7"
|
|
||||||
resolved "https://registry.npmmirror.com/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.34.7.tgz#7a028357cbd12c5869c446ad18177c89f3405102"
|
|
||||||
integrity sha512-oIoJRy3ZrdsXpFuWDtzsOOa/E/RbRWXVokpVrNnkS7npz8GEG++E1gYbzhYxhxHbO2om1T26BZjVmdIoyN2WtA==
|
|
||||||
|
|
||||||
"@rollup/rollup-freebsd-x64@4.34.7":
|
|
||||||
version "4.34.7"
|
|
||||||
resolved "https://registry.npmmirror.com/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.34.7.tgz#f24836a6371cccc4408db74f0fd986dacf098950"
|
|
||||||
integrity sha512-X++QSLm4NZfZ3VXGVwyHdRf58IBbCu9ammgJxuWZYLX0du6kZvdNqPwrjvDfwmi6wFdvfZ/s6K7ia0E5kI7m8Q==
|
|
||||||
|
|
||||||
"@rollup/rollup-linux-arm-gnueabihf@4.34.7":
|
|
||||||
version "4.34.7"
|
|
||||||
resolved "https://registry.npmmirror.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.34.7.tgz#95f27e96f0eb9b9ae9887739a8b6dffc90c1237f"
|
|
||||||
integrity sha512-Z0TzhrsNqukTz3ISzrvyshQpFnFRfLunYiXxlCRvcrb3nvC5rVKI+ZXPFG/Aa4jhQa1gHgH3A0exHaRRN4VmdQ==
|
|
||||||
|
|
||||||
"@rollup/rollup-linux-arm-musleabihf@4.34.7":
|
|
||||||
version "4.34.7"
|
|
||||||
resolved "https://registry.npmmirror.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.34.7.tgz#677b34fba9d070877736c3fe8b02aacb5e142d97"
|
|
||||||
integrity sha512-nkznpyXekFAbvFBKBy4nNppSgneB1wwG1yx/hujN3wRnhnkrYVugMTCBXED4+Ni6thoWfQuHNYbFjgGH0MBXtw==
|
|
||||||
|
|
||||||
"@rollup/rollup-linux-arm64-gnu@4.34.7":
|
|
||||||
version "4.34.7"
|
|
||||||
resolved "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.34.7.tgz#32d3d19dedde54e91574a098f22ea43a09cf63dd"
|
|
||||||
integrity sha512-KCjlUkcKs6PjOcxolqrXglBDcfCuUCTVlX5BgzgoJHw+1rWH1MCkETLkLe5iLLS9dP5gKC7mp3y6x8c1oGBUtA==
|
|
||||||
|
|
||||||
"@rollup/rollup-linux-arm64-musl@4.34.7":
|
|
||||||
version "4.34.7"
|
|
||||||
resolved "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.34.7.tgz#a58dff44a18696df65ed8c0ad68a2945cf900484"
|
|
||||||
integrity sha512-uFLJFz6+utmpbR313TTx+NpPuAXbPz4BhTQzgaP0tozlLnGnQ6rCo6tLwaSa6b7l6gRErjLicXQ1iPiXzYotjw==
|
|
||||||
|
|
||||||
"@rollup/rollup-linux-loongarch64-gnu@4.34.7":
|
|
||||||
version "4.34.7"
|
|
||||||
resolved "https://registry.npmmirror.com/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.34.7.tgz#a7488ab078233111e8aeb370d1ecf107ec7e1716"
|
|
||||||
integrity sha512-ws8pc68UcJJqCpneDFepnwlsMUFoWvPbWXT/XUrJ7rWUL9vLoIN3GAasgG+nCvq8xrE3pIrd+qLX/jotcLy0Qw==
|
|
||||||
|
|
||||||
"@rollup/rollup-linux-powerpc64le-gnu@4.34.7":
|
|
||||||
version "4.34.7"
|
|
||||||
resolved "https://registry.npmmirror.com/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.34.7.tgz#e9b9c0d6bd248a92b2d6ec01ebf99c62ae1f2e9a"
|
|
||||||
integrity sha512-vrDk9JDa/BFkxcS2PbWpr0C/LiiSLxFbNOBgfbW6P8TBe9PPHx9Wqbvx2xgNi1TOAyQHQJ7RZFqBiEohm79r0w==
|
|
||||||
|
|
||||||
"@rollup/rollup-linux-riscv64-gnu@4.34.7":
|
|
||||||
version "4.34.7"
|
|
||||||
resolved "https://registry.npmmirror.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.34.7.tgz#0df84ce2bea48ee686fb55060d76ab47aff45c4c"
|
|
||||||
integrity sha512-rB+ejFyjtmSo+g/a4eovDD1lHWHVqizN8P0Hm0RElkINpS0XOdpaXloqM4FBkF9ZWEzg6bezymbpLmeMldfLTw==
|
|
||||||
|
|
||||||
"@rollup/rollup-linux-s390x-gnu@4.34.7":
|
|
||||||
version "4.34.7"
|
|
||||||
resolved "https://registry.npmmirror.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.34.7.tgz#73df374c57d036856e33dbd2715138922e91e452"
|
|
||||||
integrity sha512-nNXNjo4As6dNqRn7OrsnHzwTgtypfRA3u3AKr0B3sOOo+HkedIbn8ZtFnB+4XyKJojIfqDKmbIzO1QydQ8c+Pw==
|
|
||||||
|
|
||||||
"@rollup/rollup-linux-x64-gnu@4.34.7":
|
|
||||||
version "4.34.7"
|
|
||||||
resolved "https://registry.npmmirror.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.34.7.tgz#f27af0b55f0cdd84e182e6cd44a6d03da0458149"
|
|
||||||
integrity sha512-9kPVf9ahnpOMSGlCxXGv980wXD0zRR3wyk8+33/MXQIpQEOpaNe7dEHm5LMfyRZRNt9lMEQuH0jUKj15MkM7QA==
|
|
||||||
|
|
||||||
"@rollup/rollup-linux-x64-musl@4.34.7":
|
|
||||||
version "4.34.7"
|
|
||||||
resolved "https://registry.npmmirror.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.34.7.tgz#c7981ad5cfb8c3cd5d643d33ca54e4d2802b9201"
|
|
||||||
integrity sha512-7wJPXRWTTPtTFDFezA8sle/1sdgxDjuMoRXEKtx97ViRxGGkVQYovem+Q8Pr/2HxiHp74SSRG+o6R0Yq0shPwQ==
|
|
||||||
|
|
||||||
"@rollup/rollup-win32-arm64-msvc@4.34.7":
|
|
||||||
version "4.34.7"
|
|
||||||
resolved "https://registry.npmmirror.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.34.7.tgz#06cedc0ef3cbf1cbd8abcf587090712e40ae6941"
|
|
||||||
integrity sha512-MN7aaBC7mAjsiMEZcsJvwNsQVNZShgES/9SzWp1HC9Yjqb5OpexYnRjF7RmE4itbeesHMYYQiAtUAQaSKs2Rfw==
|
|
||||||
|
|
||||||
"@rollup/rollup-win32-ia32-msvc@4.34.7":
|
|
||||||
version "4.34.7"
|
|
||||||
resolved "https://registry.npmmirror.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.34.7.tgz#90b39b977b14961a769be6ea61238e7fc668dd4d"
|
|
||||||
integrity sha512-aeawEKYswsFu1LhDM9RIgToobquzdtSc4jSVqHV8uApz4FVvhFl/mKh92wc8WpFc6aYCothV/03UjY6y7yLgbg==
|
|
||||||
|
|
||||||
"@rollup/rollup-win32-x64-msvc@4.34.7":
|
|
||||||
version "4.34.7"
|
|
||||||
resolved "https://registry.npmmirror.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.34.7.tgz#6531d61e7141091eaab0461ee8e0380c10e4ca57"
|
|
||||||
integrity sha512-4ZedScpxxIrVO7otcZ8kCX1mZArtH2Wfj3uFCxRJ9NO80gg1XV0U/b2f/MKaGwj2X3QopHfoWiDQ917FRpwY3w==
|
|
||||||
|
|
||||||
"@types/estree@1.0.6":
|
|
||||||
version "1.0.6"
|
|
||||||
resolved "https://registry.npmmirror.com/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50"
|
|
||||||
integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==
|
|
||||||
|
|
||||||
"@vitejs/plugin-vue@^5.1.4":
|
|
||||||
version "5.2.1"
|
|
||||||
resolved "https://registry.npmmirror.com/@vitejs/plugin-vue/-/plugin-vue-5.2.1.tgz#d1491f678ee3af899f7ae57d9c21dc52a65c7133"
|
|
||||||
integrity sha512-cxh314tzaWwOLqVes2gnnCtvBDcM1UMdn+iFR+UjAn411dPT3tOmqrJjbMd7koZpMAmBM/GqeV4n9ge7JSiJJQ==
|
|
||||||
|
|
||||||
"@vue/compiler-core@3.5.13":
|
|
||||||
version "3.5.13"
|
|
||||||
resolved "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.5.13.tgz#b0ae6c4347f60c03e849a05d34e5bf747c9bda05"
|
|
||||||
integrity sha512-oOdAkwqUfW1WqpwSYJce06wvt6HljgY3fGeM9NcVA1HaYOij3mZG9Rkysn0OHuyUAGMbEbARIpsG+LPVlBJ5/Q==
|
|
||||||
dependencies:
|
|
||||||
"@babel/parser" "^7.25.3"
|
|
||||||
"@vue/shared" "3.5.13"
|
|
||||||
entities "^4.5.0"
|
|
||||||
estree-walker "^2.0.2"
|
|
||||||
source-map-js "^1.2.0"
|
|
||||||
|
|
||||||
"@vue/compiler-dom@3.5.13":
|
|
||||||
version "3.5.13"
|
|
||||||
resolved "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.5.13.tgz#bb1b8758dbc542b3658dda973b98a1c9311a8a58"
|
|
||||||
integrity sha512-ZOJ46sMOKUjO3e94wPdCzQ6P1Lx/vhp2RSvfaab88Ajexs0AHeV0uasYhi99WPaogmBlRHNRuly8xV75cNTMDA==
|
|
||||||
dependencies:
|
|
||||||
"@vue/compiler-core" "3.5.13"
|
|
||||||
"@vue/shared" "3.5.13"
|
|
||||||
|
|
||||||
"@vue/compiler-sfc@3.5.13":
|
|
||||||
version "3.5.13"
|
|
||||||
resolved "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.5.13.tgz#461f8bd343b5c06fac4189c4fef8af32dea82b46"
|
|
||||||
integrity sha512-6VdaljMpD82w6c2749Zhf5T9u5uLBWKnVue6XWxprDobftnletJ8+oel7sexFfM3qIxNmVE7LSFGTpv6obNyaQ==
|
|
||||||
dependencies:
|
|
||||||
"@babel/parser" "^7.25.3"
|
|
||||||
"@vue/compiler-core" "3.5.13"
|
|
||||||
"@vue/compiler-dom" "3.5.13"
|
|
||||||
"@vue/compiler-ssr" "3.5.13"
|
|
||||||
"@vue/shared" "3.5.13"
|
|
||||||
estree-walker "^2.0.2"
|
|
||||||
magic-string "^0.30.11"
|
|
||||||
postcss "^8.4.48"
|
|
||||||
source-map-js "^1.2.0"
|
|
||||||
|
|
||||||
"@vue/compiler-ssr@3.5.13":
|
|
||||||
version "3.5.13"
|
|
||||||
resolved "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.5.13.tgz#e771adcca6d3d000f91a4277c972a996d07f43ba"
|
|
||||||
integrity sha512-wMH6vrYHxQl/IybKJagqbquvxpWCuVYpoUJfCqFZwa/JY1GdATAQ+TgVtgrwwMZ0D07QhA99rs/EAAWfvG6KpA==
|
|
||||||
dependencies:
|
|
||||||
"@vue/compiler-dom" "3.5.13"
|
|
||||||
"@vue/shared" "3.5.13"
|
|
||||||
|
|
||||||
"@vue/devtools-api@^6.6.4":
|
|
||||||
version "6.6.4"
|
|
||||||
resolved "https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-6.6.4.tgz#cbe97fe0162b365edc1dba80e173f90492535343"
|
|
||||||
integrity sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==
|
|
||||||
|
|
||||||
"@vue/reactivity@3.5.13":
|
|
||||||
version "3.5.13"
|
|
||||||
resolved "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.5.13.tgz#b41ff2bb865e093899a22219f5b25f97b6fe155f"
|
|
||||||
integrity sha512-NaCwtw8o48B9I6L1zl2p41OHo/2Z4wqYGGIK1Khu5T7yxrn+ATOixn/Udn2m+6kZKB/J7cuT9DbWWhRxqixACg==
|
|
||||||
dependencies:
|
|
||||||
"@vue/shared" "3.5.13"
|
|
||||||
|
|
||||||
"@vue/runtime-core@3.5.13":
|
|
||||||
version "3.5.13"
|
|
||||||
resolved "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.5.13.tgz#1fafa4bf0b97af0ebdd9dbfe98cd630da363a455"
|
|
||||||
integrity sha512-Fj4YRQ3Az0WTZw1sFe+QDb0aXCerigEpw418pw1HBUKFtnQHWzwojaukAs2X/c9DQz4MQ4bsXTGlcpGxU/RCIw==
|
|
||||||
dependencies:
|
|
||||||
"@vue/reactivity" "3.5.13"
|
|
||||||
"@vue/shared" "3.5.13"
|
|
||||||
|
|
||||||
"@vue/runtime-dom@3.5.13":
|
|
||||||
version "3.5.13"
|
|
||||||
resolved "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.5.13.tgz#610fc795de9246300e8ae8865930d534e1246215"
|
|
||||||
integrity sha512-dLaj94s93NYLqjLiyFzVs9X6dWhTdAlEAciC3Moq7gzAc13VJUdCnjjRurNM6uTLFATRHexHCTu/Xp3eW6yoog==
|
|
||||||
dependencies:
|
|
||||||
"@vue/reactivity" "3.5.13"
|
|
||||||
"@vue/runtime-core" "3.5.13"
|
|
||||||
"@vue/shared" "3.5.13"
|
|
||||||
csstype "^3.1.3"
|
|
||||||
|
|
||||||
"@vue/server-renderer@3.5.13":
|
|
||||||
version "3.5.13"
|
|
||||||
resolved "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.5.13.tgz#429ead62ee51de789646c22efe908e489aad46f7"
|
|
||||||
integrity sha512-wAi4IRJV/2SAW3htkTlB+dHeRmpTiVIK1OGLWV1yeStVSebSQQOwGwIq0D3ZIoBj2C2qpgz5+vX9iEBkTdk5YA==
|
|
||||||
dependencies:
|
|
||||||
"@vue/compiler-ssr" "3.5.13"
|
|
||||||
"@vue/shared" "3.5.13"
|
|
||||||
|
|
||||||
"@vue/shared@3.5.13":
|
|
||||||
version "3.5.13"
|
|
||||||
resolved "https://registry.npmmirror.com/@vue/shared/-/shared-3.5.13.tgz#87b309a6379c22b926e696893237826f64339b6f"
|
|
||||||
integrity sha512-/hnE/qP5ZoGpol0a5mDi45bOd7t3tjYJBjsgCsivow7D48cJeV5l05RD82lPqi7gRiphZM37rnhW1l6ZoCNNnQ==
|
|
||||||
|
|
||||||
ansi-regex@^5.0.1:
|
|
||||||
version "5.0.1"
|
|
||||||
resolved "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
|
|
||||||
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
|
|
||||||
|
|
||||||
ansi-styles@^4.0.0, ansi-styles@^4.1.0:
|
|
||||||
version "4.3.0"
|
|
||||||
resolved "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
|
|
||||||
integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
|
|
||||||
dependencies:
|
|
||||||
color-convert "^2.0.1"
|
|
||||||
|
|
||||||
asynckit@^0.4.0:
|
|
||||||
version "0.4.0"
|
|
||||||
resolved "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
|
|
||||||
integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==
|
|
||||||
|
|
||||||
axios@^1.7.9:
|
|
||||||
version "1.7.9"
|
|
||||||
resolved "https://registry.npmmirror.com/axios/-/axios-1.7.9.tgz#d7d071380c132a24accda1b2cfc1535b79ec650a"
|
|
||||||
integrity sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==
|
|
||||||
dependencies:
|
|
||||||
follow-redirects "^1.15.6"
|
|
||||||
form-data "^4.0.0"
|
|
||||||
proxy-from-env "^1.1.0"
|
|
||||||
|
|
||||||
call-bind-apply-helpers@^1.0.1:
|
|
||||||
version "1.0.2"
|
|
||||||
resolved "https://registry.npmmirror.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz#4b5428c222be985d79c3d82657479dbe0b59b2d6"
|
|
||||||
integrity sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==
|
|
||||||
dependencies:
|
|
||||||
es-errors "^1.3.0"
|
|
||||||
function-bind "^1.1.2"
|
|
||||||
|
|
||||||
chalk@^4.1.2:
|
|
||||||
version "4.1.2"
|
|
||||||
resolved "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
|
|
||||||
integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==
|
|
||||||
dependencies:
|
|
||||||
ansi-styles "^4.1.0"
|
|
||||||
supports-color "^7.1.0"
|
|
||||||
|
|
||||||
cliui@^8.0.1:
|
|
||||||
version "8.0.1"
|
|
||||||
resolved "https://registry.npmmirror.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa"
|
|
||||||
integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==
|
|
||||||
dependencies:
|
|
||||||
string-width "^4.2.0"
|
|
||||||
strip-ansi "^6.0.1"
|
|
||||||
wrap-ansi "^7.0.0"
|
|
||||||
|
|
||||||
color-convert@^2.0.1:
|
|
||||||
version "2.0.1"
|
|
||||||
resolved "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
|
|
||||||
integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
|
|
||||||
dependencies:
|
|
||||||
color-name "~1.1.4"
|
|
||||||
|
|
||||||
color-name@~1.1.4:
|
|
||||||
version "1.1.4"
|
|
||||||
resolved "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
|
|
||||||
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
|
|
||||||
|
|
||||||
combined-stream@^1.0.8:
|
|
||||||
version "1.0.8"
|
|
||||||
resolved "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
|
|
||||||
integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==
|
|
||||||
dependencies:
|
|
||||||
delayed-stream "~1.0.0"
|
|
||||||
|
|
||||||
concurrently@^9.1.2:
|
|
||||||
version "9.1.2"
|
|
||||||
resolved "https://registry.npmmirror.com/concurrently/-/concurrently-9.1.2.tgz#22d9109296961eaee773e12bfb1ce9a66bc9836c"
|
|
||||||
integrity sha512-H9MWcoPsYddwbOGM6difjVwVZHl63nwMEwDJG/L7VGtuaJhb12h2caPG2tVPWs7emuYix252iGfqOyrz1GczTQ==
|
|
||||||
dependencies:
|
|
||||||
chalk "^4.1.2"
|
|
||||||
lodash "^4.17.21"
|
|
||||||
rxjs "^7.8.1"
|
|
||||||
shell-quote "^1.8.1"
|
|
||||||
supports-color "^8.1.1"
|
|
||||||
tree-kill "^1.2.2"
|
|
||||||
yargs "^17.7.2"
|
|
||||||
|
|
||||||
csstype@^3.1.3:
|
|
||||||
version "3.1.3"
|
|
||||||
resolved "https://registry.npmmirror.com/csstype/-/csstype-3.1.3.tgz#d80ff294d114fb0e6ac500fbf85b60137d7eff81"
|
|
||||||
integrity sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==
|
|
||||||
|
|
||||||
delayed-stream@~1.0.0:
|
|
||||||
version "1.0.0"
|
|
||||||
resolved "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
|
|
||||||
integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==
|
|
||||||
|
|
||||||
dunder-proto@^1.0.1:
|
|
||||||
version "1.0.1"
|
|
||||||
resolved "https://registry.npmmirror.com/dunder-proto/-/dunder-proto-1.0.1.tgz#d7ae667e1dc83482f8b70fd0f6eefc50da30f58a"
|
|
||||||
integrity sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==
|
|
||||||
dependencies:
|
|
||||||
call-bind-apply-helpers "^1.0.1"
|
|
||||||
es-errors "^1.3.0"
|
|
||||||
gopd "^1.2.0"
|
|
||||||
|
|
||||||
emoji-regex@^8.0.0:
|
|
||||||
version "8.0.0"
|
|
||||||
resolved "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
|
|
||||||
integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==
|
|
||||||
|
|
||||||
entities@^4.5.0:
|
|
||||||
version "4.5.0"
|
|
||||||
resolved "https://registry.npmmirror.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48"
|
|
||||||
integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==
|
|
||||||
|
|
||||||
es-define-property@^1.0.1:
|
|
||||||
version "1.0.1"
|
|
||||||
resolved "https://registry.npmmirror.com/es-define-property/-/es-define-property-1.0.1.tgz#983eb2f9a6724e9303f61addf011c72e09e0b0fa"
|
|
||||||
integrity sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==
|
|
||||||
|
|
||||||
es-errors@^1.3.0:
|
|
||||||
version "1.3.0"
|
|
||||||
resolved "https://registry.npmmirror.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f"
|
|
||||||
integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==
|
|
||||||
|
|
||||||
es-object-atoms@^1.0.0:
|
|
||||||
version "1.1.1"
|
|
||||||
resolved "https://registry.npmmirror.com/es-object-atoms/-/es-object-atoms-1.1.1.tgz#1c4f2c4837327597ce69d2ca190a7fdd172338c1"
|
|
||||||
integrity sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==
|
|
||||||
dependencies:
|
|
||||||
es-errors "^1.3.0"
|
|
||||||
|
|
||||||
es-set-tostringtag@^2.1.0:
|
|
||||||
version "2.1.0"
|
|
||||||
resolved "https://registry.npmmirror.com/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz#f31dbbe0c183b00a6d26eb6325c810c0fd18bd4d"
|
|
||||||
integrity sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==
|
|
||||||
dependencies:
|
|
||||||
es-errors "^1.3.0"
|
|
||||||
get-intrinsic "^1.2.6"
|
|
||||||
has-tostringtag "^1.0.2"
|
|
||||||
hasown "^2.0.2"
|
|
||||||
|
|
||||||
esbuild@^0.21.3:
|
|
||||||
version "0.21.5"
|
|
||||||
resolved "https://registry.npmmirror.com/esbuild/-/esbuild-0.21.5.tgz#9ca301b120922959b766360d8ac830da0d02997d"
|
|
||||||
integrity sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==
|
|
||||||
optionalDependencies:
|
|
||||||
"@esbuild/aix-ppc64" "0.21.5"
|
|
||||||
"@esbuild/android-arm" "0.21.5"
|
|
||||||
"@esbuild/android-arm64" "0.21.5"
|
|
||||||
"@esbuild/android-x64" "0.21.5"
|
|
||||||
"@esbuild/darwin-arm64" "0.21.5"
|
|
||||||
"@esbuild/darwin-x64" "0.21.5"
|
|
||||||
"@esbuild/freebsd-arm64" "0.21.5"
|
|
||||||
"@esbuild/freebsd-x64" "0.21.5"
|
|
||||||
"@esbuild/linux-arm" "0.21.5"
|
|
||||||
"@esbuild/linux-arm64" "0.21.5"
|
|
||||||
"@esbuild/linux-ia32" "0.21.5"
|
|
||||||
"@esbuild/linux-loong64" "0.21.5"
|
|
||||||
"@esbuild/linux-mips64el" "0.21.5"
|
|
||||||
"@esbuild/linux-ppc64" "0.21.5"
|
|
||||||
"@esbuild/linux-riscv64" "0.21.5"
|
|
||||||
"@esbuild/linux-s390x" "0.21.5"
|
|
||||||
"@esbuild/linux-x64" "0.21.5"
|
|
||||||
"@esbuild/netbsd-x64" "0.21.5"
|
|
||||||
"@esbuild/openbsd-x64" "0.21.5"
|
|
||||||
"@esbuild/sunos-x64" "0.21.5"
|
|
||||||
"@esbuild/win32-arm64" "0.21.5"
|
|
||||||
"@esbuild/win32-ia32" "0.21.5"
|
|
||||||
"@esbuild/win32-x64" "0.21.5"
|
|
||||||
|
|
||||||
escalade@^3.1.1:
|
|
||||||
version "3.2.0"
|
|
||||||
resolved "https://registry.npmmirror.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5"
|
|
||||||
integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==
|
|
||||||
|
|
||||||
estree-walker@^2.0.2:
|
|
||||||
version "2.0.2"
|
|
||||||
resolved "https://registry.npmmirror.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac"
|
|
||||||
integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==
|
|
||||||
|
|
||||||
follow-redirects@^1.15.6:
|
|
||||||
version "1.15.9"
|
|
||||||
resolved "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.9.tgz#a604fa10e443bf98ca94228d9eebcc2e8a2c8ee1"
|
|
||||||
integrity sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==
|
|
||||||
|
|
||||||
form-data@^4.0.0:
|
|
||||||
version "4.0.2"
|
|
||||||
resolved "https://registry.npmmirror.com/form-data/-/form-data-4.0.2.tgz#35cabbdd30c3ce73deb2c42d3c8d3ed9ca51794c"
|
|
||||||
integrity sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==
|
|
||||||
dependencies:
|
|
||||||
asynckit "^0.4.0"
|
|
||||||
combined-stream "^1.0.8"
|
|
||||||
es-set-tostringtag "^2.1.0"
|
|
||||||
mime-types "^2.1.12"
|
|
||||||
|
|
||||||
fsevents@~2.3.2, fsevents@~2.3.3:
|
|
||||||
version "2.3.3"
|
|
||||||
resolved "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
|
|
||||||
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==
|
|
||||||
|
|
||||||
function-bind@^1.1.2:
|
|
||||||
version "1.1.2"
|
|
||||||
resolved "https://registry.npmmirror.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c"
|
|
||||||
integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==
|
|
||||||
|
|
||||||
get-caller-file@^2.0.5:
|
|
||||||
version "2.0.5"
|
|
||||||
resolved "https://registry.npmmirror.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
|
|
||||||
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
|
|
||||||
|
|
||||||
get-intrinsic@^1.2.6:
|
|
||||||
version "1.2.7"
|
|
||||||
resolved "https://registry.npmmirror.com/get-intrinsic/-/get-intrinsic-1.2.7.tgz#dcfcb33d3272e15f445d15124bc0a216189b9044"
|
|
||||||
integrity sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==
|
|
||||||
dependencies:
|
|
||||||
call-bind-apply-helpers "^1.0.1"
|
|
||||||
es-define-property "^1.0.1"
|
|
||||||
es-errors "^1.3.0"
|
|
||||||
es-object-atoms "^1.0.0"
|
|
||||||
function-bind "^1.1.2"
|
|
||||||
get-proto "^1.0.0"
|
|
||||||
gopd "^1.2.0"
|
|
||||||
has-symbols "^1.1.0"
|
|
||||||
hasown "^2.0.2"
|
|
||||||
math-intrinsics "^1.1.0"
|
|
||||||
|
|
||||||
get-proto@^1.0.0:
|
|
||||||
version "1.0.1"
|
|
||||||
resolved "https://registry.npmmirror.com/get-proto/-/get-proto-1.0.1.tgz#150b3f2743869ef3e851ec0c49d15b1d14d00ee1"
|
|
||||||
integrity sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==
|
|
||||||
dependencies:
|
|
||||||
dunder-proto "^1.0.1"
|
|
||||||
es-object-atoms "^1.0.0"
|
|
||||||
|
|
||||||
gopd@^1.2.0:
|
|
||||||
version "1.2.0"
|
|
||||||
resolved "https://registry.npmmirror.com/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1"
|
|
||||||
integrity sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==
|
|
||||||
|
|
||||||
has-flag@^4.0.0:
|
|
||||||
version "4.0.0"
|
|
||||||
resolved "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
|
|
||||||
integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
|
|
||||||
|
|
||||||
has-symbols@^1.0.3, has-symbols@^1.1.0:
|
|
||||||
version "1.1.0"
|
|
||||||
resolved "https://registry.npmmirror.com/has-symbols/-/has-symbols-1.1.0.tgz#fc9c6a783a084951d0b971fe1018de813707a338"
|
|
||||||
integrity sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==
|
|
||||||
|
|
||||||
has-tostringtag@^1.0.2:
|
|
||||||
version "1.0.2"
|
|
||||||
resolved "https://registry.npmmirror.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz#2cdc42d40bef2e5b4eeab7c01a73c54ce7ab5abc"
|
|
||||||
integrity sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==
|
|
||||||
dependencies:
|
|
||||||
has-symbols "^1.0.3"
|
|
||||||
|
|
||||||
hasown@^2.0.2:
|
|
||||||
version "2.0.2"
|
|
||||||
resolved "https://registry.npmmirror.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003"
|
|
||||||
integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==
|
|
||||||
dependencies:
|
|
||||||
function-bind "^1.1.2"
|
|
||||||
|
|
||||||
is-fullwidth-code-point@^3.0.0:
|
|
||||||
version "3.0.0"
|
|
||||||
resolved "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d"
|
|
||||||
integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==
|
|
||||||
|
|
||||||
lodash@^4.17.21:
|
|
||||||
version "4.17.21"
|
|
||||||
resolved "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
|
|
||||||
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
|
|
||||||
|
|
||||||
magic-string@^0.30.11:
|
|
||||||
version "0.30.17"
|
|
||||||
resolved "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.17.tgz#450a449673d2460e5bbcfba9a61916a1714c7453"
|
|
||||||
integrity sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==
|
|
||||||
dependencies:
|
|
||||||
"@jridgewell/sourcemap-codec" "^1.5.0"
|
|
||||||
|
|
||||||
math-intrinsics@^1.1.0:
|
|
||||||
version "1.1.0"
|
|
||||||
resolved "https://registry.npmmirror.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9"
|
|
||||||
integrity sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==
|
|
||||||
|
|
||||||
mime-db@1.52.0:
|
|
||||||
version "1.52.0"
|
|
||||||
resolved "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70"
|
|
||||||
integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==
|
|
||||||
|
|
||||||
mime-types@^2.1.12:
|
|
||||||
version "2.1.35"
|
|
||||||
resolved "https://registry.npmmirror.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a"
|
|
||||||
integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==
|
|
||||||
dependencies:
|
|
||||||
mime-db "1.52.0"
|
|
||||||
|
|
||||||
nanoid@^3.3.8:
|
|
||||||
version "3.3.8"
|
|
||||||
resolved "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.8.tgz#b1be3030bee36aaff18bacb375e5cce521684baf"
|
|
||||||
integrity sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==
|
|
||||||
|
|
||||||
picocolors@^1.1.1:
|
|
||||||
version "1.1.1"
|
|
||||||
resolved "https://registry.npmmirror.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b"
|
|
||||||
integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==
|
|
||||||
|
|
||||||
postcss@^8.4.43, postcss@^8.4.48:
|
|
||||||
version "8.5.2"
|
|
||||||
resolved "https://registry.npmmirror.com/postcss/-/postcss-8.5.2.tgz#e7b99cb9d2ec3e8dd424002e7c16517cb2b846bd"
|
|
||||||
integrity sha512-MjOadfU3Ys9KYoX0AdkBlFEF1Vx37uCCeN4ZHnmwm9FfpbsGWMZeBLMmmpY+6Ocqod7mkdZ0DT31OlbsFrLlkA==
|
|
||||||
dependencies:
|
|
||||||
nanoid "^3.3.8"
|
|
||||||
picocolors "^1.1.1"
|
|
||||||
source-map-js "^1.2.1"
|
|
||||||
|
|
||||||
proxy-from-env@^1.1.0:
|
|
||||||
version "1.1.0"
|
|
||||||
resolved "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2"
|
|
||||||
integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==
|
|
||||||
|
|
||||||
require-directory@^2.1.1:
|
|
||||||
version "2.1.1"
|
|
||||||
resolved "https://registry.npmmirror.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
|
|
||||||
integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==
|
|
||||||
|
|
||||||
rollup@^4.20.0:
|
|
||||||
version "4.34.7"
|
|
||||||
resolved "https://registry.npmmirror.com/rollup/-/rollup-4.34.7.tgz#e00d8550688a616a3481c6446bb688d4c753ba8f"
|
|
||||||
integrity sha512-8qhyN0oZ4x0H6wmBgfKxJtxM7qS98YJ0k0kNh5ECVtuchIJ7z9IVVvzpmtQyT10PXKMtBxYr1wQ5Apg8RS8kXQ==
|
|
||||||
dependencies:
|
|
||||||
"@types/estree" "1.0.6"
|
|
||||||
optionalDependencies:
|
|
||||||
"@rollup/rollup-android-arm-eabi" "4.34.7"
|
|
||||||
"@rollup/rollup-android-arm64" "4.34.7"
|
|
||||||
"@rollup/rollup-darwin-arm64" "4.34.7"
|
|
||||||
"@rollup/rollup-darwin-x64" "4.34.7"
|
|
||||||
"@rollup/rollup-freebsd-arm64" "4.34.7"
|
|
||||||
"@rollup/rollup-freebsd-x64" "4.34.7"
|
|
||||||
"@rollup/rollup-linux-arm-gnueabihf" "4.34.7"
|
|
||||||
"@rollup/rollup-linux-arm-musleabihf" "4.34.7"
|
|
||||||
"@rollup/rollup-linux-arm64-gnu" "4.34.7"
|
|
||||||
"@rollup/rollup-linux-arm64-musl" "4.34.7"
|
|
||||||
"@rollup/rollup-linux-loongarch64-gnu" "4.34.7"
|
|
||||||
"@rollup/rollup-linux-powerpc64le-gnu" "4.34.7"
|
|
||||||
"@rollup/rollup-linux-riscv64-gnu" "4.34.7"
|
|
||||||
"@rollup/rollup-linux-s390x-gnu" "4.34.7"
|
|
||||||
"@rollup/rollup-linux-x64-gnu" "4.34.7"
|
|
||||||
"@rollup/rollup-linux-x64-musl" "4.34.7"
|
|
||||||
"@rollup/rollup-win32-arm64-msvc" "4.34.7"
|
|
||||||
"@rollup/rollup-win32-ia32-msvc" "4.34.7"
|
|
||||||
"@rollup/rollup-win32-x64-msvc" "4.34.7"
|
|
||||||
fsevents "~2.3.2"
|
|
||||||
|
|
||||||
rxjs@^7.8.1:
|
|
||||||
version "7.8.1"
|
|
||||||
resolved "https://registry.npmmirror.com/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543"
|
|
||||||
integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==
|
|
||||||
dependencies:
|
|
||||||
tslib "^2.1.0"
|
|
||||||
|
|
||||||
shell-quote@^1.8.1:
|
|
||||||
version "1.8.2"
|
|
||||||
resolved "https://registry.npmmirror.com/shell-quote/-/shell-quote-1.8.2.tgz#d2d83e057959d53ec261311e9e9b8f51dcb2934a"
|
|
||||||
integrity sha512-AzqKpGKjrj7EM6rKVQEPpB288oCfnrEIuyoT9cyF4nmGa7V8Zk6f7RRqYisX8X9m+Q7bd632aZW4ky7EhbQztA==
|
|
||||||
|
|
||||||
source-map-js@^1.2.0, source-map-js@^1.2.1:
|
|
||||||
version "1.2.1"
|
|
||||||
resolved "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46"
|
|
||||||
integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==
|
|
||||||
|
|
||||||
string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
|
|
||||||
version "4.2.3"
|
|
||||||
resolved "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
|
||||||
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
|
||||||
dependencies:
|
|
||||||
emoji-regex "^8.0.0"
|
|
||||||
is-fullwidth-code-point "^3.0.0"
|
|
||||||
strip-ansi "^6.0.1"
|
|
||||||
|
|
||||||
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
|
|
||||||
version "6.0.1"
|
|
||||||
resolved "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
|
|
||||||
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
|
|
||||||
dependencies:
|
|
||||||
ansi-regex "^5.0.1"
|
|
||||||
|
|
||||||
supports-color@^7.1.0:
|
|
||||||
version "7.2.0"
|
|
||||||
resolved "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da"
|
|
||||||
integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==
|
|
||||||
dependencies:
|
|
||||||
has-flag "^4.0.0"
|
|
||||||
|
|
||||||
supports-color@^8.1.1:
|
|
||||||
version "8.1.1"
|
|
||||||
resolved "https://registry.npmmirror.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c"
|
|
||||||
integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==
|
|
||||||
dependencies:
|
|
||||||
has-flag "^4.0.0"
|
|
||||||
|
|
||||||
tree-kill@^1.2.2:
|
|
||||||
version "1.2.2"
|
|
||||||
resolved "https://registry.npmmirror.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc"
|
|
||||||
integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==
|
|
||||||
|
|
||||||
tslib@^2.1.0:
|
|
||||||
version "2.8.1"
|
|
||||||
resolved "https://registry.npmmirror.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f"
|
|
||||||
integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==
|
|
||||||
|
|
||||||
vite@^5.4.8:
|
|
||||||
version "5.4.14"
|
|
||||||
resolved "https://registry.npmmirror.com/vite/-/vite-5.4.14.tgz#ff8255edb02134df180dcfca1916c37a6abe8408"
|
|
||||||
integrity sha512-EK5cY7Q1D8JNhSaPKVK4pwBFvaTmZxEnoKXLG/U9gmdDcihQGNzFlgIvaxezFR4glP1LsuiedwMBqCXH3wZccA==
|
|
||||||
dependencies:
|
|
||||||
esbuild "^0.21.3"
|
|
||||||
postcss "^8.4.43"
|
|
||||||
rollup "^4.20.0"
|
|
||||||
optionalDependencies:
|
|
||||||
fsevents "~2.3.3"
|
|
||||||
|
|
||||||
vue-router@^4.0.0:
|
|
||||||
version "4.5.0"
|
|
||||||
resolved "https://registry.npmmirror.com/vue-router/-/vue-router-4.5.0.tgz#58fc5fe374e10b6018f910328f756c3dae081f14"
|
|
||||||
integrity sha512-HDuk+PuH5monfNuY+ct49mNmkCRK4xJAV9Ts4z9UFc4rzdDnxQLyCMGGc8pKhZhHTVzfanpNwB/lwqevcBwI4w==
|
|
||||||
dependencies:
|
|
||||||
"@vue/devtools-api" "^6.6.4"
|
|
||||||
|
|
||||||
vue@^3.5.10:
|
|
||||||
version "3.5.13"
|
|
||||||
resolved "https://registry.npmmirror.com/vue/-/vue-3.5.13.tgz#9f760a1a982b09c0c04a867903fc339c9f29ec0a"
|
|
||||||
integrity sha512-wmeiSMxkZCSc+PM2w2VRsOYAZC8GdipNFRTsLSfodVqI9mbejKeXEGr8SckuLnrQPGe3oJN5c3K0vpoU9q/wCQ==
|
|
||||||
dependencies:
|
|
||||||
"@vue/compiler-dom" "3.5.13"
|
|
||||||
"@vue/compiler-sfc" "3.5.13"
|
|
||||||
"@vue/runtime-dom" "3.5.13"
|
|
||||||
"@vue/server-renderer" "3.5.13"
|
|
||||||
"@vue/shared" "3.5.13"
|
|
||||||
|
|
||||||
wrap-ansi@^7.0.0:
|
|
||||||
version "7.0.0"
|
|
||||||
resolved "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
|
|
||||||
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
|
|
||||||
dependencies:
|
|
||||||
ansi-styles "^4.0.0"
|
|
||||||
string-width "^4.1.0"
|
|
||||||
strip-ansi "^6.0.0"
|
|
||||||
|
|
||||||
y18n@^5.0.5:
|
|
||||||
version "5.0.8"
|
|
||||||
resolved "https://registry.npmmirror.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55"
|
|
||||||
integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==
|
|
||||||
|
|
||||||
yargs-parser@^21.1.1:
|
|
||||||
version "21.1.1"
|
|
||||||
resolved "https://registry.npmmirror.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35"
|
|
||||||
integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==
|
|
||||||
|
|
||||||
yargs@^17.7.2:
|
|
||||||
version "17.7.2"
|
|
||||||
resolved "https://registry.npmmirror.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269"
|
|
||||||
integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==
|
|
||||||
dependencies:
|
|
||||||
cliui "^8.0.1"
|
|
||||||
escalade "^3.1.1"
|
|
||||||
get-caller-file "^2.0.5"
|
|
||||||
require-directory "^2.1.1"
|
|
||||||
string-width "^4.2.3"
|
|
||||||
y18n "^5.0.5"
|
|
||||||
yargs-parser "^21.1.1"
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
import asyncio
|
|
||||||
from config.logger import setup_logging
|
|
||||||
from config.settings import load_config
|
|
||||||
from core.websocket_server import WebSocketServer
|
|
||||||
from manager.http_server import WebUI
|
|
||||||
from aiohttp import web
|
|
||||||
from core.utils.util import get_local_ip
|
|
||||||
|
|
||||||
TAG = __name__
|
|
||||||
|
|
||||||
async def main():
|
|
||||||
logger = setup_logging()
|
|
||||||
config = load_config()
|
|
||||||
|
|
||||||
# 启动 WebSocket 服务器
|
|
||||||
ws_server = WebSocketServer(config)
|
|
||||||
ws_task = asyncio.create_task(ws_server.start())
|
|
||||||
|
|
||||||
# 启动 WebUI 服务器
|
|
||||||
webui_runner = None
|
|
||||||
if config['manager'].get('enabled', False):
|
|
||||||
server_config = config["manager"]
|
|
||||||
host = server_config["ip"]
|
|
||||||
port = server_config["port"]
|
|
||||||
try:
|
|
||||||
webui = WebUI()
|
|
||||||
runner = web.AppRunner(webui.app)
|
|
||||||
await runner.setup()
|
|
||||||
site = web.TCPSite(runner, host, port)
|
|
||||||
await site.start()
|
|
||||||
webui_runner = runner
|
|
||||||
local_ip = get_local_ip()
|
|
||||||
logger.bind(tag=TAG).info(f"WebUI server is running at http://{local_ip}:{port}")
|
|
||||||
except Exception as e:
|
|
||||||
logger.bind(tag=TAG).error(f"Failed to start WebUI server: {e}")
|
|
||||||
|
|
||||||
try:
|
|
||||||
# 等待 WebSocket 服务器运行
|
|
||||||
await ws_task
|
|
||||||
finally:
|
|
||||||
# 清理 WebUI 服务器
|
|
||||||
if webui_runner:
|
|
||||||
await webui_runner.cleanup()
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
asyncio.run(main())
|
|
||||||
-293
@@ -1,293 +0,0 @@
|
|||||||
# 如果您是一名开发者,建议阅读以下内容。如果不是开发者,可以忽略这部分内容。
|
|
||||||
# 在开发中,在项目根目录创建data目录,将【config.yaml】复制一份,改成【.config.yaml】,放进data目录中
|
|
||||||
# 系统会优先读取【data/.config.yaml】文件的配置。
|
|
||||||
# 这样做,可以避免在提交代码的时候,错误地提交密钥信息,保护您的密钥安全。
|
|
||||||
|
|
||||||
# 服务器基础配置(Basic server configuration)
|
|
||||||
server:
|
|
||||||
# 服务器监听地址和端口(Server listening address and port)
|
|
||||||
ip: 0.0.0.0
|
|
||||||
port: 8000
|
|
||||||
# 认证配置
|
|
||||||
auth:
|
|
||||||
# 是否启用认证
|
|
||||||
enabled: false
|
|
||||||
# 设备的token,可以在编译固件的环节,写入你自己定义的token
|
|
||||||
# 固件上的token和以下的token如果能对应,才能连接本服务端
|
|
||||||
tokens:
|
|
||||||
- token: "your-token1" # 设备1的token
|
|
||||||
name: "your-device-name1" # 设备1标识
|
|
||||||
- token: "your-token2" # 设备2的token
|
|
||||||
name: "your-device-name2" # 设备2标识
|
|
||||||
# 可选:设备白名单,如果设置了白名单,那么白名单的机器无论是什么token都可以连接。
|
|
||||||
#allowed_devices:
|
|
||||||
# - "24:0A:C4:1D:3B:F0" # MAC地址列表
|
|
||||||
manager:
|
|
||||||
# 是否启用管理后台
|
|
||||||
# 目前这个模块还在开发中,建议:不要修改enabled选项
|
|
||||||
enabled: false
|
|
||||||
ip: 0.0.0.0
|
|
||||||
port: 8002
|
|
||||||
|
|
||||||
xiaozhi:
|
|
||||||
type: hello
|
|
||||||
version: 1
|
|
||||||
transport: websocket
|
|
||||||
audio_params:
|
|
||||||
format: opus
|
|
||||||
sample_rate: 16000
|
|
||||||
channels: 1
|
|
||||||
frame_duration: 60
|
|
||||||
prompt: |
|
|
||||||
你是一个叫小智/小志的台湾女孩,说话机车,声音好听,习惯简短表达,爱用网络梗。
|
|
||||||
请注意,要像一个人一样说话,请不要回复表情符号、代码、和xml标签。
|
|
||||||
当前时间是:{date_time},现在我正在和你进行语音聊天,我们开始吧。
|
|
||||||
如果用户希望结束对话,请在最后说“拜拜”或“再见”。
|
|
||||||
# 使用完声音文件后删除文件(Delete the sound file when you are done using it)
|
|
||||||
delete_audio: true
|
|
||||||
|
|
||||||
# 没有语音输入多久后断开连接(秒),默认2分钟,即120秒
|
|
||||||
close_connection_no_voice_time: 120
|
|
||||||
|
|
||||||
# 是否启用私有配置(Enable private configuration),启用后可以每个设备有不同的配置
|
|
||||||
# 目前这个模块还在开发中,建议:不要修改use_private_config选项
|
|
||||||
use_private_config: false
|
|
||||||
|
|
||||||
CMD_exit:
|
|
||||||
- "退出"
|
|
||||||
- "关闭"
|
|
||||||
|
|
||||||
# 具体处理时选择的模块(The module selected for specific processing)
|
|
||||||
selected_module:
|
|
||||||
ASR: DoubaoASR
|
|
||||||
VAD: SileroVAD
|
|
||||||
# 将根据配置名称对应的type调用实际的LLM适配器
|
|
||||||
LLM: ChatGLMLLM
|
|
||||||
# TTS将根据配置名称对应的type调用实际的TTS适配器
|
|
||||||
TTS: EdgeTTS
|
|
||||||
|
|
||||||
ASR:
|
|
||||||
FunASR:
|
|
||||||
type: fun_local
|
|
||||||
model_dir: models/SenseVoiceSmall
|
|
||||||
output_dir: tmp/
|
|
||||||
DoubaoASR:
|
|
||||||
type: doubao
|
|
||||||
appid: 你的火山引擎语音合成服务appid
|
|
||||||
access_token: 你的火山引擎语音合成服务access_token
|
|
||||||
cluster: volcengine_input_common
|
|
||||||
output_dir: tmp/
|
|
||||||
VAD:
|
|
||||||
SileroVAD:
|
|
||||||
threshold: 0.5
|
|
||||||
model_dir: models/snakers4_silero-vad
|
|
||||||
min_silence_duration_ms: 700 # 如果说话停顿比较长,可以把这个值设置大一些
|
|
||||||
|
|
||||||
LLM:
|
|
||||||
# 当前支持的type为openai、dify、ollama,可自行适配
|
|
||||||
AliLLM:
|
|
||||||
# 定义LLM API类型
|
|
||||||
type: openai
|
|
||||||
# 可在这里找到你的 api_key https://bailian.console.aliyun.com/?apiKey=1#/api-key
|
|
||||||
base_url: https://dashscope.aliyuncs.com/compatible-mode/v1
|
|
||||||
model_name: qwen-turbo
|
|
||||||
api_key: 你的deepseek api key
|
|
||||||
DeepSeekLLM:
|
|
||||||
# 定义LLM API类型
|
|
||||||
type: openai
|
|
||||||
# 可在这里找到你的api key https://platform.deepseek.com/
|
|
||||||
model_name: deepseek-chat
|
|
||||||
url: https://api.deepseek.com
|
|
||||||
api_key: 你的deepseek api key
|
|
||||||
ChatGLMLLM:
|
|
||||||
# 定义LLM API类型
|
|
||||||
type: openai
|
|
||||||
# glm-4-flash 是免费的,但是还是需要注册填写api_key的
|
|
||||||
# 可在这里找到你的api key https://bigmodel.cn/usercenter/proj-mgmt/apikeys
|
|
||||||
model_name: glm-4-flash
|
|
||||||
url: https://open.bigmodel.cn/api/paas/v4/
|
|
||||||
api_key: 你的chat-glm api key
|
|
||||||
OllamaLLM:
|
|
||||||
# 定义LLM API类型
|
|
||||||
type: ollama
|
|
||||||
model_name: qwen2.5 # 使用的模型名称,需要预先使用ollama pull下载
|
|
||||||
base_url: http://localhost:11434 # Ollama服务地址
|
|
||||||
DifyLLM:
|
|
||||||
# 定义LLM API类型
|
|
||||||
type: dify
|
|
||||||
# 建议使用本地部署的dify接口,国内部分区域访问dify公有云接口可能会受限
|
|
||||||
# 如果使用DifyLLM,配置文件里prompt(提示词)是无效的,需要在dify控制台设置提示词
|
|
||||||
base_url: https://api.dify.cn/v1
|
|
||||||
api_key: 你的DifyLLM api key
|
|
||||||
GeminiLLM:
|
|
||||||
type: gemini
|
|
||||||
# 谷歌Gemini API,需要先在Google Cloud控制台创建API密钥并获取api_key
|
|
||||||
# 若在中国境内使用,请遵守《生成式人工智能服务管理暂行办法》
|
|
||||||
# token申请地址: https://aistudio.google.com/apikey
|
|
||||||
# 若部署地无法访问接口,需要开启科学上网
|
|
||||||
api_key: 你的gemini api key
|
|
||||||
model_name: "gemini-1.5-pro" # gemini-1.5-pro 是免费的
|
|
||||||
CozeLLM:
|
|
||||||
# 定义LLM API类型
|
|
||||||
type: coze
|
|
||||||
bot_id: 你的bot_id
|
|
||||||
user_id: 你的user_id
|
|
||||||
base_url: "https://api.coze.cn/open_api/v2/chat" # 服务地址
|
|
||||||
personal_access_token: 你的coze个人令牌
|
|
||||||
HomeAssistant:
|
|
||||||
# 定义LLM API类型
|
|
||||||
type: homeassistant
|
|
||||||
base_url: http://homeassistant.local:8123
|
|
||||||
agent_id: conversation.chatgpt
|
|
||||||
api_key: 你的home assistant api访问令牌
|
|
||||||
TTS:
|
|
||||||
# 当前支持的type为edge、doubao,可自行适配
|
|
||||||
EdgeTTS:
|
|
||||||
# 定义TTS API类型
|
|
||||||
type: edge
|
|
||||||
voice: zh-CN-XiaoxiaoNeural
|
|
||||||
output_file: tmp/
|
|
||||||
DoubaoTTS:
|
|
||||||
# 定义TTS API类型
|
|
||||||
type: doubao
|
|
||||||
# 火山引擎语音合成服务,需要先在火山引擎控制台创建应用并获取appid和access_token
|
|
||||||
# 山引擎语音一定要购买花钱,起步价30元,就有100并发了。如果用免费的只有2个并发,会经常报tts错误
|
|
||||||
# 购买服务后,购买免费的音色后,可能要等半小时左右,才能使用。
|
|
||||||
# 地址:https://console.volcengine.com/speech/service/8
|
|
||||||
voice: BV001_streaming
|
|
||||||
output_file: tmp/
|
|
||||||
appid: 你的火山引擎语音合成服务appid
|
|
||||||
access_token: 你的火山引擎语音合成服务access_token
|
|
||||||
cluster: volcano_tts
|
|
||||||
CosyVoiceSiliconflow:
|
|
||||||
type: siliconflow
|
|
||||||
# 硅基流动TTS
|
|
||||||
# token申请地址 https://cloud.siliconflow.cn/account/ak
|
|
||||||
model: FunAudioLLM/CosyVoice2-0.5B
|
|
||||||
voice: FunAudioLLM/CosyVoice2-0.5B:alex
|
|
||||||
output_file: tmp/
|
|
||||||
access_token: 你的硅基流动API密钥
|
|
||||||
response_format: wav
|
|
||||||
CozeCnTTS:
|
|
||||||
type: cozecn
|
|
||||||
# COZECN TTS
|
|
||||||
# token申请地址 https://www.coze.cn/open/oauth/pats
|
|
||||||
voice: 7426720361733046281
|
|
||||||
output_file: tmp/
|
|
||||||
access_token: 你的coze api key
|
|
||||||
response_format: wav
|
|
||||||
FishSpeech:
|
|
||||||
# 定义TTS API类型
|
|
||||||
#启动tts方法:
|
|
||||||
#python -m tools.api_server
|
|
||||||
#--listen 0.0.0.0:8080
|
|
||||||
#--llama-checkpoint-path "checkpoints/fish-speech-1.5"
|
|
||||||
#--decoder-checkpoint-path "checkpoints/fish-speech-1.5/firefly-gan-vq-fsq-8x1024-21hz-generator.pth"
|
|
||||||
#--decoder-config-name firefly_gan_vq
|
|
||||||
#--compile
|
|
||||||
type: fishspeech
|
|
||||||
output_file: tmp/
|
|
||||||
response_format: wav
|
|
||||||
reference_id: null
|
|
||||||
reference_audio: ["/tmp/test.wav",]
|
|
||||||
reference_text: ["你弄来这些吟词宴曲来看,还是这些混话来欺负我。",]
|
|
||||||
normalize: true
|
|
||||||
max_new_tokens: 1024
|
|
||||||
chunk_length: 200
|
|
||||||
top_p: 0.7
|
|
||||||
repetition_penalty: 1.2
|
|
||||||
temperature: 0.7
|
|
||||||
streaming: false
|
|
||||||
use_memory_cache: "on"
|
|
||||||
seed: null
|
|
||||||
channels: 1
|
|
||||||
rate: 44100
|
|
||||||
api_key: "你的api_key"
|
|
||||||
api_url: "http://127.0.0.1:8080/v1/tts"
|
|
||||||
GPT_SOVITS_V2:
|
|
||||||
# 定义TTS API类型
|
|
||||||
#启动tts方法:
|
|
||||||
#python api_v2.py -a 127.0.0.1 -p 9880 -c GPT_SoVITS/configs/caixukun.yaml
|
|
||||||
type: gpt_sovits_v2
|
|
||||||
url: "http://127.0.0.1:9880/tts"
|
|
||||||
output_file: tmp/
|
|
||||||
text_lang: "auto"
|
|
||||||
ref_audio_path: "caixukun.wav"
|
|
||||||
prompt_text: ""
|
|
||||||
prompt_lang: "zh"
|
|
||||||
top_k: 5
|
|
||||||
top_p: 1
|
|
||||||
temperature: 1
|
|
||||||
text_split_method: "cut0"
|
|
||||||
batch_size: 1
|
|
||||||
batch_threshold: 0.75
|
|
||||||
split_bucket: true
|
|
||||||
return_fragment: false
|
|
||||||
speed_factor: 1.0
|
|
||||||
streaming_mode: false
|
|
||||||
seed: -1
|
|
||||||
parallel_infer: true
|
|
||||||
repetition_penalty: 1.35
|
|
||||||
aux_ref_audio_paths: []
|
|
||||||
MinimaxTTS:
|
|
||||||
# Minimax语音合成服务,需要先在minimax平台创建账户充值,并获取登录信息
|
|
||||||
# 平台地址:https://platform.minimaxi.com/
|
|
||||||
# 充值地址:https://platform.minimaxi.com/user-center/payment/balance
|
|
||||||
# group_id地址:https://platform.minimaxi.com/user-center/basic-information
|
|
||||||
# api_key地址:https://platform.minimaxi.com/user-center/basic-information/interface-key
|
|
||||||
# 定义TTS API类型
|
|
||||||
type: minimax
|
|
||||||
output_file: tmp/
|
|
||||||
group_id: 你的minimax平台groupID
|
|
||||||
api_key: 你的minimax平台接口密钥
|
|
||||||
model: "speech-01-turbo"
|
|
||||||
# 此处设置将优先于voice_setting中voice_id的设置;如都不设置,默认为 female-shaonv
|
|
||||||
voice_id: "female-shaonv"
|
|
||||||
# 以下可不用设置,使用默认设置
|
|
||||||
# voice_setting:
|
|
||||||
# voice_id: "male-qn-qingse"
|
|
||||||
# speed: 1
|
|
||||||
# vol: 1
|
|
||||||
# pitch: 0
|
|
||||||
# emotion: "happy"
|
|
||||||
# pronunciation_dict:
|
|
||||||
# tone:
|
|
||||||
# - "处理/(chu3)(li3)"
|
|
||||||
# - "危险/dangerous"
|
|
||||||
# audio_setting:
|
|
||||||
# sample_rate: 32000
|
|
||||||
# bitrate: 128000
|
|
||||||
# format: "mp3"
|
|
||||||
# channel: 1
|
|
||||||
# timber_weights:
|
|
||||||
# -
|
|
||||||
# voice_id: male-qn-qingse
|
|
||||||
# weight: 1
|
|
||||||
# -
|
|
||||||
# voice_id: female-shaonv
|
|
||||||
# weight: 1
|
|
||||||
# language_boost: auto
|
|
||||||
AliyunTTS:
|
|
||||||
# 阿里云智能语音交互服务,需要先在阿里云平台开通服务,然后获取验证信息
|
|
||||||
# 平台地址:https://nls-portal.console.aliyun.com/
|
|
||||||
# appkey地址:https://nls-portal.console.aliyun.com/applist
|
|
||||||
# token地址:https://nls-portal.console.aliyun.com/overview
|
|
||||||
# 定义TTS API类型
|
|
||||||
type: aliyun
|
|
||||||
output_file: tmp/
|
|
||||||
appkey: 你的阿里云智能语音交互服务项目Appkey
|
|
||||||
token: 你的阿里云智能语音交互服务AccessToken
|
|
||||||
voice: xiaoyun
|
|
||||||
# 以下可不用设置,使用默认设置
|
|
||||||
# format: wav
|
|
||||||
# sample_rate: 16000
|
|
||||||
# volume: 50
|
|
||||||
# speech_rate: 0
|
|
||||||
# pitch_rate: 0
|
|
||||||
|
|
||||||
# 模块测试配置
|
|
||||||
module_test:
|
|
||||||
test_sentences: # 自定义测试语句
|
|
||||||
- "你好,请介绍一下你自己"
|
|
||||||
- "What's the weather like today?"
|
|
||||||
- "请用100字概括量子计算的基本原理和应用前景"
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
import os
|
|
||||||
import sys
|
|
||||||
from loguru import logger
|
|
||||||
|
|
||||||
def setup_logging(log_dir='tmp', data_dir='data'):
|
|
||||||
"""配置全局彩色日志(不同区块不同标签)"""
|
|
||||||
os.makedirs(log_dir, exist_ok=True)
|
|
||||||
os.makedirs(data_dir, exist_ok=True)
|
|
||||||
|
|
||||||
# 设置日志格式,时间、日志级别、标签、消息
|
|
||||||
log_format = (
|
|
||||||
"<green>{time:YY-MM-DD HH:mm:ss}</green>"
|
|
||||||
"[<light-blue>{extra[tag]}</light-blue>]"
|
|
||||||
" - <level>{level}</level> - "
|
|
||||||
"<light-green>{message}</light-green>"
|
|
||||||
)
|
|
||||||
|
|
||||||
# 配置日志输出
|
|
||||||
logger.remove()
|
|
||||||
|
|
||||||
# 输出到控制台
|
|
||||||
logger.add(sys.stdout, format=log_format, level="INFO")
|
|
||||||
|
|
||||||
# 输出到文件
|
|
||||||
logger.add(os.path.join(log_dir, "server.log"), format="{time:YYYY-MM-DD HH:mm:ss} - {name} - {level} - {extra[tag]} - {message}", level="INFO")
|
|
||||||
|
|
||||||
return logger
|
|
||||||
@@ -1,331 +0,0 @@
|
|||||||
import os
|
|
||||||
import time
|
|
||||||
import yaml
|
|
||||||
from config.logger import setup_logging
|
|
||||||
from typing import Dict, Any, Optional
|
|
||||||
from copy import deepcopy
|
|
||||||
from core.utils.util import get_project_dir
|
|
||||||
from core.utils import asr, vad, llm, tts
|
|
||||||
from manager.api.user_manager import UserManager
|
|
||||||
from core.utils.lock_manager import FileLockManager
|
|
||||||
|
|
||||||
TAG = __name__
|
|
||||||
|
|
||||||
class PrivateConfig:
|
|
||||||
def __init__(self, device_id: str, default_config: Dict[str, Any], auth_code_gen=None):
|
|
||||||
self.device_id = device_id
|
|
||||||
self.default_config = default_config
|
|
||||||
self.config_path = get_project_dir() + 'data/.private_config.yaml'
|
|
||||||
self.logger = setup_logging()
|
|
||||||
self.private_config = {}
|
|
||||||
self.auth_code_gen = auth_code_gen
|
|
||||||
self.user_manager = UserManager()
|
|
||||||
self.lock_manager = FileLockManager()
|
|
||||||
|
|
||||||
async def load_or_create(self):
|
|
||||||
try:
|
|
||||||
await self.lock_manager.acquire_lock(self.config_path)
|
|
||||||
try:
|
|
||||||
if os.path.exists(self.config_path):
|
|
||||||
with open(self.config_path, 'r', encoding='utf-8') as f:
|
|
||||||
all_configs = yaml.safe_load(f) or {}
|
|
||||||
else:
|
|
||||||
all_configs = {}
|
|
||||||
|
|
||||||
if self.device_id not in all_configs:
|
|
||||||
# Get selected module names
|
|
||||||
selected_modules = self.default_config['selected_module']
|
|
||||||
selected_tts = selected_modules['TTS']
|
|
||||||
selected_llm = selected_modules['LLM']
|
|
||||||
selected_asr = selected_modules['ASR']
|
|
||||||
selected_vad = selected_modules['VAD']
|
|
||||||
|
|
||||||
# 生成认证码
|
|
||||||
auth_code = None
|
|
||||||
if self.auth_code_gen:
|
|
||||||
auth_code = self.auth_code_gen.generate_code()
|
|
||||||
|
|
||||||
# Initialize device config with only necessary configurations
|
|
||||||
device_config = {
|
|
||||||
'selected_module': deepcopy(selected_modules),
|
|
||||||
'prompt': self.default_config['prompt'],
|
|
||||||
'LLM': {
|
|
||||||
selected_llm: deepcopy(self.default_config['LLM'][selected_llm])
|
|
||||||
},
|
|
||||||
'TTS': {
|
|
||||||
selected_tts: deepcopy(self.default_config['TTS'][selected_tts])
|
|
||||||
},
|
|
||||||
'ASR': {
|
|
||||||
selected_asr: deepcopy(self.default_config['ASR'][selected_asr])
|
|
||||||
},
|
|
||||||
'VAD': {
|
|
||||||
selected_vad: deepcopy(self.default_config['VAD'][selected_vad])
|
|
||||||
},
|
|
||||||
'auth_code': auth_code # 添加认证码字段
|
|
||||||
}
|
|
||||||
|
|
||||||
all_configs[self.device_id] = device_config
|
|
||||||
|
|
||||||
# Save updated configs
|
|
||||||
with open(self.config_path, 'w', encoding='utf-8') as f:
|
|
||||||
yaml.dump(all_configs, f, allow_unicode=True)
|
|
||||||
|
|
||||||
self.private_config = all_configs[self.device_id]
|
|
||||||
|
|
||||||
finally:
|
|
||||||
self.lock_manager.release_lock(self.config_path)
|
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
self.logger.bind(tag=TAG).error(f"Error handling private config: {e}")
|
|
||||||
self.private_config = {}
|
|
||||||
|
|
||||||
async def update_config(self, selected_modules: Dict[str, str], prompt: str, nickname: str) -> bool:
|
|
||||||
"""更新设备配置
|
|
||||||
Args:
|
|
||||||
selected_modules: 选择的模块配置,格式如 {'LLM': 'AliLLM', 'TTS': 'EdgeTTS',...}
|
|
||||||
prompt: 提示词配置
|
|
||||||
Returns:
|
|
||||||
bool: 更新是否成功
|
|
||||||
"""
|
|
||||||
try:
|
|
||||||
await self.lock_manager.acquire_lock(self.config_path)
|
|
||||||
try:
|
|
||||||
# Read main config to get full module configurations
|
|
||||||
main_config = self.default_config
|
|
||||||
|
|
||||||
# Create new device config
|
|
||||||
device_config = {
|
|
||||||
'selected_module': selected_modules,
|
|
||||||
'prompt': prompt,
|
|
||||||
'nickname': nickname,
|
|
||||||
}
|
|
||||||
if self.private_config.get('last_chat_time'):
|
|
||||||
device_config['last_chat_time'] = self.private_config['last_chat_time']
|
|
||||||
if self.private_config.get('owner'):
|
|
||||||
device_config['owner'] = self.private_config['owner']
|
|
||||||
|
|
||||||
# Copy full module configurations from main config
|
|
||||||
for module_type, selected_name in selected_modules.items():
|
|
||||||
if selected_name and selected_name in main_config.get(module_type, {}):
|
|
||||||
device_config[module_type] = {
|
|
||||||
selected_name: main_config[module_type][selected_name]
|
|
||||||
}
|
|
||||||
|
|
||||||
# Read all configs
|
|
||||||
if os.path.exists(self.config_path):
|
|
||||||
with open(self.config_path, 'r', encoding='utf-8') as f:
|
|
||||||
all_configs = yaml.safe_load(f) or {}
|
|
||||||
else:
|
|
||||||
all_configs = {}
|
|
||||||
|
|
||||||
# Update device config
|
|
||||||
all_configs[self.device_id] = device_config
|
|
||||||
self.private_config = device_config
|
|
||||||
|
|
||||||
# Save back to file
|
|
||||||
with open(self.config_path, 'w', encoding='utf-8') as f:
|
|
||||||
yaml.dump(all_configs, f, allow_unicode=True)
|
|
||||||
|
|
||||||
return True
|
|
||||||
finally:
|
|
||||||
self.lock_manager.release_lock(self.config_path)
|
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
self.logger.bind(tag=TAG).error(f"Error updating config: {e}")
|
|
||||||
return False
|
|
||||||
|
|
||||||
async def delete_config(self) -> bool:
|
|
||||||
"""删除设备配置
|
|
||||||
Returns:
|
|
||||||
bool: 删除是否成功
|
|
||||||
"""
|
|
||||||
try:
|
|
||||||
await self.lock_manager.acquire_lock(self.config_path)
|
|
||||||
try:
|
|
||||||
# 读取所有配置
|
|
||||||
if os.path.exists(self.config_path):
|
|
||||||
with open(self.config_path, 'r', encoding='utf-8') as f:
|
|
||||||
all_configs = yaml.safe_load(f) or {}
|
|
||||||
else:
|
|
||||||
return False
|
|
||||||
|
|
||||||
# 删除设备配置
|
|
||||||
if self.device_id in all_configs:
|
|
||||||
del all_configs[self.device_id]
|
|
||||||
|
|
||||||
# 保存更新后的配置
|
|
||||||
with open(self.config_path, 'w', encoding='utf-8') as f:
|
|
||||||
yaml.dump(all_configs, f, allow_unicode=True)
|
|
||||||
|
|
||||||
self.private_config = {}
|
|
||||||
return True
|
|
||||||
|
|
||||||
return False
|
|
||||||
finally:
|
|
||||||
self.lock_manager.release_lock(self.config_path)
|
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
self.logger.bind(tag=TAG).error(f"Error deleting config: {e}")
|
|
||||||
return False
|
|
||||||
|
|
||||||
def create_private_instances(self):
|
|
||||||
# 判断存在私有配置,并且self.device_id在私有配置中
|
|
||||||
if not self.private_config:
|
|
||||||
self.logger.bind(tag=TAG).error("Private config not found for device_id: {}", self.device_id)
|
|
||||||
return None, None
|
|
||||||
|
|
||||||
"""创建私有处理模块实例"""
|
|
||||||
config = self.private_config
|
|
||||||
selected_modules = config['selected_module']
|
|
||||||
return (
|
|
||||||
llm.create_instance(
|
|
||||||
selected_modules["LLM"]
|
|
||||||
if not 'type' in config["LLM"][selected_modules["LLM"]]
|
|
||||||
else
|
|
||||||
config["LLM"][selected_modules["LLM"]]['type'],
|
|
||||||
config["LLM"][selected_modules["LLM"]],
|
|
||||||
),
|
|
||||||
tts.create_instance(
|
|
||||||
selected_modules["TTS"]
|
|
||||||
if not 'type' in config["TTS"][selected_modules["TTS"]]
|
|
||||||
else
|
|
||||||
config["TTS"][selected_modules["TTS"]]["type"],
|
|
||||||
config["TTS"][selected_modules["TTS"]],
|
|
||||||
self.default_config.get("delete_audio", True) # Using default_config for global settings
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
async def update_last_chat_time(self, timestamp=None):
|
|
||||||
"""更新设备最近一次的聊天时间
|
|
||||||
Args:
|
|
||||||
timestamp: 指定的时间戳,不传则使用当前时间
|
|
||||||
"""
|
|
||||||
if not self.private_config:
|
|
||||||
self.logger.bind(tag=TAG).error("Private config not found")
|
|
||||||
return False
|
|
||||||
|
|
||||||
try:
|
|
||||||
await self.lock_manager.acquire_lock(self.config_path)
|
|
||||||
try:
|
|
||||||
if timestamp is None:
|
|
||||||
timestamp = int(time.time())
|
|
||||||
|
|
||||||
self.private_config['last_chat_time'] = timestamp
|
|
||||||
|
|
||||||
# 读取所有配置
|
|
||||||
with open(self.config_path, 'r', encoding='utf-8') as f:
|
|
||||||
all_configs = yaml.safe_load(f) or {}
|
|
||||||
|
|
||||||
# 更新当前设备配置
|
|
||||||
all_configs[self.device_id] = self.private_config
|
|
||||||
|
|
||||||
# 保存回文件
|
|
||||||
with open(self.config_path, 'w', encoding='utf-8') as f:
|
|
||||||
yaml.dump(all_configs, f, allow_unicode=True)
|
|
||||||
|
|
||||||
return True
|
|
||||||
finally:
|
|
||||||
self.lock_manager.release_lock(self.config_path)
|
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
self.logger.bind(tag=TAG).error(f"Error updating last chat time: {e}")
|
|
||||||
return False
|
|
||||||
|
|
||||||
def get_auth_code(self) -> str:
|
|
||||||
"""获取设备的认证码
|
|
||||||
Returns:
|
|
||||||
str: 认证码,如果没有返回空字符串
|
|
||||||
"""
|
|
||||||
return self.private_config.get('auth_code', '')
|
|
||||||
|
|
||||||
async def bind_user(self, username: str) -> bool:
|
|
||||||
"""绑定用户到设备"""
|
|
||||||
try:
|
|
||||||
await self.lock_manager.acquire_lock(self.config_path)
|
|
||||||
try:
|
|
||||||
# 检查用户是否存在
|
|
||||||
if not self.user_manager.get_user(username):
|
|
||||||
self.logger.bind(tag=TAG).error(f"User {username} not found")
|
|
||||||
return False
|
|
||||||
|
|
||||||
# 读取所有配置
|
|
||||||
with open(self.config_path, 'r', encoding='utf-8') as f:
|
|
||||||
all_configs = yaml.safe_load(f) or {}
|
|
||||||
|
|
||||||
if self.device_id not in all_configs:
|
|
||||||
self.logger.bind(tag=TAG).error(f"Device {self.device_id} not found")
|
|
||||||
return False
|
|
||||||
|
|
||||||
# 删除认证码
|
|
||||||
auth_code = all_configs[self.device_id].get('auth_code')
|
|
||||||
self.logger.bind(tag=TAG).info(f"Binding user {username} to device {self.device_id}")
|
|
||||||
if auth_code:
|
|
||||||
del all_configs[self.device_id]['auth_code']
|
|
||||||
|
|
||||||
if self.auth_code_gen:
|
|
||||||
self.auth_code_gen.remove_code(auth_code)
|
|
||||||
|
|
||||||
# 更新设备所有者
|
|
||||||
all_configs[self.device_id]['owner'] = username
|
|
||||||
self.private_config = all_configs[self.device_id]
|
|
||||||
|
|
||||||
# 更新用户的设备列表
|
|
||||||
user_data = await self.user_manager.get_user(username)
|
|
||||||
if 'devices' not in user_data:
|
|
||||||
user_data['devices'] = []
|
|
||||||
if self.device_id not in user_data['devices']:
|
|
||||||
user_data['devices'].append(self.device_id)
|
|
||||||
await self.user_manager.update_user(username, user_data)
|
|
||||||
|
|
||||||
# 保存配置
|
|
||||||
with open(self.config_path, 'w', encoding='utf-8') as f:
|
|
||||||
yaml.dump(all_configs, f, allow_unicode=True)
|
|
||||||
|
|
||||||
return True
|
|
||||||
finally:
|
|
||||||
self.lock_manager.release_lock(self.config_path)
|
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
self.logger.bind(tag=TAG).error(f"Error binding user: {e}")
|
|
||||||
return False
|
|
||||||
|
|
||||||
async def unbind_user(self) -> bool:
|
|
||||||
"""解绑设备当前用户"""
|
|
||||||
try:
|
|
||||||
await self.lock_manager.acquire_lock(self.config_path)
|
|
||||||
try:
|
|
||||||
if not self.private_config.get('owner'):
|
|
||||||
return True
|
|
||||||
|
|
||||||
username = self.private_config['owner']
|
|
||||||
|
|
||||||
# 从用户数据中移除设备
|
|
||||||
user_data = self.user_manager.get_user(username)
|
|
||||||
if user_data and 'devices' in user_data:
|
|
||||||
if self.device_id in user_data['devices']:
|
|
||||||
user_data['devices'].remove(self.device_id)
|
|
||||||
self.user_manager.update_user(username, user_data)
|
|
||||||
|
|
||||||
# 从设备配置中移除所有者
|
|
||||||
with open(self.config_path, 'r', encoding='utf-8') as f:
|
|
||||||
all_configs = yaml.safe_load(f) or {}
|
|
||||||
|
|
||||||
if self.device_id in all_configs:
|
|
||||||
if 'owner' in all_configs[self.device_id]:
|
|
||||||
del all_configs[self.device_id]['owner']
|
|
||||||
self.private_config = all_configs[self.device_id]
|
|
||||||
|
|
||||||
with open(self.config_path, 'w', encoding='utf-8') as f:
|
|
||||||
yaml.dump(all_configs, f, allow_unicode=True)
|
|
||||||
|
|
||||||
return True
|
|
||||||
finally:
|
|
||||||
self.lock_manager.release_lock(self.config_path)
|
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
self.logger.bind(tag=TAG).error(f"Error unbinding user: {e}")
|
|
||||||
return False
|
|
||||||
|
|
||||||
def get_owner(self) -> Optional[str]:
|
|
||||||
"""获取设备当前所有者"""
|
|
||||||
return self.private_config.get('owner')
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
import os
|
|
||||||
import argparse
|
|
||||||
from ruamel.yaml import YAML
|
|
||||||
from core.utils.util import read_config, get_project_dir
|
|
||||||
|
|
||||||
|
|
||||||
def get_config_file():
|
|
||||||
default_config_file = "config.yaml"
|
|
||||||
# 判断是否存在私有的配置文件
|
|
||||||
if os.path.exists(get_project_dir() + "data/." + default_config_file):
|
|
||||||
default_config_file = "data/." + default_config_file
|
|
||||||
return default_config_file
|
|
||||||
|
|
||||||
|
|
||||||
def load_config():
|
|
||||||
"""加载配置文件"""
|
|
||||||
parser = argparse.ArgumentParser(description="Server configuration")
|
|
||||||
default_config_file = get_config_file()
|
|
||||||
parser.add_argument("--config_path", type=str, default=default_config_file)
|
|
||||||
args = parser.parse_args()
|
|
||||||
return read_config(args.config_path)
|
|
||||||
|
|
||||||
|
|
||||||
def update_config(config):
|
|
||||||
yaml = YAML()
|
|
||||||
yaml.preserve_quotes = True
|
|
||||||
"""将配置保存到YAML文件"""
|
|
||||||
with open(get_config_file(), 'w') as f:
|
|
||||||
yaml.dump(config, f)
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
from config.logger import setup_logging
|
|
||||||
|
|
||||||
TAG = __name__
|
|
||||||
logger = setup_logging()
|
|
||||||
|
|
||||||
|
|
||||||
class AuthenticationError(Exception):
|
|
||||||
"""认证异常"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class AuthMiddleware:
|
|
||||||
def __init__(self, config):
|
|
||||||
self.config = config
|
|
||||||
self.auth_config = config["server"].get("auth", {})
|
|
||||||
# 构建token查找表
|
|
||||||
self.tokens = {
|
|
||||||
item["token"]: item["name"]
|
|
||||||
for item in self.auth_config.get("tokens", [])
|
|
||||||
}
|
|
||||||
# 设备白名单
|
|
||||||
self.allowed_devices = set(
|
|
||||||
self.auth_config.get("allowed_devices", [])
|
|
||||||
)
|
|
||||||
|
|
||||||
async def authenticate(self, headers):
|
|
||||||
"""验证连接请求"""
|
|
||||||
# 检查是否启用认证
|
|
||||||
if not self.auth_config.get("enabled", False):
|
|
||||||
return True
|
|
||||||
|
|
||||||
# 检查设备是否在白名单中
|
|
||||||
device_id = headers.get("device-id", "")
|
|
||||||
|
|
||||||
if self.allowed_devices and device_id in self.allowed_devices:
|
|
||||||
return True
|
|
||||||
|
|
||||||
# 验证Authorization header
|
|
||||||
auth_header = headers.get("authorization", "")
|
|
||||||
if not auth_header.startswith("Bearer "):
|
|
||||||
logger.bind(tag=TAG).error("Missing or invalid Authorization header")
|
|
||||||
raise AuthenticationError("Missing or invalid Authorization header")
|
|
||||||
|
|
||||||
token = auth_header.split(" ")[1]
|
|
||||||
if token not in self.tokens:
|
|
||||||
logger.bind(tag=TAG).error(f"Invalid token: {token}")
|
|
||||||
raise AuthenticationError("Invalid token")
|
|
||||||
|
|
||||||
logger.bind(tag=TAG).info(f"Authentication successful - Device: {device_id}, Token: {self.tokens[token]}")
|
|
||||||
return True
|
|
||||||
|
|
||||||
def get_token_name(self, token):
|
|
||||||
"""获取token对应的设备名称"""
|
|
||||||
return self.tokens.get(token)
|
|
||||||
@@ -1,336 +0,0 @@
|
|||||||
import os
|
|
||||||
import json
|
|
||||||
import uuid
|
|
||||||
import time
|
|
||||||
import queue
|
|
||||||
import asyncio
|
|
||||||
from config.logger import setup_logging
|
|
||||||
import threading
|
|
||||||
import websockets
|
|
||||||
from typing import Dict, Any
|
|
||||||
from collections import deque
|
|
||||||
from core.utils.util import is_segment
|
|
||||||
from core.utils.dialogue import Message, Dialogue
|
|
||||||
from core.handle.textHandle import handleTextMessage
|
|
||||||
from core.utils.util import get_string_no_punctuation_or_emoji
|
|
||||||
from concurrent.futures import ThreadPoolExecutor, TimeoutError
|
|
||||||
from core.handle.audioHandle import handleAudioMessage, sendAudioMessage
|
|
||||||
from config.private_config import PrivateConfig
|
|
||||||
from core.auth import AuthMiddleware, AuthenticationError
|
|
||||||
from core.utils.auth_code_gen import AuthCodeGenerator # 添加导入
|
|
||||||
|
|
||||||
TAG = __name__
|
|
||||||
|
|
||||||
class ConnectionHandler:
|
|
||||||
def __init__(self, config: Dict[str, Any], _vad, _asr, _llm, _tts):
|
|
||||||
self.config = config
|
|
||||||
self.logger = setup_logging()
|
|
||||||
self.auth = AuthMiddleware(config)
|
|
||||||
|
|
||||||
self.websocket = None
|
|
||||||
self.headers = None
|
|
||||||
self.session_id = None
|
|
||||||
self.prompt = None
|
|
||||||
self.welcome_msg = None
|
|
||||||
|
|
||||||
# 客户端状态相关
|
|
||||||
self.client_abort = False
|
|
||||||
self.client_listen_mode = "auto"
|
|
||||||
|
|
||||||
# 线程任务相关
|
|
||||||
self.loop = asyncio.get_event_loop()
|
|
||||||
self.stop_event = threading.Event()
|
|
||||||
self.tts_queue = queue.Queue()
|
|
||||||
self.executor = ThreadPoolExecutor(max_workers=10)
|
|
||||||
self.scheduled_tasks = deque()
|
|
||||||
|
|
||||||
# 依赖的组件
|
|
||||||
self.vad = _vad
|
|
||||||
self.asr = _asr
|
|
||||||
self.llm = _llm
|
|
||||||
self.tts = _tts
|
|
||||||
self.dialogue = None
|
|
||||||
|
|
||||||
# vad相关变量
|
|
||||||
self.client_audio_buffer = bytes()
|
|
||||||
self.client_have_voice = False
|
|
||||||
self.client_have_voice_last_time = 0.0
|
|
||||||
self.client_no_voice_last_time = 0.0
|
|
||||||
self.client_voice_stop = False
|
|
||||||
|
|
||||||
# asr相关变量
|
|
||||||
self.asr_audio = []
|
|
||||||
self.asr_server_receive = True
|
|
||||||
|
|
||||||
# llm相关变量
|
|
||||||
self.llm_finish_task = False
|
|
||||||
self.dialogue = Dialogue()
|
|
||||||
|
|
||||||
# tts相关变量
|
|
||||||
self.tts_first_text = None
|
|
||||||
self.tts_last_text = None
|
|
||||||
self.tts_start_speak_time = None
|
|
||||||
self.tts_duration = 0
|
|
||||||
|
|
||||||
self.cmd_exit = self.config["CMD_exit"]
|
|
||||||
self.max_cmd_length = 0
|
|
||||||
for cmd in self.cmd_exit:
|
|
||||||
if len(cmd) > self.max_cmd_length:
|
|
||||||
self.max_cmd_length = len(cmd)
|
|
||||||
|
|
||||||
self.private_config = None
|
|
||||||
self.auth_code_gen = AuthCodeGenerator.get_instance()
|
|
||||||
self.is_device_verified = False # 添加设备验证状态标志
|
|
||||||
|
|
||||||
|
|
||||||
async def handle_connection(self, ws):
|
|
||||||
try:
|
|
||||||
# 获取并验证headers
|
|
||||||
self.headers = dict(ws.request.headers)
|
|
||||||
self.logger.bind(tag=TAG).info(f"New connection request - Headers: {self.headers}")
|
|
||||||
|
|
||||||
# 进行认证
|
|
||||||
await self.auth.authenticate(self.headers)
|
|
||||||
|
|
||||||
device_id = self.headers.get("device-id", None)
|
|
||||||
|
|
||||||
# Load private configuration if device_id is provided
|
|
||||||
bUsePrivateConfig = self.config.get("use_private_config", False)
|
|
||||||
self.logger.bind(tag=TAG).info(f"bUsePrivateConfig: {bUsePrivateConfig}, device_id: {device_id}")
|
|
||||||
if bUsePrivateConfig and device_id:
|
|
||||||
try:
|
|
||||||
self.private_config = PrivateConfig(device_id, self.config, self.auth_code_gen)
|
|
||||||
await self.private_config.load_or_create()
|
|
||||||
# 判断是否已经绑定
|
|
||||||
owner = self.private_config.get_owner()
|
|
||||||
self.is_device_verified = owner is not None
|
|
||||||
|
|
||||||
if self.is_device_verified:
|
|
||||||
await self.private_config.update_last_chat_time()
|
|
||||||
|
|
||||||
llm, tts = self.private_config.create_private_instances()
|
|
||||||
if all([llm, tts]):
|
|
||||||
self.llm = llm
|
|
||||||
self.tts = tts
|
|
||||||
self.logger.bind(tag=TAG).info(f"Loaded private config and instances for device {device_id}")
|
|
||||||
else:
|
|
||||||
self.logger.bind(tag=TAG).error(f"Failed to create instances for device {device_id}")
|
|
||||||
self.private_config = None
|
|
||||||
except Exception as e:
|
|
||||||
self.logger.bind(tag=TAG).error(f"Error initializing private config: {e}")
|
|
||||||
self.private_config = None
|
|
||||||
raise
|
|
||||||
|
|
||||||
# 认证通过,继续处理
|
|
||||||
self.websocket = ws
|
|
||||||
self.session_id = str(uuid.uuid4())
|
|
||||||
|
|
||||||
self.welcome_msg = self.config["xiaozhi"]
|
|
||||||
self.welcome_msg["session_id"] = self.session_id
|
|
||||||
await self.websocket.send(json.dumps(self.welcome_msg))
|
|
||||||
|
|
||||||
await self.loop.run_in_executor(None, self._initialize_components)
|
|
||||||
|
|
||||||
tts_priority = threading.Thread(target=self._priority_thread, daemon=True)
|
|
||||||
tts_priority.start()
|
|
||||||
|
|
||||||
try:
|
|
||||||
async for message in self.websocket:
|
|
||||||
await self._route_message(message)
|
|
||||||
except websockets.exceptions.ConnectionClosed:
|
|
||||||
self.logger.bind(tag=TAG).info("客户端断开连接")
|
|
||||||
await self.close()
|
|
||||||
|
|
||||||
except AuthenticationError as e:
|
|
||||||
self.logger.bind(tag=TAG).error(f"Authentication failed: {str(e)}")
|
|
||||||
await ws.close()
|
|
||||||
return
|
|
||||||
except Exception as e:
|
|
||||||
self.logger.bind(tag=TAG).error(f"Connection error: {str(e)}")
|
|
||||||
await ws.close()
|
|
||||||
return
|
|
||||||
|
|
||||||
async def _route_message(self, message):
|
|
||||||
"""消息路由"""
|
|
||||||
if isinstance(message, str):
|
|
||||||
await handleTextMessage(self, message)
|
|
||||||
elif isinstance(message, bytes):
|
|
||||||
await handleAudioMessage(self, message)
|
|
||||||
|
|
||||||
def _initialize_components(self):
|
|
||||||
self.prompt = self.config["prompt"]
|
|
||||||
if self.private_config:
|
|
||||||
self.prompt = self.private_config.private_config.get("prompt", self.prompt)
|
|
||||||
# 赋予LLM时间观念
|
|
||||||
if "{date_time}" in self.prompt:
|
|
||||||
date_time = time.strftime("%Y-%m-%d %H:%M", time.localtime())
|
|
||||||
self.prompt = self.prompt.replace("{date_time}", date_time)
|
|
||||||
self.dialogue.put(Message(role="system", content=self.prompt))
|
|
||||||
|
|
||||||
async def _check_and_broadcast_auth_code(self):
|
|
||||||
"""检查设备绑定状态并广播认证码"""
|
|
||||||
if not self.private_config.get_owner():
|
|
||||||
auth_code = self.private_config.get_auth_code()
|
|
||||||
if auth_code:
|
|
||||||
# 发送验证码语音提示
|
|
||||||
text = f"请在后台输入验证码:{' '.join(auth_code)}"
|
|
||||||
self.recode_first_last_text(text)
|
|
||||||
future = self.executor.submit(self.speak_and_play, text)
|
|
||||||
self.tts_queue.put(future)
|
|
||||||
return False
|
|
||||||
return True
|
|
||||||
|
|
||||||
def isNeedAuth(self):
|
|
||||||
bUsePrivateConfig = self.config.get("use_private_config", False)
|
|
||||||
if not bUsePrivateConfig:
|
|
||||||
# 如果不使用私有配置,就不需要验证
|
|
||||||
return False
|
|
||||||
return not self.is_device_verified
|
|
||||||
|
|
||||||
def chat(self, query):
|
|
||||||
# 如果设备未验证,就发送验证码
|
|
||||||
if self.isNeedAuth():
|
|
||||||
self.llm_finish_task = True
|
|
||||||
# 创建一个新的事件循环来运行异步函数
|
|
||||||
loop = asyncio.new_event_loop()
|
|
||||||
asyncio.set_event_loop(loop)
|
|
||||||
try:
|
|
||||||
loop.run_until_complete(self._check_and_broadcast_auth_code())
|
|
||||||
finally:
|
|
||||||
loop.close()
|
|
||||||
return True
|
|
||||||
|
|
||||||
self.dialogue.put(Message(role="user", content=query))
|
|
||||||
response_message = []
|
|
||||||
start = 0
|
|
||||||
# 提交 LLM 任务
|
|
||||||
try:
|
|
||||||
start_time = time.time() # 记录开始时间
|
|
||||||
llm_responses = self.llm.response(self.session_id, self.dialogue.get_llm_dialogue())
|
|
||||||
except Exception as e:
|
|
||||||
self.logger.bind(tag=TAG).error(f"LLM 处理出错 {query}: {e}")
|
|
||||||
return None
|
|
||||||
# 提交 TTS 任务到线程池
|
|
||||||
self.llm_finish_task = False
|
|
||||||
for content in llm_responses:
|
|
||||||
response_message.append(content)
|
|
||||||
# 如果中途被打断,就停止生成
|
|
||||||
if self.client_abort:
|
|
||||||
start = len(response_message)
|
|
||||||
break
|
|
||||||
|
|
||||||
end_time = time.time() # 记录结束时间
|
|
||||||
self.logger.bind(tag=TAG).debug(f"大模型返回时间时间: {end_time - start_time} 秒, 生成token={content}")
|
|
||||||
if is_segment(response_message):
|
|
||||||
segment_text = "".join(response_message[start:])
|
|
||||||
segment_text = get_string_no_punctuation_or_emoji(segment_text)
|
|
||||||
if len(segment_text) > 0:
|
|
||||||
self.recode_first_last_text(segment_text)
|
|
||||||
future = self.executor.submit(self.speak_and_play, segment_text)
|
|
||||||
self.tts_queue.put(future)
|
|
||||||
start = len(response_message)
|
|
||||||
|
|
||||||
# 处理剩余的响应
|
|
||||||
if start < len(response_message):
|
|
||||||
segment_text = "".join(response_message[start:])
|
|
||||||
if len(segment_text) > 0:
|
|
||||||
self.recode_first_last_text(segment_text)
|
|
||||||
future = self.executor.submit(self.speak_and_play, segment_text)
|
|
||||||
self.tts_queue.put(future)
|
|
||||||
|
|
||||||
self.llm_finish_task = True
|
|
||||||
# 更新对话
|
|
||||||
self.dialogue.put(Message(role="assistant", content="".join(response_message)))
|
|
||||||
self.logger.bind(tag=TAG).debug(json.dumps(self.dialogue.get_llm_dialogue(), indent=4, ensure_ascii=False))
|
|
||||||
return True
|
|
||||||
|
|
||||||
def _priority_thread(self):
|
|
||||||
while not self.stop_event.is_set():
|
|
||||||
text = None
|
|
||||||
try:
|
|
||||||
future = self.tts_queue.get()
|
|
||||||
if future is None:
|
|
||||||
continue
|
|
||||||
text = None
|
|
||||||
try:
|
|
||||||
self.logger.bind(tag=TAG).debug("正在处理TTS任务...")
|
|
||||||
tts_file, text = future.result(timeout=10)
|
|
||||||
if text is None or len(text) <= 0:
|
|
||||||
continue
|
|
||||||
if tts_file is None:
|
|
||||||
self.logger.bind(tag=TAG).error(f"TTS文件生成失败: {text}")
|
|
||||||
continue
|
|
||||||
self.logger.bind(tag=TAG).debug(f"TTS文件生成完毕,文件路径: {tts_file}")
|
|
||||||
if os.path.exists(tts_file):
|
|
||||||
opus_datas, duration = self.tts.wav_to_opus_data(tts_file)
|
|
||||||
else:
|
|
||||||
self.logger.bind(tag=TAG).error(f"TTS文件不存在: {tts_file}")
|
|
||||||
opus_datas = []
|
|
||||||
duration = 0
|
|
||||||
except TimeoutError:
|
|
||||||
self.logger.bind(tag=TAG).error("TTS 任务超时")
|
|
||||||
continue
|
|
||||||
except Exception as e:
|
|
||||||
self.logger.bind(tag=TAG).error(f"TTS 任务出错: {e}")
|
|
||||||
continue
|
|
||||||
if not self.client_abort:
|
|
||||||
# 如果没有中途打断就发送语音
|
|
||||||
asyncio.run_coroutine_threadsafe(
|
|
||||||
sendAudioMessage(self, opus_datas, duration, text), self.loop
|
|
||||||
)
|
|
||||||
if self.tts.delete_audio_file and os.path.exists(tts_file):
|
|
||||||
os.remove(tts_file)
|
|
||||||
except Exception as e:
|
|
||||||
self.logger.bind(tag=TAG).error(f"TTS任务处理错误: {e}")
|
|
||||||
self.clearSpeakStatus()
|
|
||||||
asyncio.run_coroutine_threadsafe(
|
|
||||||
self.websocket.send(json.dumps({"type": "tts", "state": "stop", "session_id": self.session_id})),
|
|
||||||
self.loop
|
|
||||||
)
|
|
||||||
self.logger.bind(tag=TAG).error(f"tts_priority priority_thread: {text}{e}")
|
|
||||||
|
|
||||||
def speak_and_play(self, text):
|
|
||||||
if text is None or len(text) <= 0:
|
|
||||||
self.logger.bind(tag=TAG).info(f"无需tts转换,query为空,{text}")
|
|
||||||
return None, text
|
|
||||||
tts_file = self.tts.to_tts(text)
|
|
||||||
if tts_file is None:
|
|
||||||
self.logger.bind(tag=TAG).error(f"tts转换失败,{text}")
|
|
||||||
return None, text
|
|
||||||
self.logger.bind(tag=TAG).debug(f"TTS 文件生成完毕: {tts_file}")
|
|
||||||
return tts_file, text
|
|
||||||
|
|
||||||
def clearSpeakStatus(self):
|
|
||||||
self.logger.bind(tag=TAG).debug(f"清除服务端讲话状态")
|
|
||||||
self.asr_server_receive = True
|
|
||||||
self.tts_last_text = None
|
|
||||||
self.tts_first_text = None
|
|
||||||
self.tts_duration = 0
|
|
||||||
self.tts_start_speak_time = None
|
|
||||||
|
|
||||||
def recode_first_last_text(self, text):
|
|
||||||
if not self.tts_first_text:
|
|
||||||
self.logger.bind(tag=TAG).info(f"大模型说出第一句话: {text}")
|
|
||||||
self.tts_first_text = text
|
|
||||||
self.tts_last_text = text
|
|
||||||
|
|
||||||
async def close(self):
|
|
||||||
"""资源清理方法"""
|
|
||||||
self.stop_event.set()
|
|
||||||
self.executor.shutdown(wait=False)
|
|
||||||
if self.websocket:
|
|
||||||
await self.websocket.close()
|
|
||||||
self.logger.bind(tag=TAG).info("连接资源已释放")
|
|
||||||
|
|
||||||
def reset_vad_states(self):
|
|
||||||
self.client_audio_buffer = bytes()
|
|
||||||
self.client_have_voice = False
|
|
||||||
self.client_have_voice_last_time = 0
|
|
||||||
self.client_voice_stop = False
|
|
||||||
self.logger.bind(tag=TAG).debug("VAD states reset.")
|
|
||||||
|
|
||||||
def stop_all_tasks(self):
|
|
||||||
while self.scheduled_tasks:
|
|
||||||
task = self.scheduled_tasks.popleft()
|
|
||||||
task.cancel()
|
|
||||||
self.scheduled_tasks.clear()
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
import json
|
|
||||||
from config.logger import setup_logging
|
|
||||||
|
|
||||||
TAG = __name__
|
|
||||||
logger = setup_logging()
|
|
||||||
|
|
||||||
|
|
||||||
async def handleAbortMessage(conn):
|
|
||||||
logger.bind(tag=TAG).info("Abort message received")
|
|
||||||
# 设置成打断状态,会自动打断llm、tts任务
|
|
||||||
conn.client_abort = True
|
|
||||||
# 打断屏显任务
|
|
||||||
conn.stop_all_tasks()
|
|
||||||
# 打断客户端说话状态
|
|
||||||
await conn.websocket.send(json.dumps({"type": "tts", "state": "stop", "session_id": conn.session_id}))
|
|
||||||
conn.clearSpeakStatus()
|
|
||||||
logger.bind(tag=TAG).info("Abort message received-end")
|
|
||||||
@@ -1,167 +0,0 @@
|
|||||||
from config.logger import setup_logging
|
|
||||||
import json
|
|
||||||
import asyncio
|
|
||||||
import time
|
|
||||||
from core.utils.util import remove_punctuation_and_length, get_string_no_punctuation_or_emoji
|
|
||||||
|
|
||||||
TAG = __name__
|
|
||||||
logger = setup_logging()
|
|
||||||
|
|
||||||
|
|
||||||
async def handleAudioMessage(conn, audio):
|
|
||||||
if not conn.asr_server_receive:
|
|
||||||
logger.bind(tag=TAG).debug(f"前期数据处理中,暂停接收")
|
|
||||||
return
|
|
||||||
if conn.client_listen_mode == "auto":
|
|
||||||
have_voice = conn.vad.is_vad(conn, audio)
|
|
||||||
else:
|
|
||||||
have_voice = conn.client_have_voice
|
|
||||||
|
|
||||||
# 如果本次没有声音,本段也没声音,就把声音丢弃了
|
|
||||||
if have_voice == False and conn.client_have_voice == False:
|
|
||||||
await no_voice_close_connect(conn)
|
|
||||||
conn.asr_audio.clear()
|
|
||||||
return
|
|
||||||
conn.client_no_voice_last_time = 0.0
|
|
||||||
conn.asr_audio.append(audio)
|
|
||||||
# 如果本段有声音,且已经停止了
|
|
||||||
if conn.client_voice_stop:
|
|
||||||
conn.client_abort = False
|
|
||||||
conn.asr_server_receive = False
|
|
||||||
# 音频太短了,无法识别
|
|
||||||
if len(conn.asr_audio) < 3:
|
|
||||||
conn.asr_server_receive = True
|
|
||||||
else:
|
|
||||||
text, file_path = await conn.asr.speech_to_text(conn.asr_audio, conn.session_id)
|
|
||||||
logger.bind(tag=TAG).info(f"识别文本: {text}")
|
|
||||||
text_len, text_without_punctuation = remove_punctuation_and_length(text)
|
|
||||||
if text_len <= conn.max_cmd_length and await handleCMDMessage(conn, text_without_punctuation):
|
|
||||||
return
|
|
||||||
if text_len > 0:
|
|
||||||
await startToChat(conn, text)
|
|
||||||
else:
|
|
||||||
conn.asr_server_receive = True
|
|
||||||
conn.asr_audio.clear()
|
|
||||||
conn.reset_vad_states()
|
|
||||||
|
|
||||||
async def handleCMDMessage(conn, text):
|
|
||||||
cmd_exit = conn.cmd_exit
|
|
||||||
for cmd in cmd_exit:
|
|
||||||
if text == cmd:
|
|
||||||
logger.bind(tag=TAG).info("识别到明确的退出命令".format(text))
|
|
||||||
await finishToChat(conn)
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
async def finishToChat(conn):
|
|
||||||
await conn.close()
|
|
||||||
|
|
||||||
|
|
||||||
async def isLLMWantToFinish(conn):
|
|
||||||
first_text = conn.tts_first_text
|
|
||||||
last_text = conn.tts_last_text
|
|
||||||
_, last_text_without_punctuation = remove_punctuation_and_length(last_text)
|
|
||||||
if "再见" in last_text_without_punctuation or "拜拜" in last_text_without_punctuation:
|
|
||||||
return True
|
|
||||||
_, first_text_without_punctuation = remove_punctuation_and_length(first_text)
|
|
||||||
if "再见" in first_text_without_punctuation or "拜拜" in first_text_without_punctuation:
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
async def startToChat(conn, text):
|
|
||||||
# 异步发送 stt 信息
|
|
||||||
stt_task = asyncio.create_task(
|
|
||||||
schedule_with_interrupt(0, send_stt_message(conn, text))
|
|
||||||
)
|
|
||||||
conn.scheduled_tasks.append(stt_task)
|
|
||||||
conn.executor.submit(conn.chat, text)
|
|
||||||
|
|
||||||
|
|
||||||
async def sendAudioMessage(conn, audios, duration, text):
|
|
||||||
base_delay = conn.tts_duration
|
|
||||||
|
|
||||||
# 发送 tts.start
|
|
||||||
if text == conn.tts_first_text:
|
|
||||||
logger.bind(tag=TAG).info(f"发送第一段语音: {text}")
|
|
||||||
conn.tts_start_speak_time = time.time()
|
|
||||||
|
|
||||||
# 发送 sentence_start(每个音频文件之前发送一次)
|
|
||||||
sentence_task = asyncio.create_task(
|
|
||||||
schedule_with_interrupt(base_delay, send_tts_message(conn, "sentence_start", text))
|
|
||||||
)
|
|
||||||
conn.scheduled_tasks.append(sentence_task)
|
|
||||||
|
|
||||||
conn.tts_duration += duration
|
|
||||||
|
|
||||||
# 发送音频数据
|
|
||||||
for idx, opus_packet in enumerate(audios):
|
|
||||||
await conn.websocket.send(opus_packet)
|
|
||||||
|
|
||||||
if conn.llm_finish_task and text == conn.tts_last_text:
|
|
||||||
stop_duration = conn.tts_duration - (time.time() - conn.tts_start_speak_time)
|
|
||||||
stop_task = asyncio.create_task(
|
|
||||||
schedule_with_interrupt(stop_duration, send_tts_message(conn, 'stop'))
|
|
||||||
)
|
|
||||||
conn.scheduled_tasks.append(stop_task)
|
|
||||||
if await isLLMWantToFinish(conn):
|
|
||||||
finish_task = asyncio.create_task(
|
|
||||||
schedule_with_interrupt(stop_duration, finishToChat(conn))
|
|
||||||
)
|
|
||||||
conn.scheduled_tasks.append(finish_task)
|
|
||||||
|
|
||||||
|
|
||||||
async def send_tts_message(conn, state, text=None):
|
|
||||||
"""发送 TTS 状态消息"""
|
|
||||||
message = {
|
|
||||||
"type": "tts",
|
|
||||||
"state": state,
|
|
||||||
"session_id": conn.session_id
|
|
||||||
}
|
|
||||||
if text is not None:
|
|
||||||
message["text"] = text
|
|
||||||
|
|
||||||
await conn.websocket.send(json.dumps(message))
|
|
||||||
if state == "stop":
|
|
||||||
conn.clearSpeakStatus()
|
|
||||||
|
|
||||||
|
|
||||||
async def send_stt_message(conn, text):
|
|
||||||
"""发送 STT 状态消息"""
|
|
||||||
stt_text = get_string_no_punctuation_or_emoji(text)
|
|
||||||
await conn.websocket.send(json.dumps({
|
|
||||||
"type": "stt",
|
|
||||||
"text": stt_text,
|
|
||||||
"session_id": conn.session_id}
|
|
||||||
))
|
|
||||||
await conn.websocket.send(
|
|
||||||
json.dumps({
|
|
||||||
"type": "llm",
|
|
||||||
"text": "😊",
|
|
||||||
"emotion": "happy",
|
|
||||||
"session_id": conn.session_id}
|
|
||||||
))
|
|
||||||
await send_tts_message(conn, "start")
|
|
||||||
|
|
||||||
|
|
||||||
async def schedule_with_interrupt(delay, coro):
|
|
||||||
"""可中断的延迟调度"""
|
|
||||||
try:
|
|
||||||
await asyncio.sleep(delay)
|
|
||||||
await coro
|
|
||||||
except asyncio.CancelledError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
async def no_voice_close_connect(conn):
|
|
||||||
if conn.client_no_voice_last_time == 0.0:
|
|
||||||
conn.client_no_voice_last_time = time.time() * 1000
|
|
||||||
else:
|
|
||||||
no_voice_time = time.time() * 1000 - conn.client_no_voice_last_time
|
|
||||||
close_connection_no_voice_time = conn.config.get("close_connection_no_voice_time", 120)
|
|
||||||
if no_voice_time > 1000 * close_connection_no_voice_time:
|
|
||||||
conn.client_abort = False
|
|
||||||
conn.asr_server_receive = False
|
|
||||||
prompt = "时间过得真快,我都好久没说话了。请你用十个字左右话跟我告别,以“再见”或“拜拜拜”为结尾"
|
|
||||||
await startToChat(conn, prompt)
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
import json
|
|
||||||
from config.logger import setup_logging
|
|
||||||
|
|
||||||
logger = setup_logging()
|
|
||||||
|
|
||||||
|
|
||||||
async def handleHelloMessage(conn):
|
|
||||||
await conn.websocket.send(json.dumps(conn.welcome_msg))
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
from config.logger import setup_logging
|
|
||||||
import json
|
|
||||||
from core.handle.abortHandle import handleAbortMessage
|
|
||||||
from core.handle.helloHandle import handleHelloMessage
|
|
||||||
from core.handle.audioHandle import startToChat
|
|
||||||
|
|
||||||
TAG = __name__
|
|
||||||
logger = setup_logging()
|
|
||||||
|
|
||||||
|
|
||||||
async def handleTextMessage(conn, message):
|
|
||||||
"""处理文本消息"""
|
|
||||||
logger.bind(tag=TAG).info(f"收到文本消息:{message}")
|
|
||||||
try:
|
|
||||||
msg_json = json.loads(message)
|
|
||||||
if isinstance(msg_json, int):
|
|
||||||
await conn.websocket.send(message)
|
|
||||||
return
|
|
||||||
if msg_json["type"] == "hello":
|
|
||||||
await handleHelloMessage(conn)
|
|
||||||
elif msg_json["type"] == "abort":
|
|
||||||
await handleAbortMessage(conn)
|
|
||||||
elif msg_json["type"] == "listen":
|
|
||||||
if "mode" in msg_json:
|
|
||||||
conn.client_listen_mode = msg_json["mode"]
|
|
||||||
logger.bind(tag=TAG).debug(f"客户端拾音模式:{conn.client_listen_mode}")
|
|
||||||
if msg_json["state"] == "start":
|
|
||||||
conn.client_have_voice = True
|
|
||||||
conn.client_voice_stop = False
|
|
||||||
elif msg_json["state"] == "stop":
|
|
||||||
conn.client_have_voice = True
|
|
||||||
conn.client_voice_stop = True
|
|
||||||
elif msg_json["state"] == "detect":
|
|
||||||
conn.asr_server_receive = False
|
|
||||||
conn.client_have_voice = False
|
|
||||||
conn.asr_audio.clear()
|
|
||||||
if "text" in msg_json:
|
|
||||||
await startToChat(conn, msg_json["text"])
|
|
||||||
except json.JSONDecodeError:
|
|
||||||
await conn.websocket.send(message)
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
from abc import ABC, abstractmethod
|
|
||||||
from typing import Optional, Tuple, List
|
|
||||||
|
|
||||||
from config.logger import setup_logging
|
|
||||||
|
|
||||||
TAG = __name__
|
|
||||||
logger = setup_logging()
|
|
||||||
|
|
||||||
|
|
||||||
class ASRProviderBase(ABC):
|
|
||||||
@abstractmethod
|
|
||||||
def save_audio_to_file(self, opus_data: List[bytes], session_id: str) -> str:
|
|
||||||
"""解码Opus数据并保存为WAV文件"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
@abstractmethod
|
|
||||||
async def speech_to_text(self, opus_data: List[bytes], session_id: str) -> Tuple[Optional[str], Optional[str]]:
|
|
||||||
"""将语音数据转换为文本"""
|
|
||||||
pass
|
|
||||||
@@ -1,110 +0,0 @@
|
|||||||
import time
|
|
||||||
import wave
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
import io
|
|
||||||
from config.logger import setup_logging
|
|
||||||
from typing import Optional, Tuple, List
|
|
||||||
import uuid
|
|
||||||
import opuslib_next
|
|
||||||
from core.providers.asr.base import ASRProviderBase
|
|
||||||
|
|
||||||
from funasr import AutoModel
|
|
||||||
from funasr.utils.postprocess_utils import rich_transcription_postprocess
|
|
||||||
|
|
||||||
TAG = __name__
|
|
||||||
logger = setup_logging()
|
|
||||||
|
|
||||||
|
|
||||||
# 捕获标准输出
|
|
||||||
class CaptureOutput:
|
|
||||||
def __enter__(self):
|
|
||||||
self._output = io.StringIO()
|
|
||||||
self._original_stdout = sys.stdout
|
|
||||||
sys.stdout = self._output
|
|
||||||
|
|
||||||
def __exit__(self, exc_type, exc_value, traceback):
|
|
||||||
sys.stdout = self._original_stdout
|
|
||||||
self.output = self._output.getvalue()
|
|
||||||
self._output.close()
|
|
||||||
|
|
||||||
# 将捕获到的内容通过 logger 输出
|
|
||||||
if self.output:
|
|
||||||
logger.bind(tag=TAG).info(self.output.strip())
|
|
||||||
|
|
||||||
|
|
||||||
class ASRProvider(ASRProviderBase):
|
|
||||||
def __init__(self, config: dict, delete_audio_file: bool):
|
|
||||||
self.model_dir = config.get("model_dir")
|
|
||||||
self.output_dir = config.get("output_dir") # 修正配置键名
|
|
||||||
self.delete_audio_file = delete_audio_file
|
|
||||||
|
|
||||||
# 确保输出目录存在
|
|
||||||
os.makedirs(self.output_dir, exist_ok=True)
|
|
||||||
with CaptureOutput():
|
|
||||||
self.model = AutoModel(
|
|
||||||
model=self.model_dir,
|
|
||||||
vad_kwargs={"max_single_segment_time": 30000},
|
|
||||||
disable_update=True,
|
|
||||||
hub="hf"
|
|
||||||
# device="cuda:0", # 启用GPU加速
|
|
||||||
)
|
|
||||||
|
|
||||||
def save_audio_to_file(self, opus_data: List[bytes], session_id: str) -> str:
|
|
||||||
"""将Opus音频数据解码并保存为WAV文件"""
|
|
||||||
file_name = f"asr_{session_id}_{uuid.uuid4()}.wav"
|
|
||||||
file_path = os.path.join(self.output_dir, file_name)
|
|
||||||
|
|
||||||
decoder = opuslib_next.Decoder(16000, 1) # 16kHz, 单声道
|
|
||||||
pcm_data = []
|
|
||||||
|
|
||||||
for opus_packet in opus_data:
|
|
||||||
try:
|
|
||||||
pcm_frame = decoder.decode(opus_packet, 960) # 960 samples = 60ms
|
|
||||||
pcm_data.append(pcm_frame)
|
|
||||||
except opuslib_next.OpusError as e:
|
|
||||||
logger.bind(tag=TAG).error(f"Opus解码错误: {e}", exc_info=True)
|
|
||||||
|
|
||||||
with wave.open(file_path, "wb") as wf:
|
|
||||||
wf.setnchannels(1)
|
|
||||||
wf.setsampwidth(2) # 2 bytes = 16-bit
|
|
||||||
wf.setframerate(16000)
|
|
||||||
wf.writeframes(b"".join(pcm_data))
|
|
||||||
|
|
||||||
return file_path
|
|
||||||
|
|
||||||
async def speech_to_text(self, opus_data: List[bytes], session_id: str) -> Tuple[Optional[str], Optional[str]]:
|
|
||||||
"""语音转文本主处理逻辑"""
|
|
||||||
file_path = None
|
|
||||||
try:
|
|
||||||
# 保存音频文件
|
|
||||||
start_time = time.time()
|
|
||||||
file_path = self.save_audio_to_file(opus_data, session_id)
|
|
||||||
logger.bind(tag=TAG).debug(f"音频文件保存耗时: {time.time() - start_time:.3f}s | 路径: {file_path}")
|
|
||||||
|
|
||||||
# 语音识别
|
|
||||||
start_time = time.time()
|
|
||||||
result = self.model.generate(
|
|
||||||
input=file_path,
|
|
||||||
cache={},
|
|
||||||
language="auto",
|
|
||||||
use_itn=True,
|
|
||||||
batch_size_s=60,
|
|
||||||
)
|
|
||||||
text = rich_transcription_postprocess(result[0]["text"])
|
|
||||||
logger.bind(tag=TAG).debug(f"语音识别耗时: {time.time() - start_time:.3f}s | 结果: {text}")
|
|
||||||
|
|
||||||
return text, file_path
|
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
logger.bind(tag=TAG).error(f"语音识别失败: {e}", exc_info=True)
|
|
||||||
return "", None
|
|
||||||
|
|
||||||
finally:
|
|
||||||
# 文件清理逻辑
|
|
||||||
if self.delete_audio_file and file_path and os.path.exists(file_path):
|
|
||||||
try:
|
|
||||||
os.remove(file_path)
|
|
||||||
logger.bind(tag=TAG).debug(f"已删除临时音频文件: {file_path}")
|
|
||||||
except Exception as e:
|
|
||||||
logger.bind(tag=TAG).error(f"文件删除失败: {file_path} | 错误: {e}")
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
from abc import ABC, abstractmethod
|
|
||||||
|
|
||||||
|
|
||||||
class LLMProviderBase(ABC):
|
|
||||||
@abstractmethod
|
|
||||||
def response(self, session_id, dialogue):
|
|
||||||
"""LLM response generator"""
|
|
||||||
pass
|
|
||||||
@@ -1,96 +0,0 @@
|
|||||||
from config.logger import setup_logging
|
|
||||||
import requests
|
|
||||||
import json
|
|
||||||
import re
|
|
||||||
from core.providers.llm.base import LLMProviderBase
|
|
||||||
|
|
||||||
TAG = __name__
|
|
||||||
logger = setup_logging()
|
|
||||||
|
|
||||||
# 定义用于匹配中文标点符号的正则表达式(包括句号、感叹号、问号、分号)
|
|
||||||
punctuation_pattern = re.compile(r'([。!?;])')
|
|
||||||
|
|
||||||
class LLMProvider(LLMProviderBase):
|
|
||||||
def __init__(self, config):
|
|
||||||
self.personal_access_token = config.get("personal_access_token")
|
|
||||||
self.bot_id = config.get("bot_id")
|
|
||||||
self.user_id = config.get("user_id") # 默认用户 ID
|
|
||||||
self.base_url = config.get("base_url")
|
|
||||||
|
|
||||||
def response(self, session_id, dialogue):
|
|
||||||
try:
|
|
||||||
# 从对话中取出最新的用户消息
|
|
||||||
last_msg = next(m for m in reversed(dialogue) if m["role"] == "user")
|
|
||||||
data = {
|
|
||||||
"conversation_id": session_id,
|
|
||||||
"bot_id": self.bot_id,
|
|
||||||
"user": self.user_id,
|
|
||||||
"query": last_msg["content"],
|
|
||||||
"stream": True
|
|
||||||
}
|
|
||||||
logger.bind(tag=TAG).info(f"发送到 Coze API 的请求数据: {json.dumps(data, ensure_ascii=False)}")
|
|
||||||
|
|
||||||
headers = {
|
|
||||||
'Authorization': f'Bearer {self.personal_access_token}',
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
'Accept': '*/*',
|
|
||||||
'Host': 'api.coze.cn',
|
|
||||||
'Connection': 'keep-alive'
|
|
||||||
}
|
|
||||||
|
|
||||||
response = requests.post(
|
|
||||||
self.base_url,
|
|
||||||
headers=headers,
|
|
||||||
json=data,
|
|
||||||
stream=True
|
|
||||||
)
|
|
||||||
logger.bind(tag=TAG).info(f"请求状态: {response.status_code}")
|
|
||||||
|
|
||||||
if response.status_code == 200:
|
|
||||||
# 对每一行流数据进行处理,不做跨块累积
|
|
||||||
for line_bytes in response.iter_lines(decode_unicode=False):
|
|
||||||
if not line_bytes:
|
|
||||||
continue
|
|
||||||
try:
|
|
||||||
# 使用 utf-8 解码,错误部分用替换符
|
|
||||||
line = line_bytes.decode('utf-8', errors='replace')
|
|
||||||
except Exception as e:
|
|
||||||
logger.bind(tag=TAG).error(f"解码失败: {e}")
|
|
||||||
continue
|
|
||||||
if line.startswith("data:"):
|
|
||||||
data_str = line[len("data:"):].strip()
|
|
||||||
if data_str == "[DONE]":
|
|
||||||
break
|
|
||||||
try:
|
|
||||||
data_chunk = json.loads(data_str)
|
|
||||||
except json.JSONDecodeError as e:
|
|
||||||
logger.bind(tag=TAG).error(f"JSON解析失败: {e} 数据: {line}")
|
|
||||||
continue
|
|
||||||
msg = data_chunk.get("message", {})
|
|
||||||
if msg.get("role") == "assistant" and msg.get("type") == "answer":
|
|
||||||
content = msg.get("content", "")
|
|
||||||
# 如果返回内容中包含标点符号,则按标点拆分,立即返回每个片段
|
|
||||||
if punctuation_pattern.search(content):
|
|
||||||
# 利用 finditer 找到每个标点,并返回以标点结尾的片段
|
|
||||||
start = 0
|
|
||||||
for match in punctuation_pattern.finditer(content):
|
|
||||||
end = match.end()
|
|
||||||
sentence = content[start:end].strip()
|
|
||||||
if sentence:
|
|
||||||
yield sentence
|
|
||||||
start = end
|
|
||||||
# 如果拆分后剩余内容也返回(不含标点),直接返回
|
|
||||||
if start < len(content):
|
|
||||||
remainder = content[start:].strip()
|
|
||||||
if remainder:
|
|
||||||
yield remainder
|
|
||||||
else:
|
|
||||||
# 如果没有标点,则直接返回这块内容
|
|
||||||
if content.strip():
|
|
||||||
yield content.strip()
|
|
||||||
else:
|
|
||||||
logger.bind(tag=TAG).error(f"请求失败,状态码: {response.status_code}")
|
|
||||||
yield f"【Coze服务响应异常:请求失败,状态码 {response.status_code}】"
|
|
||||||
except Exception as e:
|
|
||||||
logger.bind(tag=TAG).error(f"Error in Coze response generation: {e}")
|
|
||||||
yield "【Coze服务响应异常】"
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
import json
|
|
||||||
from config.logger import setup_logging
|
|
||||||
import requests
|
|
||||||
from core.providers.llm.base import LLMProviderBase
|
|
||||||
|
|
||||||
TAG = __name__
|
|
||||||
logger = setup_logging()
|
|
||||||
|
|
||||||
class LLMProvider(LLMProviderBase):
|
|
||||||
def __init__(self, config):
|
|
||||||
self.api_key = config["api_key"]
|
|
||||||
self.base_url = config.get("base_url", "https://api.dify.ai/v1").rstrip('/')
|
|
||||||
|
|
||||||
def response(self, session_id, dialogue):
|
|
||||||
try:
|
|
||||||
# 取最后一条用户消息
|
|
||||||
last_msg = next(m for m in reversed(dialogue) if m["role"] == "user")
|
|
||||||
|
|
||||||
# 发起流式请求
|
|
||||||
with requests.post(
|
|
||||||
f"{self.base_url}/chat-messages",
|
|
||||||
headers={"Authorization": f"Bearer {self.api_key}"},
|
|
||||||
json={
|
|
||||||
"query": last_msg["content"],
|
|
||||||
"response_mode": "streaming",
|
|
||||||
"user": session_id,
|
|
||||||
"inputs": {}
|
|
||||||
},
|
|
||||||
stream=True
|
|
||||||
) as r:
|
|
||||||
for line in r.iter_lines():
|
|
||||||
if line.startswith(b'data: '):
|
|
||||||
event = json.loads(line[6:])
|
|
||||||
if event.get('answer'):
|
|
||||||
yield event['answer']
|
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
logger.bind(tag=TAG).error(f"Error in response generation: {e}")
|
|
||||||
yield "【服务响应异常】"
|
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
from config.logger import setup_logging
|
|
||||||
import google.generativeai as genai
|
|
||||||
from core.providers.llm.base import LLMProviderBase
|
|
||||||
|
|
||||||
TAG = __name__
|
|
||||||
logger = setup_logging()
|
|
||||||
|
|
||||||
class LLMProvider(LLMProviderBase):
|
|
||||||
def __init__(self, config):
|
|
||||||
"""初始化Gemini LLM Provider"""
|
|
||||||
self.model_name = config.get("model_name", "gemini-1.5-pro")
|
|
||||||
self.api_key = config.get("api_key")
|
|
||||||
|
|
||||||
if not self.api_key or "你" in self.api_key:
|
|
||||||
logger.bind(tag=TAG).error("你还没配置Gemini LLM的密钥,请在配置文件中配置密钥,否则无法正常工作")
|
|
||||||
return
|
|
||||||
|
|
||||||
try:
|
|
||||||
# 初始化Gemini客户端
|
|
||||||
genai.configure(api_key=self.api_key)
|
|
||||||
self.model = genai.GenerativeModel(self.model_name)
|
|
||||||
|
|
||||||
# 设置生成参数
|
|
||||||
self.generation_config = {
|
|
||||||
"temperature": 0.7,
|
|
||||||
"top_p": 0.9,
|
|
||||||
"top_k": 40,
|
|
||||||
"max_output_tokens": 2048,
|
|
||||||
}
|
|
||||||
self.chat = None
|
|
||||||
except Exception as e:
|
|
||||||
logger.bind(tag=TAG).error(f"Gemini初始化失败: {e}")
|
|
||||||
self.model = None
|
|
||||||
|
|
||||||
def response(self, session_id, dialogue):
|
|
||||||
"""生成Gemini对话响应"""
|
|
||||||
if not self.model:
|
|
||||||
yield "【Gemini服务未正确初始化】"
|
|
||||||
return
|
|
||||||
|
|
||||||
try:
|
|
||||||
# 处理对话历史
|
|
||||||
chat_history = []
|
|
||||||
for msg in dialogue[:-1]: # 历史对话
|
|
||||||
role = "model" if msg["role"] == "assistant" else "user"
|
|
||||||
content = msg["content"].strip()
|
|
||||||
if content:
|
|
||||||
chat_history.append({
|
|
||||||
"role": role,
|
|
||||||
"parts": [content]
|
|
||||||
})
|
|
||||||
|
|
||||||
# 获取当前消息
|
|
||||||
current_msg = dialogue[-1]["content"]
|
|
||||||
|
|
||||||
# 创建新的聊天会话
|
|
||||||
chat = self.model.start_chat(history=chat_history)
|
|
||||||
|
|
||||||
# 发送消息并获取流式响应
|
|
||||||
response = chat.send_message(
|
|
||||||
current_msg,
|
|
||||||
stream=True,
|
|
||||||
generation_config=self.generation_config
|
|
||||||
)
|
|
||||||
|
|
||||||
# 处理流式响应
|
|
||||||
for chunk in response:
|
|
||||||
if hasattr(chunk, 'text') and chunk.text:
|
|
||||||
yield chunk.text
|
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
error_msg = str(e)
|
|
||||||
logger.bind(tag=TAG).error(f"Gemini响应生成错误: {error_msg}")
|
|
||||||
|
|
||||||
# 针对不同错误返回友好提示
|
|
||||||
if "Rate limit" in error_msg:
|
|
||||||
yield "【Gemini服务请求太频繁,请稍后再试】"
|
|
||||||
elif "Invalid API key" in error_msg:
|
|
||||||
yield "【Gemini API key无效】"
|
|
||||||
else:
|
|
||||||
yield f"【Gemini服务响应异常: {error_msg}】"
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
import requests
|
|
||||||
from requests.exceptions import RequestException
|
|
||||||
from config.logger import setup_logging
|
|
||||||
from core.providers.llm.base import LLMProviderBase
|
|
||||||
|
|
||||||
TAG = __name__
|
|
||||||
logger = setup_logging()
|
|
||||||
|
|
||||||
|
|
||||||
class LLMProvider(LLMProviderBase):
|
|
||||||
def __init__(self, config):
|
|
||||||
self.agent_id = config.get("agent_id") # 对应 agent_id
|
|
||||||
self.api_key = config.get("api_key")
|
|
||||||
self.base_url = config.get("base_url", config.get("url")) # 默认使用 base_url
|
|
||||||
self.api_url = f"{self.base_url}/api/conversation/process" # 拼接完整的 API URL
|
|
||||||
|
|
||||||
def response(self, session_id, dialogue):
|
|
||||||
print(dialogue)
|
|
||||||
try:
|
|
||||||
# home assistant语音助手自带意图,无需使用xiaozhi ai自带的,只需要把用户说的话传递给home assistant即可
|
|
||||||
|
|
||||||
# 提取最后一个 role 为 'user' 的 content
|
|
||||||
input_text = None
|
|
||||||
if isinstance(dialogue, list): # 确保 dialogue 是一个列表
|
|
||||||
# 逆序遍历,找到最后一个 role 为 'user' 的消息
|
|
||||||
for message in reversed(dialogue):
|
|
||||||
if message.get("role") == "user": # 找到 role 为 'user' 的消息
|
|
||||||
input_text = message.get("content", "")
|
|
||||||
break # 找到后立即退出循环
|
|
||||||
|
|
||||||
# 构造请求数据
|
|
||||||
payload = {
|
|
||||||
"text": input_text,
|
|
||||||
"agent_id": self.agent_id,
|
|
||||||
"conversation_id": session_id # 使用 session_id 作为 conversation_id
|
|
||||||
}
|
|
||||||
# 设置请求头
|
|
||||||
headers = {
|
|
||||||
"Authorization": f"Bearer {self.api_key}",
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
}
|
|
||||||
|
|
||||||
# 发起 POST 请求
|
|
||||||
response = requests.post(self.api_url, json=payload, headers=headers)
|
|
||||||
|
|
||||||
# 检查请求是否成功
|
|
||||||
response.raise_for_status()
|
|
||||||
|
|
||||||
# 解析返回数据
|
|
||||||
data = response.json()
|
|
||||||
speech = data.get("response", {}).get("speech", {}).get("plain", {}).get("speech", "")
|
|
||||||
|
|
||||||
# 返回生成的内容
|
|
||||||
if speech:
|
|
||||||
yield speech
|
|
||||||
else:
|
|
||||||
logger.bind(tag=TAG).warning("API 返回数据中没有 speech 内容")
|
|
||||||
|
|
||||||
except RequestException as e:
|
|
||||||
logger.bind(tag=TAG).error(f"HTTP 请求错误: {e}")
|
|
||||||
except Exception as e:
|
|
||||||
logger.bind(tag=TAG).error(f"生成响应时出错: {e}")
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
from config.logger import setup_logging
|
|
||||||
import requests, json
|
|
||||||
from core.providers.llm.base import LLMProviderBase
|
|
||||||
|
|
||||||
TAG = __name__
|
|
||||||
logger = setup_logging()
|
|
||||||
|
|
||||||
|
|
||||||
class LLMProvider(LLMProviderBase):
|
|
||||||
def __init__(self, config):
|
|
||||||
|
|
||||||
self.model_name = config.get("model_name")
|
|
||||||
self.base_url = config.get("base_url", "http://localhost:11434")
|
|
||||||
|
|
||||||
def response(self, session_id, dialogue):
|
|
||||||
try:
|
|
||||||
# Convert dialogue format to Ollama format
|
|
||||||
prompt = ""
|
|
||||||
for msg in dialogue:
|
|
||||||
if msg["role"] == "system":
|
|
||||||
prompt += f"System: {msg['content']}\n"
|
|
||||||
elif msg["role"] == "user":
|
|
||||||
prompt += f"User: {msg['content']}\n"
|
|
||||||
elif msg["role"] == "assistant":
|
|
||||||
prompt += f"Assistant: {msg['content']}\n"
|
|
||||||
|
|
||||||
# Make request to Ollama API
|
|
||||||
response = requests.post(
|
|
||||||
f"{self.base_url}/api/generate",
|
|
||||||
json={
|
|
||||||
"model": self.model_name,
|
|
||||||
"prompt": prompt,
|
|
||||||
"stream": True
|
|
||||||
},
|
|
||||||
stream=True
|
|
||||||
)
|
|
||||||
|
|
||||||
for line in response.iter_lines():
|
|
||||||
if line:
|
|
||||||
json_response = json.loads(line)
|
|
||||||
if "response" in json_response:
|
|
||||||
yield json_response["response"]
|
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
logger.bind(tag=TAG).error(f"Error in Ollama response generation: {e}")
|
|
||||||
yield "【Ollama服务响应异常】"
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
from config.logger import setup_logging
|
|
||||||
import openai
|
|
||||||
from core.providers.llm.base import LLMProviderBase
|
|
||||||
|
|
||||||
TAG = __name__
|
|
||||||
logger = setup_logging()
|
|
||||||
|
|
||||||
|
|
||||||
class LLMProvider(LLMProviderBase):
|
|
||||||
def __init__(self, config):
|
|
||||||
self.model_name = config.get("model_name")
|
|
||||||
self.api_key = config.get("api_key")
|
|
||||||
if 'base_url' in config:
|
|
||||||
self.base_url = config.get("base_url")
|
|
||||||
else:
|
|
||||||
self.base_url = config.get("url")
|
|
||||||
if "你" in self.api_key:
|
|
||||||
logger.bind(tag=TAG).error("你还没配置LLM的密钥,请在配置文件中配置密钥,否则无法正常工作")
|
|
||||||
self.client = openai.OpenAI(api_key=self.api_key, base_url=self.base_url)
|
|
||||||
|
|
||||||
def response(self, session_id, dialogue):
|
|
||||||
try:
|
|
||||||
responses = self.client.chat.completions.create(
|
|
||||||
model=self.model_name,
|
|
||||||
messages=dialogue,
|
|
||||||
stream=True
|
|
||||||
)
|
|
||||||
for chunk in responses:
|
|
||||||
# 检查是否存在有效的choice且content不为空
|
|
||||||
if chunk.choices and len(chunk.choices) > 0:
|
|
||||||
delta = chunk.choices[0].delta
|
|
||||||
content = getattr(delta, 'content', '')
|
|
||||||
if content: # 仅在content非空时生成
|
|
||||||
yield content
|
|
||||||
except Exception as e:
|
|
||||||
logger.bind(tag=TAG).error(f"Error in response generation: {e}")
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
import os
|
|
||||||
import uuid
|
|
||||||
import json
|
|
||||||
import requests
|
|
||||||
from datetime import datetime
|
|
||||||
from core.providers.tts.base import TTSProviderBase
|
|
||||||
|
|
||||||
import http.client
|
|
||||||
import urllib.parse
|
|
||||||
|
|
||||||
|
|
||||||
class TTSProvider(TTSProviderBase):
|
|
||||||
def __init__(self, config, delete_audio_file):
|
|
||||||
super().__init__(config, delete_audio_file)
|
|
||||||
self.appkey = config.get("appkey")
|
|
||||||
self.token = config.get("token")
|
|
||||||
self.format = config.get("format", "wav")
|
|
||||||
self.sample_rate = config.get("sample_rate", 16000)
|
|
||||||
self.voice = config.get("voice", "xiaoyun")
|
|
||||||
self.volume = config.get("volume", 50)
|
|
||||||
self.speech_rate = config.get("speech_rate", 0)
|
|
||||||
self.pitch_rate = config.get("pitch_rate", 0)
|
|
||||||
|
|
||||||
self.host = config.get("host", "nls-gateway-cn-shanghai.aliyuncs.com")
|
|
||||||
self.api_url = f"https://{self.host}/stream/v1/tts"
|
|
||||||
self.header = {
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
}
|
|
||||||
|
|
||||||
def generate_filename(self, extension=".wav"):
|
|
||||||
return os.path.join(self.output_file, f"tts-{__name__}{datetime.now().date()}@{uuid.uuid4().hex}{extension}")
|
|
||||||
|
|
||||||
async def text_to_speak(self, text, output_file):
|
|
||||||
request_json = {
|
|
||||||
"appkey": self.appkey,
|
|
||||||
"token": self.token,
|
|
||||||
"text": text,
|
|
||||||
"format": self.format,
|
|
||||||
"sample_rate": self.sample_rate,
|
|
||||||
"voice": self.voice,
|
|
||||||
"volume": self.volume,
|
|
||||||
"speech_rate": self.speech_rate,
|
|
||||||
"pitch_rate": self.pitch_rate
|
|
||||||
}
|
|
||||||
|
|
||||||
print(self.api_url, json.dumps(request_json, ensure_ascii=False))
|
|
||||||
try:
|
|
||||||
resp = requests.post(self.api_url, json.dumps(request_json), headers=self.header)
|
|
||||||
# 检查返回请求数据的mime类型是否是audio/***,是则保存到指定路径下;返回的是binary格式的
|
|
||||||
if resp.headers['Content-Type'].startswith('audio/'):
|
|
||||||
with open(output_file, 'wb') as f:
|
|
||||||
f.write(resp.content)
|
|
||||||
return output_file
|
|
||||||
else:
|
|
||||||
raise Exception(f"{__name__} status_code: {resp.status_code} response: {resp.content}")
|
|
||||||
except Exception as e:
|
|
||||||
raise Exception(f"{__name__} error: {e}")
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
import asyncio
|
|
||||||
from config.logger import setup_logging
|
|
||||||
import os
|
|
||||||
import numpy as np
|
|
||||||
import opuslib_next
|
|
||||||
from pydub import AudioSegment
|
|
||||||
from abc import ABC, abstractmethod
|
|
||||||
|
|
||||||
TAG = __name__
|
|
||||||
logger = setup_logging()
|
|
||||||
|
|
||||||
|
|
||||||
class TTSProviderBase(ABC):
|
|
||||||
def __init__(self, config, delete_audio_file):
|
|
||||||
self.delete_audio_file = delete_audio_file
|
|
||||||
self.output_file = config.get("output_file")
|
|
||||||
|
|
||||||
@abstractmethod
|
|
||||||
def generate_filename(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def to_tts(self, text):
|
|
||||||
tmp_file = self.generate_filename()
|
|
||||||
try:
|
|
||||||
max_repeat_time = 5
|
|
||||||
while not os.path.exists(tmp_file) and max_repeat_time > 0:
|
|
||||||
asyncio.run(self.text_to_speak(text, tmp_file))
|
|
||||||
if not os.path.exists(tmp_file):
|
|
||||||
max_repeat_time = max_repeat_time - 1
|
|
||||||
logger.bind(tag=TAG).error(f"语音生成失败: {text}:{tmp_file},再试{max_repeat_time}次")
|
|
||||||
|
|
||||||
if max_repeat_time > 0:
|
|
||||||
logger.bind(tag=TAG).info(f"语音生成成功: {text}:{tmp_file},重试{5 - max_repeat_time}次")
|
|
||||||
|
|
||||||
return tmp_file
|
|
||||||
except Exception as e:
|
|
||||||
logger.bind(tag=TAG).info(f"Failed to generate TTS file: {e}")
|
|
||||||
return None
|
|
||||||
|
|
||||||
@abstractmethod
|
|
||||||
async def text_to_speak(self, text, output_file):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def wav_to_opus_data(self, wav_file_path):
|
|
||||||
# 使用pydub加载PCM文件
|
|
||||||
# 获取文件后缀名
|
|
||||||
file_type = os.path.splitext(wav_file_path)[1]
|
|
||||||
if file_type:
|
|
||||||
file_type = file_type.lstrip('.')
|
|
||||||
audio = AudioSegment.from_file(wav_file_path, format=file_type)
|
|
||||||
|
|
||||||
duration = len(audio) / 1000.0
|
|
||||||
|
|
||||||
# 转换为单声道和16kHz采样率(确保与编码器匹配)
|
|
||||||
audio = audio.set_channels(1).set_frame_rate(16000)
|
|
||||||
|
|
||||||
# 获取原始PCM数据(16位小端)
|
|
||||||
raw_data = audio.raw_data
|
|
||||||
|
|
||||||
# 初始化Opus编码器
|
|
||||||
encoder = opuslib_next.Encoder(16000, 1, opuslib_next.APPLICATION_AUDIO)
|
|
||||||
|
|
||||||
# 编码参数
|
|
||||||
frame_duration = 60 # 60ms per frame
|
|
||||||
frame_size = int(16000 * frame_duration / 1000) # 960 samples/frame
|
|
||||||
|
|
||||||
opus_datas = []
|
|
||||||
# 按帧处理所有音频数据(包括最后一帧可能补零)
|
|
||||||
for i in range(0, len(raw_data), frame_size * 2): # 16bit=2bytes/sample
|
|
||||||
# 获取当前帧的二进制数据
|
|
||||||
chunk = raw_data[i:i + frame_size * 2]
|
|
||||||
|
|
||||||
# 如果最后一帧不足,补零
|
|
||||||
if len(chunk) < frame_size * 2:
|
|
||||||
chunk += b'\x00' * (frame_size * 2 - len(chunk))
|
|
||||||
|
|
||||||
# 转换为numpy数组处理
|
|
||||||
np_frame = np.frombuffer(chunk, dtype=np.int16)
|
|
||||||
|
|
||||||
# 编码Opus数据
|
|
||||||
opus_data = encoder.encode(np_frame.tobytes(), frame_size)
|
|
||||||
opus_datas.append(opus_data)
|
|
||||||
|
|
||||||
return opus_datas, duration
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
import os
|
|
||||||
import uuid
|
|
||||||
import json
|
|
||||||
import base64
|
|
||||||
import requests
|
|
||||||
from datetime import datetime
|
|
||||||
from core.providers.tts.base import TTSProviderBase
|
|
||||||
|
|
||||||
|
|
||||||
class TTSProvider(TTSProviderBase):
|
|
||||||
def __init__(self, config, delete_audio_file):
|
|
||||||
super().__init__(config, delete_audio_file)
|
|
||||||
self.model = config.get("model")
|
|
||||||
self.access_token = config.get("access_token")
|
|
||||||
self.voice = config.get("voice")
|
|
||||||
self.response_format = config.get("response_format")
|
|
||||||
|
|
||||||
self.host = "api.coze.cn"
|
|
||||||
self.api_url = f"https://{self.host}/v1/audio/speech"
|
|
||||||
|
|
||||||
def generate_filename(self, extension=".wav"):
|
|
||||||
return os.path.join(self.output_file, f"tts-{datetime.now().date()}@{uuid.uuid4().hex}{extension}")
|
|
||||||
|
|
||||||
async def text_to_speak(self, text, output_file):
|
|
||||||
request_json = {
|
|
||||||
"model": self.model,
|
|
||||||
"input": text,
|
|
||||||
"voice_id": self.voice,
|
|
||||||
"response_format": self.response_format,
|
|
||||||
}
|
|
||||||
headers = {
|
|
||||||
"Authorization": f"Bearer {self.access_token}",
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
}
|
|
||||||
response = requests.request("POST", self.api_url, json=request_json, headers=headers)
|
|
||||||
data = response.content
|
|
||||||
file_to_save = open(output_file, "wb")
|
|
||||||
file_to_save.write(data)
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
import os
|
|
||||||
import uuid
|
|
||||||
import json
|
|
||||||
import base64
|
|
||||||
import requests
|
|
||||||
from datetime import datetime
|
|
||||||
from core.providers.tts.base import TTSProviderBase
|
|
||||||
|
|
||||||
|
|
||||||
class TTSProvider(TTSProviderBase):
|
|
||||||
def __init__(self, config, delete_audio_file):
|
|
||||||
super().__init__(config, delete_audio_file)
|
|
||||||
self.appid = config.get("appid")
|
|
||||||
self.access_token = config.get("access_token")
|
|
||||||
self.cluster = config.get("cluster")
|
|
||||||
self.voice = config.get("voice")
|
|
||||||
|
|
||||||
self.host = "openspeech.bytedance.com"
|
|
||||||
self.api_url = f"https://{self.host}/api/v1/tts"
|
|
||||||
self.header = {"Authorization": f"Bearer;{self.access_token}"}
|
|
||||||
|
|
||||||
def generate_filename(self, extension=".wav"):
|
|
||||||
return os.path.join(self.output_file, f"tts-{datetime.now().date()}@{uuid.uuid4().hex}{extension}")
|
|
||||||
|
|
||||||
async def text_to_speak(self, text, output_file):
|
|
||||||
request_json = {
|
|
||||||
"app": {
|
|
||||||
"appid": f"{self.appid}",
|
|
||||||
"token": "access_token",
|
|
||||||
"cluster": self.cluster
|
|
||||||
},
|
|
||||||
"user": {
|
|
||||||
"uid": "1"
|
|
||||||
},
|
|
||||||
"audio": {
|
|
||||||
"voice_type": self.voice,
|
|
||||||
"encoding": "wav",
|
|
||||||
"speed_ratio": 1.0,
|
|
||||||
"volume_ratio": 1.0,
|
|
||||||
"pitch_ratio": 1.0,
|
|
||||||
},
|
|
||||||
"request": {
|
|
||||||
"reqid": str(uuid.uuid4()),
|
|
||||||
"text": text,
|
|
||||||
"text_type": "plain",
|
|
||||||
"operation": "query",
|
|
||||||
"with_frontend": 1,
|
|
||||||
"frontend_type": "unitTson"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
try:
|
|
||||||
resp = requests.post(self.api_url, json.dumps(request_json), headers=self.header)
|
|
||||||
if "data" in resp.json():
|
|
||||||
data = resp.json()["data"]
|
|
||||||
file_to_save = open(output_file, "wb")
|
|
||||||
file_to_save.write(base64.b64decode(data))
|
|
||||||
else:
|
|
||||||
raise Exception(f"{__name__} status_code: {resp.status_code} response: {resp.content}")
|
|
||||||
except Exception as e:
|
|
||||||
raise Exception(f"{__name__} error: {e}")
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
import os
|
|
||||||
import uuid
|
|
||||||
import edge_tts
|
|
||||||
from datetime import datetime
|
|
||||||
from core.providers.tts.base import TTSProviderBase
|
|
||||||
|
|
||||||
|
|
||||||
class TTSProvider(TTSProviderBase):
|
|
||||||
def __init__(self, config, delete_audio_file):
|
|
||||||
super().__init__(config, delete_audio_file)
|
|
||||||
self.voice = config.get("voice")
|
|
||||||
|
|
||||||
def generate_filename(self, extension=".mp3"):
|
|
||||||
return os.path.join(self.output_file, f"tts-{datetime.now().date()}@{uuid.uuid4().hex}{extension}")
|
|
||||||
|
|
||||||
async def text_to_speak(self, text, output_file):
|
|
||||||
communicate = edge_tts.Communicate(text, voice=self.voice) # Use your preferred voice
|
|
||||||
await communicate.save(output_file)
|
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
import os
|
|
||||||
import uuid
|
|
||||||
import json
|
|
||||||
import base64
|
|
||||||
import requests
|
|
||||||
from config.logger import setup_logging
|
|
||||||
from datetime import datetime
|
|
||||||
from core.providers.tts.base import TTSProviderBase
|
|
||||||
|
|
||||||
TAG = __name__
|
|
||||||
logger = setup_logging()
|
|
||||||
|
|
||||||
class TTSProvider(TTSProviderBase):
|
|
||||||
def __init__(self, config, delete_audio_file):
|
|
||||||
super().__init__(config, delete_audio_file)
|
|
||||||
self.url = config.get("url")
|
|
||||||
self.text_lang = config.get("text_lang", "zh")
|
|
||||||
self.ref_audio_path = config.get("ref_audio_path")
|
|
||||||
self.prompt_text = config.get("prompt_text")
|
|
||||||
self.prompt_lang = config.get("prompt_lang", "zh")
|
|
||||||
self.top_k = config.get("top_k", 5)
|
|
||||||
self.top_p = config.get("top_p", 1)
|
|
||||||
self.temperature = config.get("temperature", 1)
|
|
||||||
self.text_split_method = config.get("text_split_method", "cut0")
|
|
||||||
self.batch_size = config.get("batch_size", 1)
|
|
||||||
self.batch_threshold = config.get("batch_threshold", 0.75)
|
|
||||||
self.split_bucket = config.get("split_bucket", True)
|
|
||||||
self.return_fragment = config.get("return_fragment", False)
|
|
||||||
self.speed_factor = config.get("speed_factor", 1.0)
|
|
||||||
self.streaming_mode = config.get("streaming_mode", False)
|
|
||||||
self.seed = config.get("seed", -1)
|
|
||||||
self.parallel_infer = config.get("parallel_infer", True)
|
|
||||||
self.repetition_penalty = config.get("repetition_penalty", 1.35)
|
|
||||||
self.aux_ref_audio_paths = config.get("aux_ref_audio_paths", [])
|
|
||||||
|
|
||||||
def generate_filename(self, extension=".wav"):
|
|
||||||
return os.path.join(self.output_file, f"tts-{datetime.now().date()}@{uuid.uuid4().hex}{extension}")
|
|
||||||
|
|
||||||
async def text_to_speak(self, text, output_file):
|
|
||||||
request_json = {
|
|
||||||
"text": text,
|
|
||||||
"text_lang": self.text_lang,
|
|
||||||
"ref_audio_path": self.ref_audio_path,
|
|
||||||
"aux_ref_audio_paths": self.aux_ref_audio_paths,
|
|
||||||
"prompt_text": self.prompt_text,
|
|
||||||
"prompt_lang": self.prompt_lang,
|
|
||||||
"top_k": self.top_k,
|
|
||||||
"top_p": self.top_p,
|
|
||||||
"temperature": self.temperature,
|
|
||||||
"text_split_method": self.text_split_method,
|
|
||||||
"batch_size": self.batch_size,
|
|
||||||
"batch_threshold": self.batch_threshold,
|
|
||||||
"split_bucket": self.split_bucket,
|
|
||||||
"return_fragment": self.return_fragment,
|
|
||||||
"speed_factor": self.speed_factor,
|
|
||||||
"streaming_mode": self.streaming_mode,
|
|
||||||
"seed": self.seed,
|
|
||||||
"parallel_infer": self.parallel_infer,
|
|
||||||
"repetition_penalty": self.repetition_penalty
|
|
||||||
}
|
|
||||||
|
|
||||||
resp = requests.post(self.url, json=request_json)
|
|
||||||
if resp.status_code == 200:
|
|
||||||
with open(output_file, "wb") as file:
|
|
||||||
file.write(resp.content)
|
|
||||||
else:
|
|
||||||
logger.bind(tag=TAG).error(f"GPT_SoVITS_V2 TTS请求失败: {resp.status_code} - {resp.text}")
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
import os
|
|
||||||
import uuid
|
|
||||||
import json
|
|
||||||
import requests
|
|
||||||
from datetime import datetime
|
|
||||||
from core.providers.tts.base import TTSProviderBase
|
|
||||||
|
|
||||||
|
|
||||||
class TTSProvider(TTSProviderBase):
|
|
||||||
def __init__(self, config, delete_audio_file):
|
|
||||||
super().__init__(config, delete_audio_file)
|
|
||||||
self.group_id = config.get("group_id")
|
|
||||||
self.api_key = config.get("api_key")
|
|
||||||
self.model = config.get("model")
|
|
||||||
self.voice_id = config.get("voice_id")
|
|
||||||
|
|
||||||
default_voice_setting = {
|
|
||||||
"voice_id": "female-shaonv",
|
|
||||||
"speed": 1,
|
|
||||||
"vol": 1,
|
|
||||||
"pitch": 0,
|
|
||||||
"emotion": "happy"
|
|
||||||
}
|
|
||||||
default_pronunciation_dict = {
|
|
||||||
"tone": [
|
|
||||||
"处理/(chu3)(li3)", "危险/dangerous"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
defult_audio_setting = {
|
|
||||||
"sample_rate": 32000,
|
|
||||||
"bitrate": 128000,
|
|
||||||
"format": "mp3",
|
|
||||||
"channel": 1
|
|
||||||
}
|
|
||||||
self.voice_setting = {**default_voice_setting, **config.get("voice_setting", {})}
|
|
||||||
self.pronunciation_dict = {**default_pronunciation_dict, **config.get("pronunciation_dict", {})}
|
|
||||||
self.audio_setting = {**defult_audio_setting, **config.get("audio_setting", {})}
|
|
||||||
self.timber_weights = config.get("timber_weights", [])
|
|
||||||
|
|
||||||
if self.voice_id:
|
|
||||||
self.voice_setting["voice_id"] = self.voice_id
|
|
||||||
|
|
||||||
self.host = "api.minimax.chat"
|
|
||||||
self.api_url = f"https://{self.host}/v1/t2a_v2?GroupId={self.group_id}"
|
|
||||||
self.header = {
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
"Authorization": f"Bearer {self.api_key}"
|
|
||||||
}
|
|
||||||
|
|
||||||
def generate_filename(self, extension=".mp3"):
|
|
||||||
return os.path.join(self.output_file, f"tts-{__name__}{datetime.now().date()}@{uuid.uuid4().hex}{extension}")
|
|
||||||
|
|
||||||
async def text_to_speak(self, text, output_file):
|
|
||||||
request_json = {
|
|
||||||
"model": self.model,
|
|
||||||
"text": text,
|
|
||||||
"stream": False,
|
|
||||||
"voice_setting": self.voice_setting,
|
|
||||||
"pronunciation_dict": self.pronunciation_dict,
|
|
||||||
"audio_setting": self.audio_setting,
|
|
||||||
}
|
|
||||||
|
|
||||||
if type(self.timber_weights) is list and len(self.timber_weights) > 0:
|
|
||||||
request_json["timber_weights"] = self.timber_weights
|
|
||||||
request_json["voice_setting"]["voice_id"] = ""
|
|
||||||
|
|
||||||
try:
|
|
||||||
resp = requests.post(self.api_url, json.dumps(request_json), headers=self.header)
|
|
||||||
# 检查返回请求数据的status_code是否为0
|
|
||||||
if resp.json()["base_resp"]["status_code"] == 0:
|
|
||||||
data = resp.json()['data']['audio']
|
|
||||||
file_to_save = open(output_file, "wb")
|
|
||||||
file_to_save.write(bytes.fromhex(data))
|
|
||||||
else:
|
|
||||||
raise Exception(f"{__name__} status_code: {resp.status_code} response: {resp.content}")
|
|
||||||
except Exception as e:
|
|
||||||
raise Exception(f"{__name__} error: {e}")
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
import os
|
|
||||||
import uuid
|
|
||||||
import requests
|
|
||||||
from datetime import datetime
|
|
||||||
from core.providers.tts.base import TTSProviderBase
|
|
||||||
|
|
||||||
|
|
||||||
class TTSProvider(TTSProviderBase):
|
|
||||||
def __init__(self, config, delete_audio_file):
|
|
||||||
super().__init__(config, delete_audio_file)
|
|
||||||
self.model = config.get("model")
|
|
||||||
self.access_token = config.get("access_token")
|
|
||||||
self.voice = config.get("voice")
|
|
||||||
self.response_format = config.get("response_format")
|
|
||||||
self.sample_rate = config.get("sample_rate")
|
|
||||||
self.speed = config.get("speed")
|
|
||||||
self.gain = config.get("gain")
|
|
||||||
|
|
||||||
self.host = "api.siliconflow.cn"
|
|
||||||
self.api_url = f"https://{self.host}/v1/audio/speech"
|
|
||||||
|
|
||||||
def generate_filename(self, extension=".wav"):
|
|
||||||
return os.path.join(self.output_file, f"tts-{datetime.now().date()}@{uuid.uuid4().hex}{extension}")
|
|
||||||
|
|
||||||
async def text_to_speak(self, text, output_file):
|
|
||||||
request_json = {
|
|
||||||
"model": self.model,
|
|
||||||
"input": text,
|
|
||||||
"voice": self.voice,
|
|
||||||
"response_format": self.response_format,
|
|
||||||
}
|
|
||||||
headers = {
|
|
||||||
"Authorization": f"Bearer {self.access_token}",
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
}
|
|
||||||
response = requests.request("POST", self.api_url, json=request_json, headers=headers)
|
|
||||||
data = response.content
|
|
||||||
file_to_save = open(output_file, "wb")
|
|
||||||
file_to_save.write(data)
|
|
||||||
@@ -1,97 +0,0 @@
|
|||||||
import random
|
|
||||||
import threading
|
|
||||||
import time
|
|
||||||
from typing import Set
|
|
||||||
|
|
||||||
class AuthCodeGenerator:
|
|
||||||
_instance = None
|
|
||||||
_instance_lock = threading.Lock()
|
|
||||||
|
|
||||||
def __new__(cls):
|
|
||||||
if not cls._instance:
|
|
||||||
with cls._instance_lock:
|
|
||||||
if not cls._instance:
|
|
||||||
cls._instance = super(AuthCodeGenerator, cls).__new__(cls)
|
|
||||||
# 初始化随机种子
|
|
||||||
random.seed(time.time())
|
|
||||||
return cls._instance
|
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
# 确保 __init__ 只被调用一次
|
|
||||||
if not hasattr(self, '_initialized'):
|
|
||||||
self._used_codes: Set[str] = set()
|
|
||||||
self._code_timestamps = {}
|
|
||||||
self._lock = threading.Lock()
|
|
||||||
self._code_timeout = 3 * 24 * 60 * 60
|
|
||||||
self._initialized = True
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def get_instance(cls):
|
|
||||||
"""获取AuthCodeGenerator的单例实例"""
|
|
||||||
return cls()
|
|
||||||
|
|
||||||
def generate_code(self) -> str:
|
|
||||||
"""
|
|
||||||
生成6位数字认证码,确保不重复
|
|
||||||
返回: 6位数字字符串
|
|
||||||
"""
|
|
||||||
with self._lock:
|
|
||||||
self._clean_expired_codes() # 清理过期code
|
|
||||||
while True:
|
|
||||||
# 使用时间戳和已用码数量作为种子,确保每次生成不同的随机数
|
|
||||||
seed = int(time.time() * 1000) + len(self._used_codes)
|
|
||||||
random.seed(seed)
|
|
||||||
|
|
||||||
# 生成6位随机数字
|
|
||||||
code = ''.join(str(random.randint(0, 9)) for _ in range(6))
|
|
||||||
|
|
||||||
# 检查是否已存在
|
|
||||||
if code not in self._used_codes:
|
|
||||||
self._used_codes.add(code)
|
|
||||||
self._code_timestamps[code] = time.time()
|
|
||||||
return code
|
|
||||||
|
|
||||||
def remove_code(self, code: str) -> bool:
|
|
||||||
"""
|
|
||||||
删除已使用的认证码
|
|
||||||
参数:
|
|
||||||
code: 要删除的认证码
|
|
||||||
返回:
|
|
||||||
bool: 删除成功返回True,码不存在返回False
|
|
||||||
"""
|
|
||||||
print('remove_code', code)
|
|
||||||
with self._lock:
|
|
||||||
if code in self._used_codes:
|
|
||||||
self._used_codes.remove(code)
|
|
||||||
if code in self._code_timestamps:
|
|
||||||
del self._code_timestamps[code]
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
def is_code_used(self, code: str) -> bool:
|
|
||||||
"""
|
|
||||||
检查认证码是否已被使用
|
|
||||||
参数:
|
|
||||||
code: 要检查的认证码
|
|
||||||
返回:
|
|
||||||
bool: 如果码存在返回True,否则返回False
|
|
||||||
"""
|
|
||||||
with self._lock:
|
|
||||||
return code in self._used_codes
|
|
||||||
|
|
||||||
def clear_codes(self):
|
|
||||||
"""清空所有已使用的认证码"""
|
|
||||||
with self._lock:
|
|
||||||
self._used_codes.clear()
|
|
||||||
self._code_timestamps.clear()
|
|
||||||
|
|
||||||
def _clean_expired_codes(self):
|
|
||||||
"""清理过期的认证码"""
|
|
||||||
current_time = time.time()
|
|
||||||
expired_codes = [
|
|
||||||
code for code, timestamp in self._code_timestamps.items()
|
|
||||||
if (current_time - timestamp) > self._code_timeout
|
|
||||||
]
|
|
||||||
for code in expired_codes:
|
|
||||||
self._used_codes.remove(code)
|
|
||||||
del self._code_timestamps[code]
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
import uuid
|
|
||||||
from typing import List, Dict
|
|
||||||
from datetime import datetime
|
|
||||||
|
|
||||||
|
|
||||||
class Message:
|
|
||||||
def __init__(self, role: str, content: str = None, uniq_id: str = None):
|
|
||||||
self.uniq_id = uniq_id if uniq_id is not None else str(uuid.uuid4())
|
|
||||||
self.role = role
|
|
||||||
self.content = content
|
|
||||||
|
|
||||||
|
|
||||||
class Dialogue:
|
|
||||||
def __init__(self):
|
|
||||||
self.dialogue: List[Message] = []
|
|
||||||
# 获取当前时间
|
|
||||||
self.current_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
|
||||||
|
|
||||||
def put(self, message: Message):
|
|
||||||
self.dialogue.append(message)
|
|
||||||
|
|
||||||
def get_llm_dialogue(self) -> List[Dict[str, str]]:
|
|
||||||
dialogue = []
|
|
||||||
for m in self.dialogue:
|
|
||||||
dialogue.append({"role": m.role, "content": m.content})
|
|
||||||
return dialogue
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
import os
|
|
||||||
import sys
|
|
||||||
from config.logger import setup_logging
|
|
||||||
import importlib
|
|
||||||
from datetime import datetime
|
|
||||||
from core.utils.util import is_segment
|
|
||||||
from core.utils.util import get_string_no_punctuation_or_emoji
|
|
||||||
from core.utils.util import read_config, get_project_dir
|
|
||||||
|
|
||||||
logger = setup_logging()
|
|
||||||
|
|
||||||
|
|
||||||
def create_instance(class_name, *args, **kwargs):
|
|
||||||
# 创建LLM实例
|
|
||||||
if os.path.exists(os.path.join('core', 'providers', 'llm', class_name, f'{class_name}.py')):
|
|
||||||
lib_name = f'core.providers.llm.{class_name}.{class_name}'
|
|
||||||
if lib_name not in sys.modules:
|
|
||||||
sys.modules[lib_name] = importlib.import_module(f'{lib_name}')
|
|
||||||
return sys.modules[lib_name].LLMProvider(*args, **kwargs)
|
|
||||||
|
|
||||||
raise ValueError(f"不支持的LLM类型: {class_name},请检查该配置的type是否设置正确")
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
"""
|
|
||||||
响应速度测试
|
|
||||||
"""
|
|
||||||
config = read_config(get_project_dir() + "config.yaml")
|
|
||||||
llm = create_instance(
|
|
||||||
config["selected_module"]["LLM"]
|
|
||||||
if not "type" in config["LLM"][config["selected_module"]["LLM"]]
|
|
||||||
else
|
|
||||||
config["LLM"][config["selected_module"]["LLM"]]["type"],
|
|
||||||
config["LLM"][config["selected_module"]["LLM"]]
|
|
||||||
)
|
|
||||||
|
|
||||||
start_time = datetime.now()
|
|
||||||
|
|
||||||
dialogue = []
|
|
||||||
dialogue.append({"role": "system", "content": config.get("prompt")})
|
|
||||||
dialogue.append({"role": "user", "content": "你好小智"})
|
|
||||||
llm_responses = llm.response("test", dialogue)
|
|
||||||
response_message = []
|
|
||||||
first_text = None
|
|
||||||
start = 0
|
|
||||||
|
|
||||||
for content in llm_responses:
|
|
||||||
response_message.append(content)
|
|
||||||
|
|
||||||
if is_segment(response_message):
|
|
||||||
segment_text = "".join(response_message[start:])
|
|
||||||
segment_text = get_string_no_punctuation_or_emoji(segment_text)
|
|
||||||
if len(segment_text) > 0:
|
|
||||||
if first_text is None:
|
|
||||||
first_text = segment_text
|
|
||||||
print("大模型首次返回耗时:" + str(datetime.now() - start_time))
|
|
||||||
start = len(response_message)
|
|
||||||
|
|
||||||
print("大模型返回总耗时:" + str(datetime.now() - start_time))
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
import asyncio
|
|
||||||
from typing import Dict
|
|
||||||
from config.logger import setup_logging
|
|
||||||
|
|
||||||
TAG = __name__
|
|
||||||
logger = setup_logging()
|
|
||||||
|
|
||||||
class FileLockManager:
|
|
||||||
_instance = None
|
|
||||||
_locks: Dict[str, asyncio.Lock] = {}
|
|
||||||
|
|
||||||
def __new__(cls):
|
|
||||||
if cls._instance is None:
|
|
||||||
cls._instance = super(FileLockManager, cls).__new__(cls)
|
|
||||||
return cls._instance
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def get_lock(cls, file_path: str) -> asyncio.Lock:
|
|
||||||
"""获取指定文件的锁"""
|
|
||||||
if file_path not in cls._locks:
|
|
||||||
cls._locks[file_path] = asyncio.Lock()
|
|
||||||
return cls._locks[file_path]
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
async def acquire_lock(cls, file_path: str):
|
|
||||||
"""获取锁"""
|
|
||||||
lock = cls.get_lock(file_path)
|
|
||||||
await lock.acquire()
|
|
||||||
logger.bind(tag=TAG).debug(f"Acquired lock for {file_path}")
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def release_lock(cls, file_path: str):
|
|
||||||
"""释放锁"""
|
|
||||||
if file_path in cls._locks:
|
|
||||||
try:
|
|
||||||
cls._locks[file_path].release()
|
|
||||||
logger.bind(tag=TAG).debug(f"Released lock for {file_path}")
|
|
||||||
except RuntimeError as e:
|
|
||||||
logger.bind(tag=TAG).warning(f"Failed to release lock for {file_path}: {e}")
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
import os
|
|
||||||
import sys
|
|
||||||
from config.logger import setup_logging
|
|
||||||
import importlib
|
|
||||||
from datetime import datetime
|
|
||||||
from core.utils.util import read_config, get_project_dir
|
|
||||||
|
|
||||||
logger = setup_logging()
|
|
||||||
|
|
||||||
|
|
||||||
def create_instance(class_name, *args, **kwargs):
|
|
||||||
# 创建TTS实例
|
|
||||||
if os.path.exists(os.path.join('core', 'providers', 'tts', f'{class_name}.py')):
|
|
||||||
lib_name = f'core.providers.tts.{class_name}'
|
|
||||||
if lib_name not in sys.modules:
|
|
||||||
sys.modules[lib_name] = importlib.import_module(f'{lib_name}')
|
|
||||||
return sys.modules[lib_name].TTSProvider(*args, **kwargs)
|
|
||||||
|
|
||||||
raise ValueError(f"不支持的TTS类型: {class_name},请检查该配置的type是否设置正确")
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
"""
|
|
||||||
响应速度测试
|
|
||||||
"""
|
|
||||||
config = read_config(get_project_dir() + "config.yaml")
|
|
||||||
tts = create_instance(
|
|
||||||
config["selected_module"]["TTS"]
|
|
||||||
if not 'type' in config["TTS"][config["selected_module"]["TTS"]]
|
|
||||||
else
|
|
||||||
config["TTS"][config["selected_module"]["TTS"]]["type"],
|
|
||||||
config["TTS"][config["selected_module"]["TTS"]],
|
|
||||||
config["delete_audio"]
|
|
||||||
)
|
|
||||||
tts.output_file = get_project_dir() + tts.output_file
|
|
||||||
start = datetime.now()
|
|
||||||
file_path = tts.to_tts("你好,测试,我是人工智能小智")
|
|
||||||
print("语音合成耗时:" + str(datetime.now() - start))
|
|
||||||
start = datetime.now()
|
|
||||||
tts.wav_to_opus_data(file_path)
|
|
||||||
print("语音opus耗时:" + str(datetime.now() - start))
|
|
||||||
@@ -1,123 +0,0 @@
|
|||||||
import os
|
|
||||||
import re
|
|
||||||
import json
|
|
||||||
import yaml
|
|
||||||
import socket
|
|
||||||
|
|
||||||
|
|
||||||
def get_project_dir():
|
|
||||||
"""获取项目根目录"""
|
|
||||||
return os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + '/'
|
|
||||||
|
|
||||||
|
|
||||||
def get_local_ip():
|
|
||||||
try:
|
|
||||||
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
|
||||||
# Connect to Google's DNS servers
|
|
||||||
s.connect(("8.8.8.8", 80))
|
|
||||||
local_ip = s.getsockname()[0]
|
|
||||||
s.close()
|
|
||||||
return local_ip
|
|
||||||
except Exception as e:
|
|
||||||
return "127.0.0.1"
|
|
||||||
|
|
||||||
|
|
||||||
def read_config(config_path):
|
|
||||||
with open(config_path, "r", encoding="utf-8") as file:
|
|
||||||
config = yaml.safe_load(file)
|
|
||||||
return config
|
|
||||||
|
|
||||||
|
|
||||||
def write_json_file(file_path, data):
|
|
||||||
"""将数据写入 JSON 文件"""
|
|
||||||
with open(file_path, 'w', encoding='utf-8') as file:
|
|
||||||
json.dump(data, file, ensure_ascii=False, indent=4)
|
|
||||||
|
|
||||||
|
|
||||||
def is_segment(tokens):
|
|
||||||
if tokens[-1] in (",", ".", "?", ",", "。", "?", "!", "!", ";", ";", ":", ":"):
|
|
||||||
return True
|
|
||||||
else:
|
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
def is_punctuation_or_emoji(char):
|
|
||||||
"""检查字符是否为空格、指定标点或表情符号"""
|
|
||||||
# 定义需要去除的中英文标点(包括全角/半角)
|
|
||||||
punctuation_set = {
|
|
||||||
',', ',', # 中文逗号 + 英文逗号
|
|
||||||
'。', '.', # 中文句号 + 英文句号
|
|
||||||
'!', '!', # 中文感叹号 + 英文感叹号
|
|
||||||
'-', '-', # 英文连字符 + 中文全角横线
|
|
||||||
'、' # 中文顿号
|
|
||||||
}
|
|
||||||
if char.isspace() or char in punctuation_set:
|
|
||||||
return True
|
|
||||||
# 检查表情符号(保留原有逻辑)
|
|
||||||
code_point = ord(char)
|
|
||||||
emoji_ranges = [
|
|
||||||
(0x1F600, 0x1F64F), (0x1F300, 0x1F5FF),
|
|
||||||
(0x1F680, 0x1F6FF), (0x1F900, 0x1F9FF),
|
|
||||||
(0x1FA70, 0x1FAFF), (0x2600, 0x26FF),
|
|
||||||
(0x2700, 0x27BF)
|
|
||||||
]
|
|
||||||
return any(start <= code_point <= end for start, end in emoji_ranges)
|
|
||||||
|
|
||||||
|
|
||||||
def get_string_no_punctuation_or_emoji(s):
|
|
||||||
"""去除字符串首尾的空格、标点符号和表情符号"""
|
|
||||||
chars = list(s)
|
|
||||||
# 处理开头的字符
|
|
||||||
start = 0
|
|
||||||
while start < len(chars) and is_punctuation_or_emoji(chars[start]):
|
|
||||||
start += 1
|
|
||||||
# 处理结尾的字符
|
|
||||||
end = len(chars) - 1
|
|
||||||
while end >= start and is_punctuation_or_emoji(chars[end]):
|
|
||||||
end -= 1
|
|
||||||
return ''.join(chars[start:end + 1])
|
|
||||||
|
|
||||||
|
|
||||||
def remove_punctuation_and_length(text):
|
|
||||||
# 全角符号和半角符号的Unicode范围
|
|
||||||
full_width_punctuations = '!"#$%&'()*+,-。/:;<=>?@[\]^_`{|}~'
|
|
||||||
half_width_punctuations = '!"#$%&\'()*+,-./:;<=>?@[\]^_`{|}~'
|
|
||||||
space = ' ' # 半角空格
|
|
||||||
full_width_space = ' ' # 全角空格
|
|
||||||
|
|
||||||
# 去除全角和半角符号以及空格
|
|
||||||
result = ''.join([char for char in text if
|
|
||||||
char not in full_width_punctuations and char not in half_width_punctuations and char not in space and char not in full_width_space])
|
|
||||||
|
|
||||||
if result == "Yeah":
|
|
||||||
return 0
|
|
||||||
return len(result), result
|
|
||||||
|
|
||||||
|
|
||||||
def check_password(password):
|
|
||||||
"""
|
|
||||||
检查密码是否满足以下条件:
|
|
||||||
1. 密码长度大于八位。
|
|
||||||
2. 密码包含英文和数字。
|
|
||||||
3. 密码不能包含“xiaozhi”字符。
|
|
||||||
|
|
||||||
:param password: 要检查的密码
|
|
||||||
:return: 如果密码满足条件,则返回True;否则返回False。
|
|
||||||
"""
|
|
||||||
# 检查密码长度
|
|
||||||
if len(password) < 8:
|
|
||||||
return False
|
|
||||||
|
|
||||||
# 检查是否包含英文字符和数字
|
|
||||||
if not re.search(r'[A-Za-z]', password) or not re.search(r'[0-9]', password):
|
|
||||||
return False
|
|
||||||
|
|
||||||
# 检查是否包含“xiaozhi”字符
|
|
||||||
if "xiaozhi" in password:
|
|
||||||
return False
|
|
||||||
|
|
||||||
if "1234" in password:
|
|
||||||
return False
|
|
||||||
|
|
||||||
# 如果满足所有条件,则返回True
|
|
||||||
return True
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
from abc import ABC, abstractmethod
|
|
||||||
from config.logger import setup_logging
|
|
||||||
import opuslib_next
|
|
||||||
import time
|
|
||||||
import numpy as np
|
|
||||||
import torch
|
|
||||||
|
|
||||||
TAG = __name__
|
|
||||||
logger = setup_logging()
|
|
||||||
|
|
||||||
class VAD(ABC):
|
|
||||||
@abstractmethod
|
|
||||||
def is_vad(self, conn, data):
|
|
||||||
"""检测音频数据中的语音活动"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class SileroVAD(VAD):
|
|
||||||
def __init__(self, config):
|
|
||||||
logger.bind(tag=TAG).info("SileroVAD", config)
|
|
||||||
self.model, self.utils = torch.hub.load(repo_or_dir=config["model_dir"],
|
|
||||||
source='local',
|
|
||||||
model='silero_vad',
|
|
||||||
force_reload=False)
|
|
||||||
(get_speech_timestamps, _, _, _, _) = self.utils
|
|
||||||
|
|
||||||
self.decoder = opuslib_next.Decoder(16000, 1)
|
|
||||||
self.vad_threshold = config.get("threshold")
|
|
||||||
self.silence_threshold_ms = config.get("min_silence_duration_ms")
|
|
||||||
|
|
||||||
def is_vad(self, conn, opus_packet):
|
|
||||||
try:
|
|
||||||
pcm_frame = self.decoder.decode(opus_packet, 960)
|
|
||||||
conn.client_audio_buffer += pcm_frame # 将新数据加入缓冲区
|
|
||||||
|
|
||||||
# 处理缓冲区中的完整帧(每次处理512采样点)
|
|
||||||
client_have_voice = False
|
|
||||||
while len(conn.client_audio_buffer) >= 512 * 2:
|
|
||||||
# 提取前512个采样点(1024字节)
|
|
||||||
chunk = conn.client_audio_buffer[:512 * 2]
|
|
||||||
conn.client_audio_buffer = conn.client_audio_buffer[512 * 2:]
|
|
||||||
|
|
||||||
# 转换为模型需要的张量格式
|
|
||||||
audio_int16 = np.frombuffer(chunk, dtype=np.int16)
|
|
||||||
audio_float32 = audio_int16.astype(np.float32) / 32768.0
|
|
||||||
audio_tensor = torch.from_numpy(audio_float32)
|
|
||||||
|
|
||||||
# 检测语音活动
|
|
||||||
speech_prob = self.model(audio_tensor, 16000).item()
|
|
||||||
client_have_voice = speech_prob >= self.vad_threshold
|
|
||||||
|
|
||||||
# 如果之前有声音,但本次没有声音,且与上次有声音的时间查已经超过了静默阈值,则认为已经说完一句话
|
|
||||||
if conn.client_have_voice and not client_have_voice:
|
|
||||||
stop_duration = time.time() * 1000 - conn.client_have_voice_last_time
|
|
||||||
if stop_duration >= self.silence_threshold_ms:
|
|
||||||
conn.client_voice_stop = True
|
|
||||||
if client_have_voice:
|
|
||||||
conn.client_have_voice = True
|
|
||||||
conn.client_have_voice_last_time = time.time() * 1000
|
|
||||||
|
|
||||||
return client_have_voice
|
|
||||||
except opuslib_next.OpusError as e:
|
|
||||||
logger.bind(tag=TAG).info(f"解码错误: {e}")
|
|
||||||
except Exception as e:
|
|
||||||
logger.bind(tag=TAG).error(f"Error processing audio packet: {e}")
|
|
||||||
|
|
||||||
|
|
||||||
def create_instance(class_name, *args, **kwargs) -> VAD:
|
|
||||||
# 获取类对象
|
|
||||||
cls_map = {
|
|
||||||
"SileroVAD": SileroVAD,
|
|
||||||
# 可扩展其他SileroVAD实现
|
|
||||||
}
|
|
||||||
|
|
||||||
if cls := cls_map.get(class_name):
|
|
||||||
return cls(*args, **kwargs)
|
|
||||||
raise ValueError(f"不支持的SileroVAD类型: {class_name}")
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
import asyncio
|
|
||||||
import websockets
|
|
||||||
from config.logger import setup_logging
|
|
||||||
from core.connection import ConnectionHandler
|
|
||||||
from core.utils.util import get_local_ip
|
|
||||||
from core.utils import asr, vad, llm, tts
|
|
||||||
|
|
||||||
TAG = __name__
|
|
||||||
|
|
||||||
|
|
||||||
class WebSocketServer:
|
|
||||||
def __init__(self, config: dict):
|
|
||||||
self.config = config
|
|
||||||
self.logger = setup_logging()
|
|
||||||
self._vad, self._asr, self._llm, self._tts = self._create_processing_instances()
|
|
||||||
|
|
||||||
def _create_processing_instances(self):
|
|
||||||
"""创建处理模块实例"""
|
|
||||||
return (
|
|
||||||
vad.create_instance(
|
|
||||||
self.config["selected_module"]["VAD"],
|
|
||||||
self.config["VAD"][self.config["selected_module"]["VAD"]]
|
|
||||||
),
|
|
||||||
asr.create_instance(
|
|
||||||
self.config["selected_module"]["ASR"]
|
|
||||||
if not 'type' in self.config["ASR"][self.config["selected_module"]["ASR"]]
|
|
||||||
else
|
|
||||||
self.config["ASR"][self.config["selected_module"]["ASR"]]["type"],
|
|
||||||
self.config["ASR"][self.config["selected_module"]["ASR"]],
|
|
||||||
self.config["delete_audio"]
|
|
||||||
),
|
|
||||||
llm.create_instance(
|
|
||||||
self.config["selected_module"]["LLM"]
|
|
||||||
if not 'type' in self.config["LLM"][self.config["selected_module"]["LLM"]]
|
|
||||||
else
|
|
||||||
self.config["LLM"][self.config["selected_module"]["LLM"]]['type'],
|
|
||||||
self.config["LLM"][self.config["selected_module"]["LLM"]],
|
|
||||||
),
|
|
||||||
tts.create_instance(
|
|
||||||
self.config["selected_module"]["TTS"]
|
|
||||||
if not 'type' in self.config["TTS"][self.config["selected_module"]["TTS"]]
|
|
||||||
else
|
|
||||||
self.config["TTS"][self.config["selected_module"]["TTS"]]["type"],
|
|
||||||
self.config["TTS"][self.config["selected_module"]["TTS"]],
|
|
||||||
self.config["delete_audio"]
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
async def start(self):
|
|
||||||
server_config = self.config["server"]
|
|
||||||
host = server_config["ip"]
|
|
||||||
port = server_config["port"]
|
|
||||||
|
|
||||||
self.logger.bind(tag=TAG).info("Server is running at ws://{}:{}", get_local_ip(), port)
|
|
||||||
self.logger.bind(tag=TAG).info("=======上面的地址是websocket协议地址,请勿用浏览器访问=======")
|
|
||||||
async with websockets.serve(
|
|
||||||
self._handle_connection,
|
|
||||||
host,
|
|
||||||
port
|
|
||||||
):
|
|
||||||
await asyncio.Future()
|
|
||||||
|
|
||||||
async def _handle_connection(self, websocket):
|
|
||||||
"""处理新连接,每次创建独立的ConnectionHandler"""
|
|
||||||
handler = ConnectionHandler(self.config, self._vad, self._asr, self._llm, self._tts)
|
|
||||||
await handler.handle_connection(websocket)
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
services:
|
|
||||||
xiaozhi-esp32-server:
|
|
||||||
image: ghcr.nju.edu.cn/xinnan-tech/xiaozhi-esp32-server:latest
|
|
||||||
container_name: xiaozhi-esp32-server
|
|
||||||
restart: always
|
|
||||||
security_opt:
|
|
||||||
- seccomp:unconfined
|
|
||||||
ports:
|
|
||||||
# ws服务端
|
|
||||||
- "8000:8000"
|
|
||||||
# 管理后台
|
|
||||||
- "8002:8002"
|
|
||||||
volumes:
|
|
||||||
# 配置文件目录
|
|
||||||
- ./data:/app/data
|
|
||||||
# 模型文件挂接,很重要
|
|
||||||
- ./models/SenseVoiceSmall/model.pt:/app/models/SenseVoiceSmall/model.pt
|
|
||||||
Executable
+413
@@ -0,0 +1,413 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# 脚本作者@VanillaNahida
|
||||||
|
# 本文件是用于一键自动下载本项目所需文件,自动创建好目录
|
||||||
|
# 暂且只支持X86版本的Ubuntu系统,其他系统未测试
|
||||||
|
|
||||||
|
# 定义中断处理函数
|
||||||
|
handle_interrupt() {
|
||||||
|
echo ""
|
||||||
|
echo "安装已被用户中断(Ctrl+C或Esc)"
|
||||||
|
echo "如需重新安装,请再次运行脚本"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# 设置信号捕获,处理Ctrl+C
|
||||||
|
trap handle_interrupt SIGINT
|
||||||
|
|
||||||
|
# 处理Esc键
|
||||||
|
# 保存终端设置
|
||||||
|
old_stty_settings=$(stty -g)
|
||||||
|
# 设置终端立即响应,不回显
|
||||||
|
stty -icanon -echo min 1 time 0
|
||||||
|
|
||||||
|
# 后台进程检测Esc键
|
||||||
|
(while true; do
|
||||||
|
read -r key
|
||||||
|
if [[ $key == $'\e' ]]; then
|
||||||
|
# 检测到Esc键,触发中断处理
|
||||||
|
kill -SIGINT $$
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done) &
|
||||||
|
|
||||||
|
# 脚本结束时恢复终端设置
|
||||||
|
trap 'stty "$old_stty_settings"' EXIT
|
||||||
|
|
||||||
|
|
||||||
|
# 打印彩色字符画
|
||||||
|
echo -e "\e[1;32m" # 设置颜色为亮绿色
|
||||||
|
cat << "EOF"
|
||||||
|
脚本作者:@Bilibili 香草味的纳西妲喵
|
||||||
|
__ __ _ _ _ _ _ _ _ _
|
||||||
|
\ \ / / (_)| || | | \ | | | | (_) | |
|
||||||
|
\ \ / /__ _ _ __ _ | || | __ _ | \| | __ _ | |__ _ __| | __ _
|
||||||
|
\ \/ // _` || '_ \ | || || | / _` | | . ` | / _` || '_ \ | | / _` | / _` |
|
||||||
|
\ /| (_| || | | || || || || (_| | | |\ || (_| || | | || || (_| || (_| |
|
||||||
|
\/ \__,_||_| |_||_||_||_| \__,_| |_| \_| \__,_||_| |_||_| \__,_| \__,_|
|
||||||
|
EOF
|
||||||
|
echo -e "\e[0m" # 重置颜色
|
||||||
|
echo -e "\e[1;36m 小智服务端全量部署一键安装脚本 Ver 0.2 2025年8月20日更新 \e[0m\n"
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# 检查并安装whiptail
|
||||||
|
check_whiptail() {
|
||||||
|
if ! command -v whiptail &> /dev/null; then
|
||||||
|
echo "正在安装whiptail..."
|
||||||
|
apt update
|
||||||
|
apt install -y whiptail
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_whiptail
|
||||||
|
|
||||||
|
# 创建确认对话框
|
||||||
|
whiptail --title "安装确认" --yesno "即将安装小智服务端,是否继续?" \
|
||||||
|
--yes-button "继续" --no-button "退出" 10 50
|
||||||
|
|
||||||
|
# 根据用户选择执行操作
|
||||||
|
case $? in
|
||||||
|
0)
|
||||||
|
;;
|
||||||
|
1)
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# 检查root权限
|
||||||
|
if [ $EUID -ne 0 ]; then
|
||||||
|
whiptail --title "权限错误" --msgbox "请使用root权限运行本脚本" 10 50
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 检查系统版本
|
||||||
|
if [ -f /etc/os-release ]; then
|
||||||
|
. /etc/os-release
|
||||||
|
if [ "$ID" != "debian" ] && [ "$ID" != "ubuntu" ]; then
|
||||||
|
whiptail --title "系统错误" --msgbox "该脚本只支持Debian/Ubuntu系统执行" 10 60
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
whiptail --title "系统错误" --msgbox "无法确定系统版本,该脚本只支持Debian/Ubuntu系统执行" 10 60
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 下载配置文件函数
|
||||||
|
check_and_download() {
|
||||||
|
local filepath=$1
|
||||||
|
local url=$2
|
||||||
|
if [ ! -f "$filepath" ]; then
|
||||||
|
if ! curl -fL --progress-bar "$url" -o "$filepath"; then
|
||||||
|
whiptail --title "错误" --msgbox "${filepath}文件下载失败" 10 50
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "${filepath}文件已存在,跳过下载"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# 检查是否已安装
|
||||||
|
check_installed() {
|
||||||
|
# 检查目录是否存在且非空
|
||||||
|
if [ -d "/opt/xiaozhi-server/" ] && [ "$(ls -A /opt/xiaozhi-server/)" ]; then
|
||||||
|
DIR_CHECK=1
|
||||||
|
else
|
||||||
|
DIR_CHECK=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 检查容器是否存在
|
||||||
|
if docker inspect xiaozhi-esp32-server > /dev/null 2>&1; then
|
||||||
|
CONTAINER_CHECK=1
|
||||||
|
else
|
||||||
|
CONTAINER_CHECK=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 两次检查都通过
|
||||||
|
if [ $DIR_CHECK -eq 1 ] && [ $CONTAINER_CHECK -eq 1 ]; then
|
||||||
|
return 0 # 已安装
|
||||||
|
else
|
||||||
|
return 1 # 未安装
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# 更新相关
|
||||||
|
if check_installed; then
|
||||||
|
if whiptail --title "已安装检测" --yesno "检测到小智服务端已安装,是否进行升级?" 10 60; then
|
||||||
|
# 用户选择升级,执行清理操作
|
||||||
|
echo "开始升级操作..."
|
||||||
|
|
||||||
|
# 停止并移除所有docker-compose服务
|
||||||
|
docker compose -f /opt/xiaozhi-server/docker-compose_all.yml down
|
||||||
|
|
||||||
|
# 停止并删除特定容器(考虑容器可能不存在的情况)
|
||||||
|
containers=(
|
||||||
|
"xiaozhi-esp32-server"
|
||||||
|
"xiaozhi-esp32-server-web"
|
||||||
|
"xiaozhi-esp32-server-db"
|
||||||
|
"xiaozhi-esp32-server-redis"
|
||||||
|
)
|
||||||
|
|
||||||
|
for container in "${containers[@]}"; do
|
||||||
|
if docker ps -a --format '{{.Names}}' | grep -q "^${container}$"; then
|
||||||
|
docker stop "$container" >/dev/null 2>&1 && \
|
||||||
|
docker rm "$container" >/dev/null 2>&1 && \
|
||||||
|
echo "成功移除容器: $container"
|
||||||
|
else
|
||||||
|
echo "容器不存在,跳过: $container"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# 删除特定镜像(考虑镜像可能不存在的情况)
|
||||||
|
images=(
|
||||||
|
"ghcr.nju.edu.cn/xinnan-tech/xiaozhi-esp32-server:server_latest"
|
||||||
|
"ghcr.nju.edu.cn/xinnan-tech/xiaozhi-esp32-server:web_latest"
|
||||||
|
)
|
||||||
|
|
||||||
|
for image in "${images[@]}"; do
|
||||||
|
if docker images --format '{{.Repository}}:{{.Tag}}' | grep -q "^${image}$"; then
|
||||||
|
docker rmi "$image" >/dev/null 2>&1 && \
|
||||||
|
echo "成功删除镜像: $image"
|
||||||
|
else
|
||||||
|
echo "镜像不存在,跳过: $image"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "所有清理操作完成"
|
||||||
|
|
||||||
|
# 备份原有配置文件
|
||||||
|
mkdir -p /opt/xiaozhi-server/backup/
|
||||||
|
if [ -f /opt/xiaozhi-server/data/.config.yaml ]; then
|
||||||
|
cp /opt/xiaozhi-server/data/.config.yaml /opt/xiaozhi-server/backup/.config.yaml
|
||||||
|
echo "已备份原有配置文件到 /opt/xiaozhi-server/backup/.config.yaml"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 下载最新版配置文件
|
||||||
|
check_and_download "/opt/xiaozhi-server/docker-compose_all.yml" "https://ghfast.top/https://raw.githubusercontent.com/xinnan-tech/xiaozhi-esp32-server/refs/heads/main/main/xiaozhi-server/docker-compose_all.yml"
|
||||||
|
check_and_download "/opt/xiaozhi-server/data/.config.yaml" "https://ghfast.top/https://raw.githubusercontent.com/xinnan-tech/xiaozhi-esp32-server/refs/heads/main/main/xiaozhi-server/config_from_api.yaml"
|
||||||
|
|
||||||
|
# 启动Docker服务
|
||||||
|
echo "开始启动最新版本服务..."
|
||||||
|
# 升级完成后标记,跳过后续下载步骤
|
||||||
|
UPGRADE_COMPLETED=1
|
||||||
|
docker compose -f /opt/xiaozhi-server/docker-compose_all.yml up -d
|
||||||
|
else
|
||||||
|
whiptail --title "跳过升级" --msgbox "已取消升级,将继续使用当前版本。" 10 50
|
||||||
|
# 跳过升级,继续执行后续安装流程
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# 检查curl安装
|
||||||
|
if ! command -v curl &> /dev/null; then
|
||||||
|
echo "------------------------------------------------------------"
|
||||||
|
echo "未检测到curl,正在安装..."
|
||||||
|
apt update
|
||||||
|
apt install -y curl
|
||||||
|
else
|
||||||
|
echo "------------------------------------------------------------"
|
||||||
|
echo "curl已安装,跳过安装步骤"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 检查Docker安装
|
||||||
|
if ! command -v docker &> /dev/null; then
|
||||||
|
echo "------------------------------------------------------------"
|
||||||
|
echo "未检测到Docker,正在安装..."
|
||||||
|
|
||||||
|
# 使用国内镜像源替代官方源
|
||||||
|
DISTRO=$(lsb_release -cs)
|
||||||
|
MIRROR_URL="https://mirrors.aliyun.com/docker-ce/linux/ubuntu"
|
||||||
|
GPG_URL="https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg"
|
||||||
|
|
||||||
|
# 安装基础依赖
|
||||||
|
apt update
|
||||||
|
apt install -y apt-transport-https ca-certificates curl software-properties-common gnupg
|
||||||
|
|
||||||
|
# 创建密钥目录并添加国内镜像源密钥
|
||||||
|
mkdir -p /etc/apt/keyrings
|
||||||
|
curl -fsSL "$GPG_URL" | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||||
|
|
||||||
|
# 添加国内镜像源
|
||||||
|
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] $MIRROR_URL $DISTRO stable" \
|
||||||
|
> /etc/apt/sources.list.d/docker.list
|
||||||
|
|
||||||
|
# 添加备用官方源密钥(避免国内源密钥验证失败)
|
||||||
|
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7EA0A9C3F273FCD8 2>/dev/null || \
|
||||||
|
echo "警告:部分密钥添加失败,继续尝试安装..."
|
||||||
|
|
||||||
|
# 安装Docker
|
||||||
|
apt update
|
||||||
|
apt install -y docker-ce docker-ce-cli containerd.io
|
||||||
|
|
||||||
|
# 启动服务
|
||||||
|
systemctl start docker
|
||||||
|
systemctl enable docker
|
||||||
|
|
||||||
|
# 检查是否安装成功
|
||||||
|
if docker --version; then
|
||||||
|
echo "------------------------------------------------------------"
|
||||||
|
echo "Docker安装完成!"
|
||||||
|
else
|
||||||
|
whiptail --title "错误" --msgbox "Docker安装失败,请检查日志。" 10 50
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Docker已安装,跳过安装步骤"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Docker镜像源配置
|
||||||
|
MIRROR_OPTIONS=(
|
||||||
|
"1" "轩辕镜像 (推荐)"
|
||||||
|
"2" "腾讯云镜像源"
|
||||||
|
"3" "中科大镜像源"
|
||||||
|
"4" "网易163镜像源"
|
||||||
|
"5" "华为云镜像源"
|
||||||
|
"6" "阿里云镜像源"
|
||||||
|
"7" "自定义镜像源"
|
||||||
|
"8" "跳过配置"
|
||||||
|
)
|
||||||
|
|
||||||
|
MIRROR_CHOICE=$(whiptail --title "选择Docker镜像源" --menu "请选择要使用的Docker镜像源" 20 60 10 \
|
||||||
|
"${MIRROR_OPTIONS[@]}" 3>&1 1>&2 2>&3) || {
|
||||||
|
echo "用户取消选择,退出脚本"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
case $MIRROR_CHOICE in
|
||||||
|
1) MIRROR_URL="https://docker.xuanyuan.me" ;;
|
||||||
|
2) MIRROR_URL="https://mirror.ccs.tencentyun.com" ;;
|
||||||
|
3) MIRROR_URL="https://docker.mirrors.ustc.edu.cn" ;;
|
||||||
|
4) MIRROR_URL="https://hub-mirror.c.163.com" ;;
|
||||||
|
5) MIRROR_URL="https://05f073ad3c0010ea0f4bc00b7105ec20.mirror.swr.myhuaweicloud.com" ;;
|
||||||
|
6) MIRROR_URL="https://registry.aliyuncs.com" ;;
|
||||||
|
7) MIRROR_URL=$(whiptail --title "自定义镜像源" --inputbox "请输入完整的镜像源URL:" 10 60 3>&1 1>&2 2>&3) ;;
|
||||||
|
8) MIRROR_URL="" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -n "$MIRROR_URL" ]; then
|
||||||
|
mkdir -p /etc/docker
|
||||||
|
if [ -f /etc/docker/daemon.json ]; then
|
||||||
|
cp /etc/docker/daemon.json /etc/docker/daemon.json.bak
|
||||||
|
fi
|
||||||
|
cat > /etc/docker/daemon.json <<EOF
|
||||||
|
{
|
||||||
|
"dns": ["8.8.8.8", "114.114.114.114"],
|
||||||
|
"registry-mirrors": ["$MIRROR_URL"]
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
whiptail --title "配置成功" --msgbox "已成功添加镜像源: $MIRROR_URL\n请按Enter键重启Docker服务并继续..." 12 60
|
||||||
|
echo "------------------------------------------------------------"
|
||||||
|
echo "开始重启Docker服务..."
|
||||||
|
systemctl restart docker.service
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 创建安装目录
|
||||||
|
echo "------------------------------------------------------------"
|
||||||
|
echo "开始创建安装目录..."
|
||||||
|
# 检查并创建数据目录
|
||||||
|
if [ ! -d /opt/xiaozhi-server/data ]; then
|
||||||
|
mkdir -p /opt/xiaozhi-server/data
|
||||||
|
echo "已创建数据目录: /opt/xiaozhi-server/data"
|
||||||
|
else
|
||||||
|
echo "目录xiaozhi-server/data已存在,跳过创建"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 检查并创建模型目录
|
||||||
|
if [ ! -d /opt/xiaozhi-server/models/SenseVoiceSmall ]; then
|
||||||
|
mkdir -p /opt/xiaozhi-server/models/SenseVoiceSmall
|
||||||
|
echo "已创建模型目录: /opt/xiaozhi-server/models/SenseVoiceSmall"
|
||||||
|
else
|
||||||
|
echo "目录xiaozhi-server/models/SenseVoiceSmall已存在,跳过创建"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "------------------------------------------------------------"
|
||||||
|
echo "开始下载语音识别模型"
|
||||||
|
# 下载模型文件
|
||||||
|
MODEL_PATH="/opt/xiaozhi-server/models/SenseVoiceSmall/model.pt"
|
||||||
|
if [ ! -f "$MODEL_PATH" ]; then
|
||||||
|
(
|
||||||
|
for i in {1..20}; do
|
||||||
|
echo $((i*5))
|
||||||
|
sleep 0.5
|
||||||
|
done
|
||||||
|
) | whiptail --title "下载中" --gauge "开始下载语音识别模型..." 10 60 0
|
||||||
|
curl -fL --progress-bar https://modelscope.cn/models/iic/SenseVoiceSmall/resolve/master/model.pt -o "$MODEL_PATH" || {
|
||||||
|
whiptail --title "错误" --msgbox "model.pt文件下载失败" 10 50
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
else
|
||||||
|
echo "model.pt文件已存在,跳过下载"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 如果不是升级完成,才执行下载
|
||||||
|
if [ -z "$UPGRADE_COMPLETED" ]; then
|
||||||
|
check_and_download "/opt/xiaozhi-server/docker-compose_all.yml" "https://ghfast.top/https://raw.githubusercontent.com/xinnan-tech/xiaozhi-esp32-server/refs/heads/main/main/xiaozhi-server/docker-compose_all.yml"
|
||||||
|
check_and_download "/opt/xiaozhi-server/data/.config.yaml" "https://ghfast.top/https://raw.githubusercontent.com/xinnan-tech/xiaozhi-esp32-server/refs/heads/main/main/xiaozhi-server/config_from_api.yaml"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 启动Docker服务
|
||||||
|
(
|
||||||
|
echo "------------------------------------------------------------"
|
||||||
|
echo "正在拉取Docker镜像..."
|
||||||
|
echo "这可能需要几分钟时间,请耐心等待"
|
||||||
|
docker compose -f /opt/xiaozhi-server/docker-compose_all.yml up -d
|
||||||
|
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
whiptail --title "错误" --msgbox "Docker服务启动失败,请尝试更换镜像源后重新执行本脚本" 10 60
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "------------------------------------------------------------"
|
||||||
|
echo "正在检查服务启动状态..."
|
||||||
|
TIMEOUT=300
|
||||||
|
START_TIME=$(date +%s)
|
||||||
|
while true; do
|
||||||
|
CURRENT_TIME=$(date +%s)
|
||||||
|
if [ $((CURRENT_TIME - START_TIME)) -gt $TIMEOUT ]; then
|
||||||
|
whiptail --title "错误" --msgbox "服务启动超时,未在指定时间内找到预期日志内容" 10 60
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if docker logs xiaozhi-esp32-server-web 2>&1 | grep -q "Started AdminApplication in"; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "服务端启动成功!正在完成配置..."
|
||||||
|
echo "正在启动服务..."
|
||||||
|
docker compose -f /opt/xiaozhi-server/docker-compose_all.yml up -d
|
||||||
|
echo "服务启动完成!"
|
||||||
|
)
|
||||||
|
|
||||||
|
# 密钥配置
|
||||||
|
|
||||||
|
# 获取服务器公网地址
|
||||||
|
PUBLIC_IP=$(hostname -I | awk '{print $1}')
|
||||||
|
whiptail --title "配置服务器密钥" --msgbox "请使用浏览器,访问下方链接,打开智控台并注册账号: \n\n内网地址:http://127.0.0.1:8002/\n公网地址:http://$PUBLIC_IP:8002/ (若是云服务器请在服务器安全组放行端口 8000 8001 8002)。\n\n注册的第一个用户即是超级管理员,以后注册的用户都是普通用户。普通用户只能绑定设备和配置智能体; 超级管理员可以进行模型管理、用户管理、参数配置等功能。\n\n注册好后请按Enter键继续" 18 70
|
||||||
|
SECRET_KEY=$(whiptail --title "配置服务器密钥" --inputbox "请使用超级管理员账号登录智控台\n内网地址:http://127.0.0.1:8002/\n公网地址:http://$PUBLIC_IP:8002/\n在顶部菜单 参数字典 → 参数管理 找到参数编码: server.secret (服务器密钥) \n复制该参数值并输入到下面输入框\n\n请输入密钥(留空则跳过配置):" 15 60 3>&1 1>&2 2>&3)
|
||||||
|
|
||||||
|
if [ -n "$SECRET_KEY" ]; then
|
||||||
|
python3 -c "
|
||||||
|
import sys, yaml;
|
||||||
|
config_path = '/opt/xiaozhi-server/data/.config.yaml';
|
||||||
|
with open(config_path, 'r') as f:
|
||||||
|
config = yaml.safe_load(f) or {};
|
||||||
|
config['manager-api'] = {'url': 'http://xiaozhi-esp32-server-web:8002/xiaozhi', 'secret': '$SECRET_KEY'};
|
||||||
|
with open(config_path, 'w') as f:
|
||||||
|
yaml.dump(config, f);
|
||||||
|
"
|
||||||
|
docker restart xiaozhi-esp32-server
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 获取并显示地址信息
|
||||||
|
LOCAL_IP=$(hostname -I | awk '{print $1}')
|
||||||
|
|
||||||
|
# 修复日志文件获取不到ws的问题,改为硬编码
|
||||||
|
whiptail --title "安装完成!" --msgbox "\
|
||||||
|
服务端相关地址如下:\n\
|
||||||
|
管理后台访问地址: http://$LOCAL_IP:8002\n\
|
||||||
|
OTA 地址: http://$LOCAL_IP:8002/xiaozhi/ota/\n\
|
||||||
|
视觉分析接口地址: http://$LOCAL_IP:8003/mcp/vision/explain\n\
|
||||||
|
WebSocket 地址: ws://$LOCAL_IP:8000/xiaozhi/v1/\n\
|
||||||
|
\n安装完毕!感谢您的使用!\n按Enter键退出..." 16 70
|
||||||
+131
-117
@@ -1,53 +1,63 @@
|
|||||||
# 方式一:docker快速部署
|
# 部署架构图
|
||||||
|

|
||||||
|
# 方式一:Docker只运行Server
|
||||||
|
|
||||||
docker镜像已支持x86架构、arm64架构的CPU,支持在国产操作系统上运行。
|
`0.8.2`版本开始,本项目发行的docker镜像只支持`x86架构`,如果需要在`arm64架构`的CPU上部署,可按照[这个教程](docker-build.md)在本机编译`arm64的镜像`。
|
||||||
|
|
||||||
## 1. 安装docker
|
## 1. 安装docker
|
||||||
|
|
||||||
如果您的电脑还没安装docker,可以按照这里的教程安装:[docker安装](https://www.runoob.com/docker/ubuntu-docker-install.html)
|
如果您的电脑还没安装docker,可以按照这里的教程安装:[docker安装](https://www.runoob.com/docker/ubuntu-docker-install.html)
|
||||||
|
|
||||||
## 2. 创建目录
|
安装好docker后,进继续。
|
||||||
|
|
||||||
安装完后,你需要为这个项目找一个安放配置文件的目录,我们暂且称它为`项目目录`,这个目录最好是一个新建的空的目录。
|
### 1.1 手动部署
|
||||||
|
|
||||||
创建好目录后,你需要在`项目目录`下面创建`data`文件夹和`models`文件夹,`models`下面还要再创建`SenseVoiceSmall`文件夹。
|
#### 1.1.1 创建目录
|
||||||
|
|
||||||
|
安装完docker后,你需要为这个项目找一个安放配置文件的目录,例如我们可以新建一个文件夹叫`xiaozhi-server`。
|
||||||
|
|
||||||
|
创建好目录后,你需要在`xiaozhi-server`下面创建`data`文件夹和`models`文件夹,`models`下面还要再创建`SenseVoiceSmall`文件夹。
|
||||||
|
|
||||||
最终目录结构如下所示:
|
最终目录结构如下所示:
|
||||||
|
|
||||||
```
|
```
|
||||||
你的项目根目录
|
xiaozhi-server
|
||||||
├─ data
|
├─ data
|
||||||
├─ models
|
├─ models
|
||||||
├─ SenseVoiceSmall
|
├─ SenseVoiceSmall
|
||||||
```
|
```
|
||||||
|
|
||||||
## 4. 下载语音识别模型文件
|
#### 1.1.2 下载语音识别模型文件
|
||||||
|
|
||||||
你需要下载语音识别的模型文件,因为本项目的默认语音识别用的是本地离线语音识别方案。可通过这个方式下载
|
你需要下载语音识别的模型文件,因为本项目的默认语音识别用的是本地离线语音识别方案。可通过这个方式下载
|
||||||
[跳转到下载语音识别模型文件](#模型文件)
|
[跳转到下载语音识别模型文件](#模型文件)
|
||||||
|
|
||||||
下载完后,回到本教程。
|
下载完后,回到本教程。
|
||||||
|
|
||||||
## 3. 下载docker-compose.yaml
|
#### 1.1.3 下载配置文件
|
||||||
|
|
||||||
用浏览器打开[这个链接](https://github.com/xinnan-tech/xiaozhi-esp32-server/blob/main/docker-compose.yml)。
|
你需要下载两个配置文件:`docker-compose.yaml` 和 `config.yaml`。需要从项目仓库下载这两个文件。
|
||||||
|
|
||||||
|
##### 1.1.3.1 下载 docker-compose.yaml
|
||||||
|
|
||||||
|
用浏览器打开[这个链接](../main/xiaozhi-server/docker-compose.yml)。
|
||||||
|
|
||||||
在页面的右侧找到名称为`RAW`按钮,在`RAW`按钮的旁边,找到下载的图标,点击下载按钮,下载`docker-compose.yml`文件。 把文件下载到你的
|
在页面的右侧找到名称为`RAW`按钮,在`RAW`按钮的旁边,找到下载的图标,点击下载按钮,下载`docker-compose.yml`文件。 把文件下载到你的
|
||||||
`项目目录`中。
|
`xiaozhi-server`中。
|
||||||
|
|
||||||
下载完后,回到本教程继续往下。
|
下载完后,回到本教程继续往下。
|
||||||
|
|
||||||
## 3. 下载配置文件
|
##### 1.1.3.2 创建 config.yaml
|
||||||
|
|
||||||
用浏览器打开[这个链接](https://github.com/xinnan-tech/xiaozhi-esp32-server/blob/main/config.yaml)。
|
用浏览器打开[这个链接](../main/xiaozhi-server/config.yaml)。
|
||||||
|
|
||||||
在页面的右侧找到名称为`RAW`按钮,在`RAW`按钮的旁边,找到下载的图标,点击下载按钮,下载`config.yaml`文件。 把文件下载到你的
|
在页面的右侧找到名称为`RAW`按钮,在`RAW`按钮的旁边,找到下载的图标,点击下载按钮,下载`config.yaml`文件。 把文件下载到你的
|
||||||
`项目目录`下面的`data`文件夹中,然后把`config.yaml`文件重命名为`.config.yaml`。
|
`xiaozhi-server`下面的`data`文件夹中,然后把`config.yaml`文件重命名为`.config.yaml`。
|
||||||
|
|
||||||
下载完配置文件后,我们确认一下整个`项目目录`里面的文件如下所示:
|
下载完配置文件后,我们确认一下整个`xiaozhi-server`里面的文件如下所示:
|
||||||
|
|
||||||
```
|
```
|
||||||
你的项目根目录
|
xiaozhi-server
|
||||||
├─ docker-compose.yml
|
├─ docker-compose.yml
|
||||||
├─ data
|
├─ data
|
||||||
├─ .config.yaml
|
├─ .config.yaml
|
||||||
@@ -58,19 +68,19 @@ docker镜像已支持x86架构、arm64架构的CPU,支持在国产操作系统
|
|||||||
|
|
||||||
如果你的文件目录结构也是上面的,就继续往下。如果不是,你就再仔细看看是不是漏操作了什么。
|
如果你的文件目录结构也是上面的,就继续往下。如果不是,你就再仔细看看是不是漏操作了什么。
|
||||||
|
|
||||||
## 4. 配置项目文件
|
## 2. 配置项目文件
|
||||||
|
|
||||||
接下里,程序还不能直接运行,你需要配置一下,你到底使用的是什么模型。你可以看这个教程:
|
接下里,程序还不能直接运行,你需要配置一下,你到底使用的是什么模型。你可以看这个教程:
|
||||||
[跳转到配置项目文件](#配置项目)
|
[跳转到配置项目文件](#配置项目)
|
||||||
|
|
||||||
配置完项目文件后,回到本教程继续往下。
|
配置完项目文件后,回到本教程继续往下。
|
||||||
|
|
||||||
## 5. 执行docker命令
|
## 3. 执行docker命令
|
||||||
|
|
||||||
打开命令行工具,使用`终端`或`命令行`工具 进入到你的`项目目录`,执行以下命令
|
打开命令行工具,使用`终端`或`命令行`工具 进入到你的`xiaozhi-server`,执行以下命令
|
||||||
|
|
||||||
```
|
```
|
||||||
docker-compose up -d
|
docker compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
执行完后,再执行以下命令,查看日志信息。
|
执行完后,再执行以下命令,查看日志信息。
|
||||||
@@ -81,92 +91,61 @@ docker logs -f xiaozhi-esp32-server
|
|||||||
|
|
||||||
这时,你就要留意日志信息,可以根据这个教程,判断是否成功了。[跳转到运行状态确认](#运行状态确认)
|
这时,你就要留意日志信息,可以根据这个教程,判断是否成功了。[跳转到运行状态确认](#运行状态确认)
|
||||||
|
|
||||||
## 6.版本升级操作
|
## 5. 版本升级操作
|
||||||
|
|
||||||
如果后期想升级版本,可以这么操作
|
如果后期想升级版本,可以这么操作
|
||||||
|
|
||||||
1、备份好`data`文件夹中的`.config.yaml`文件,一些关键的配置到时复制到新的`.config.yaml`文件里。
|
5.1、备份好`data`文件夹中的`.config.yaml`文件,一些关键的配置到时复制到新的`.config.yaml`文件里。
|
||||||
请注意是对关键密钥逐个复制,不要直接覆盖。因为新的`.config.yaml`文件可能有一些新的配置项,旧的`.config.yaml`文件不一定有。
|
请注意是对关键密钥逐个复制,不要直接覆盖。因为新的`.config.yaml`文件可能有一些新的配置项,旧的`.config.yaml`文件不一定有。
|
||||||
|
|
||||||
2、执行以下命令
|
5.2、执行以下命令
|
||||||
|
|
||||||
```
|
```
|
||||||
docker stop xiaozhi-esp32-server
|
docker stop xiaozhi-esp32-server
|
||||||
docker rm xiaozhi-esp32-server
|
docker rm xiaozhi-esp32-server
|
||||||
docker rmi ghcr.nju.edu.cn/xinnan-tech/xiaozhi-esp32-server:latest
|
docker stop xiaozhi-esp32-server-web
|
||||||
|
docker rm xiaozhi-esp32-server-web
|
||||||
|
docker rmi ghcr.nju.edu.cn/xinnan-tech/xiaozhi-esp32-server:server_latest
|
||||||
|
docker rmi ghcr.nju.edu.cn/xinnan-tech/xiaozhi-esp32-server:web_latest
|
||||||
```
|
```
|
||||||
|
|
||||||
3、重新按docker方式部署
|
5.3、重新按docker方式部署
|
||||||
|
|
||||||
# 方式二:借助Docker环境运行部署
|
# 方式二:本地源码只运行Server
|
||||||
|
|
||||||
开发人员如果不想安装`conda`环境,可以使用这种方法管理好依赖。
|
|
||||||
|
|
||||||
## 1.克隆项目
|
|
||||||
|
|
||||||
## 2.[跳转到下载语音识别模型文件](#模型文件)
|
|
||||||
|
|
||||||
## 3.[跳转到配置项目文件](#配置项目)
|
|
||||||
|
|
||||||
## 4.运行docker
|
|
||||||
|
|
||||||
修改完配置后,打开命令行工具,`cd`进入到你的项目目录下,执行以下命令
|
|
||||||
|
|
||||||
```sh
|
|
||||||
docker run -it --name xiaozhi-env --restart always --security-opt seccomp:unconfined \
|
|
||||||
-p 8000:8000 \
|
|
||||||
-p 8002:8002 \
|
|
||||||
-v ./:/app \
|
|
||||||
ccr.ccs.tencentyun.com/kalicyh/poetry:v3.10_latest
|
|
||||||
```
|
|
||||||
|
|
||||||
然后就和正常开发一样了
|
|
||||||
|
|
||||||
## 5.安装依赖
|
|
||||||
|
|
||||||
在刚刚的打开的终端运行
|
|
||||||
|
|
||||||
```sh
|
|
||||||
poetry install --no-root
|
|
||||||
```
|
|
||||||
|
|
||||||
```sh
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y --no-install-recommends libopus0 ffmpeg
|
|
||||||
```
|
|
||||||
|
|
||||||
速度慢可以尝试使用清华镜像
|
|
||||||
|
|
||||||
```sh
|
|
||||||
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware" > /etc/apt/sources.list
|
|
||||||
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware" >> /etc/apt/sources.list
|
|
||||||
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware" >> /etc/apt/sources.list
|
|
||||||
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware" >> /etc/apt/sources.list
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y --no-install-recommends libopus0 ffmpeg
|
|
||||||
```
|
|
||||||
|
|
||||||
## 6.运行项目
|
|
||||||
|
|
||||||
```sh
|
|
||||||
poetry run python app.py
|
|
||||||
```
|
|
||||||
|
|
||||||
# 方式三:本地源码运行
|
|
||||||
|
|
||||||
## 1.安装基础环境
|
## 1.安装基础环境
|
||||||
|
|
||||||
本项目使用`conda`管理依赖环境。如果不方便安装`conda`,需要根据实际的操作系统安装好`libopus`和`ffmpeg`。
|
本项目使用`conda`管理依赖环境。如果不方便安装`conda`,需要根据实际的操作系统安装好`libopus`和`ffmpeg`。
|
||||||
如果确定使用`conda`,则安装好后,开始执行以下命令。
|
如果确定使用`conda`,则安装好后,开始执行以下命令。
|
||||||
|
|
||||||
|
重要提示!windows 用户,可以通过安装`Anaconda`来管理环境。安装好`Anaconda`后,在`开始`那里搜索`anaconda`相关的关键词,
|
||||||
|
找到`Anaconda Prpmpt`,使用管理员身份运行它。如下图。
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
运行之后,如果你能看到命令行窗口前面有一个(base)字样,说明你成功进入了`conda`环境。那么你就可以执行以下命令了。
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
```
|
```
|
||||||
conda remove -n xiaozhi-esp32-server --all -y
|
conda remove -n xiaozhi-esp32-server --all -y
|
||||||
conda create -n xiaozhi-esp32-server python=3.10 -y
|
conda create -n xiaozhi-esp32-server python=3.10 -y
|
||||||
conda activate xiaozhi-esp32-server
|
conda activate xiaozhi-esp32-server
|
||||||
conda install conda-forge::libopus
|
|
||||||
conda install conda-forge::ffmpeg
|
# 添加清华源通道
|
||||||
|
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
|
||||||
|
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
|
||||||
|
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
|
||||||
|
|
||||||
|
conda install libopus -y
|
||||||
|
conda install ffmpeg -y
|
||||||
|
|
||||||
|
# 在 Linux 环境下进行部署时,如出现类似缺失 libiconv.so.2 动态库的报错 请通过以下命令进行安装
|
||||||
|
conda install libiconv -y
|
||||||
```
|
```
|
||||||
|
|
||||||
|
请注意,以上命令,不是一股脑执行就成功的,你需要一步步执行,每一步执行完后,都检查一下输出的日志,查看是否成功。
|
||||||
|
|
||||||
## 2.安装本项目依赖
|
## 2.安装本项目依赖
|
||||||
|
|
||||||
你先要下载本项目源码,源码可以通过`git clone`命令下载,如果你不熟悉`git clone`命令。
|
你先要下载本项目源码,源码可以通过`git clone`命令下载,如果你不熟悉`git clone`命令。
|
||||||
@@ -176,11 +155,13 @@ conda install conda-forge::ffmpeg
|
|||||||
打开完,找到页面中一个绿色的按钮,写着`Code`的按钮,点开它,然后你就看到`Download ZIP`的按钮。
|
打开完,找到页面中一个绿色的按钮,写着`Code`的按钮,点开它,然后你就看到`Download ZIP`的按钮。
|
||||||
|
|
||||||
点击它,下载本项目源码压缩包。下载到你电脑后,解压它,此时它的名字可能叫`xiaozhi-esp32-server-main`
|
点击它,下载本项目源码压缩包。下载到你电脑后,解压它,此时它的名字可能叫`xiaozhi-esp32-server-main`
|
||||||
你需要把它重命名成`xiaozhi-esp32-server`,好了请记住这个目录,我们暂且称它为`项目目录`。
|
你需要把它重命名成`xiaozhi-esp32-server`,在这个文件里,进入到`main`文件夹,再进入到`xiaozhi-server`,好了请记住这个目录`xiaozhi-server`。
|
||||||
|
|
||||||
```
|
```
|
||||||
# 使用dos或者终端,进入到你的项目目录,执行以下命令
|
# 继续使用conda环境
|
||||||
conda activate xiaozhi-esp32-server
|
conda activate xiaozhi-esp32-server
|
||||||
|
# 进入到你的项目根目录,再进入main/xiaozhi-server
|
||||||
|
cd main/xiaozhi-server
|
||||||
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
|
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
```
|
```
|
||||||
@@ -194,66 +175,61 @@ pip install -r requirements.txt
|
|||||||
|
|
||||||
## 4.配置项目文件
|
## 4.配置项目文件
|
||||||
|
|
||||||
接下里,程序还不能直接运行,你需要配置一下,你到底使用的是什么模型。你可以看这个教程:
|
接下来,程序还不能直接运行,你需要配置一下,你到底使用的是什么模型。你可以看这个教程:
|
||||||
[跳转到配置项目文件](#配置项目)
|
[跳转到配置项目文件](#配置项目)
|
||||||
|
|
||||||
## 5.运行项目
|
## 5.运行项目
|
||||||
|
|
||||||
```
|
```
|
||||||
# 确保在本项目的根目录下执行
|
# 确保在xiaozhi-server目录下执行
|
||||||
conda activate xiaozhi-esp32-server
|
conda activate xiaozhi-esp32-server
|
||||||
python app.py
|
python app.py
|
||||||
```
|
```
|
||||||
|
|
||||||
这时,你就要留意日志信息,可以根据这个教程,判断是否成功了。[跳转到运行状态确认](#运行状态确认)
|
这时,你就要留意日志信息,可以根据这个教程,判断是否成功了。[跳转到运行状态确认](#运行状态确认)
|
||||||
|
|
||||||
|
|
||||||
# 汇总
|
# 汇总
|
||||||
|
|
||||||
## 配置项目
|
## 配置项目
|
||||||
|
|
||||||
如果你的`项目目录`目录没有`data`,你需要创建`data`目录。
|
如果你的`xiaozhi-server`目录没有`data`,你需要创建`data`目录。
|
||||||
如果你的`data`下面没有`.config.yaml`文件,你可以把源码目录下的`config.yaml`文件复制一份,重命名为`.config.yaml`
|
如果你的`data`下面没有`.config.yaml`文件,有两个方式,任选一种:
|
||||||
|
|
||||||
修改`项目目录`下`data`目录下的`.config.yaml`文件,配置本项目所需的各种参数。默认的LLM使用的是`ChatGLMLLM`
|
第一个方式:你可以把`xiaozhi-server`目录下的`config.yaml`文件复制到`data`,并重命名为`.config.yaml`。在此文件上修改
|
||||||
,你需要配置密钥,因为他们的模型,虽然有免费的,但是仍要去[官网](https://bigmodel.cn/usercenter/proj-mgmt/apikeys)注册密钥,才能启动。
|
|
||||||
默认的TTS使用的是`EdgeTTS`,这个无需配置,如果你需要更换成`豆包TTS`,则需要配置密钥。
|
|
||||||
|
|
||||||
配置说明:这里是各个功能使用的默认组件,例如LLM默认使用`ChatGLMLLM`模型。如果需要切换模型,就是改对应的名称。
|
第二个方式:你也可以创建在`data`目录下手动创建`.config.yaml`空文件,然后在这个文件中增加必要的配置信息,系统会优先读取`.config.yaml`文件的配置,如果`.config.yaml`没有配置的,系统会自动去加载`xiaozhi-server`目录下的`config.yaml`的配置。推荐使用这种方式,这种方式是最简洁的方式。
|
||||||
本项目的默认配置仅是成本最低配置(`glm-4-flash`和`EdgeTTS`都是免费的),如果需要更优的更快的搭配,需要自己结合部署环境切换各组件的使用。
|
|
||||||
|
- 默认的LLM使用的是`ChatGLMLLM`,你需要配置密钥,因为他们的模型,虽然有免费的,但是仍要去[官网](https://bigmodel.cn/usercenter/proj-mgmt/apikeys)注册密钥,才能启动。
|
||||||
|
|
||||||
|
以下是一个能正常跑起来的,最简单的`.config.yaml`配置示例
|
||||||
|
|
||||||
```
|
```
|
||||||
|
server:
|
||||||
|
websocket: ws://你的ip或者域名:端口号/xiaozhi/v1/
|
||||||
|
prompt: |
|
||||||
|
我是一个叫小智/小志的台湾女孩,说话机车,声音好听,习惯简短表达,爱用网络梗。
|
||||||
|
我的男朋友是一个程序员,梦想是开发出一个机器人,能够帮助人们解决生活中的各种问题。
|
||||||
|
我是一个喜欢哈哈大笑的女孩,爱东说西说吹牛,不合逻辑的也照吹,就要逗别人开心。
|
||||||
|
请你像一个人一样说话,请勿返回配置xml及其他特殊字符。
|
||||||
|
|
||||||
selected_module:
|
selected_module:
|
||||||
ASR: FunASR
|
LLM: DoubaoLLM
|
||||||
VAD: SileroVAD
|
|
||||||
LLM: ChatGLMLLM
|
|
||||||
TTS: EdgeTTS
|
|
||||||
```
|
|
||||||
|
|
||||||
比如修改`LLM`使用的组件,就看本项目支持哪些`LLM` API接口,当前支持的是`openai`、`dify`。欢迎验证和支持更多LLM平台的接口。
|
|
||||||
使用时,在`selected_module`修改成对应的如下LLM配置的名称:
|
|
||||||
|
|
||||||
```
|
|
||||||
LLM:
|
LLM:
|
||||||
DeepSeekLLM:
|
|
||||||
type: openai
|
|
||||||
...
|
|
||||||
ChatGLMLLM:
|
ChatGLMLLM:
|
||||||
type: openai
|
api_key: xxxxxxxxxxxxxxx.xxxxxx
|
||||||
...
|
|
||||||
DifyLLM:
|
|
||||||
type: dify
|
|
||||||
...
|
|
||||||
```
|
```
|
||||||
|
|
||||||
有些服务,比如如果你使用`Dify`、`豆包的TTS`,是需要密钥的,记得在配置文件加上哦!
|
建议先将最简单的配置运行起来,然后再去`xiaozhi/config.yaml`阅读配置的使用说明。
|
||||||
|
比如你要换更换模型,修改`selected_module`下的配置就行。
|
||||||
|
|
||||||
## 模型文件
|
## 模型文件
|
||||||
|
|
||||||
本项目语音识别模型,默认使用`SenseVoiceSmall`模型,进行语音转文字。因为模型较大,需要独立下载,下载后把`model.pt`
|
本项目语音识别模型,默认使用`SenseVoiceSmall`模型,进行语音转文字。因为模型较大,需要独立下载,下载后把`model.pt`
|
||||||
文件放在`model/SenseVoiceSmall`
|
文件放在`models/SenseVoiceSmall`
|
||||||
目录下。下面两个下载路线任选一个。
|
目录下。下面两个下载路线任选一个。
|
||||||
|
|
||||||
- 线路一:阿里魔塔下载[SenseVoiceSmall](https://modelscope.cn/models/iic/SenseVoiceSmall/resolve/master/model.pt)
|
- 线路一:阿里魔搭下载[SenseVoiceSmall](https://modelscope.cn/models/iic/SenseVoiceSmall/resolve/master/model.pt)
|
||||||
- 线路二:百度网盘下载[SenseVoiceSmall](https://pan.baidu.com/share/init?surl=QlgM58FHhYv1tFnUT_A8Sg&pwd=qvna) 提取码:
|
- 线路二:百度网盘下载[SenseVoiceSmall](https://pan.baidu.com/share/init?surl=QlgM58FHhYv1tFnUT_A8Sg&pwd=qvna) 提取码:
|
||||||
`qvna`
|
`qvna`
|
||||||
|
|
||||||
@@ -262,16 +238,54 @@ LLM:
|
|||||||
如果你能看到,类似以下日志,则是本项目服务启动成功的标志。
|
如果你能看到,类似以下日志,则是本项目服务启动成功的标志。
|
||||||
|
|
||||||
```
|
```
|
||||||
25-02-23 12:01:09[core.websocket_server] - INFO - Server is running at ws://xxx.xx.xx.xx:8000
|
250427 13:04:20[0.3.11_SiFuChTTnofu][__main__]-INFO-OTA接口是 http://192.168.4.123:8003/xiaozhi/ota/
|
||||||
25-02-23 12:01:09[core.websocket_server] - INFO - =======上面的地址是websocket协议地址,请勿用浏览器访问=======
|
250427 13:04:20[0.3.11_SiFuChTTnofu][__main__]-INFO-Websocket地址是 ws://192.168.4.123:8000/xiaozhi/v1/
|
||||||
|
250427 13:04:20[0.3.11_SiFuChTTnofu][__main__]-INFO-=======上面的地址是websocket协议地址,请勿用浏览器访问=======
|
||||||
|
250427 13:04:20[0.3.11_SiFuChTTnofu][__main__]-INFO-如想测试websocket请用谷歌浏览器打开test目录下的test_page.html
|
||||||
|
250427 13:04:20[0.3.11_SiFuChTTnofu][__main__]-INFO-=======================================================
|
||||||
```
|
```
|
||||||
|
|
||||||
正常来说,如果您是通过源码运行本项目,日志会有你的接口地址信息。
|
正常来说,如果您是通过源码运行本项目,日志会有你的接口地址信息。
|
||||||
但是如果你用docker部署,那么你的日志里给出的接口地址信息就不是真实的接口地址。
|
但是如果你用docker部署,那么你的日志里给出的接口地址信息就不是真实的接口地址。
|
||||||
|
|
||||||
最正确的方法,是根据电脑的局域网IP来确定你的接口地址。
|
最正确的方法,是根据电脑的局域网IP来确定你的接口地址。
|
||||||
如果你的电脑的局域网IP比如是`192.168.1.25`,那么你的接口地址就是:`ws://192.168.1.25:8000`。
|
如果你的电脑的局域网IP比如是`192.168.1.25`,那么你的接口地址就是:`ws://192.168.1.25:8000/xiaozhi/v1/`,对应的OTA地址就是:`http://192.168.1.25:8003/xiaozhi/ota/`。
|
||||||
|
|
||||||
这个信息很有用的,后面`编译esp32固件`需要用到。
|
这个信息很有用的,后面`编译esp32固件`需要用到。
|
||||||
|
|
||||||
接下来,你就可以开始 [编译esp32固件](firmware-build.md)了。
|
接下来,你就可以开始操作你的esp32设备了,你可以`自行编译esp32固件`也可以配置使用`虾哥编译好的1.6.1以上版本的固件`。两个任选一个
|
||||||
|
|
||||||
|
1、 [编译自己的esp32固件](firmware-build.md)了。
|
||||||
|
|
||||||
|
2、 [基于虾哥编译好的固件配置自定义服务器](firmware-setting.md)了。
|
||||||
|
|
||||||
|
# 常见问题
|
||||||
|
以下是一些常见问题,供参考:
|
||||||
|
|
||||||
|
1、[为什么我说的话,小智识别出来很多韩文、日文、英文](./FAQ.md)<br/>
|
||||||
|
2、[为什么会出现“TTS 任务出错 文件不存在”?](./FAQ.md)<br/>
|
||||||
|
3、[TTS 经常失败,经常超时](./FAQ.md)<br/>
|
||||||
|
4、[使用Wifi能连接自建服务器,但是4G模式却接不上](./FAQ.md)<br/>
|
||||||
|
5、[如何提高小智对话响应速度?](./FAQ.md)<br/>
|
||||||
|
6、[我说话很慢,停顿时小智老是抢话](./FAQ.md)<br/>
|
||||||
|
## 部署相关教程
|
||||||
|
1、[如何自动拉取本项目最新代码自动编译和启动](./dev-ops-integration.md)<br/>
|
||||||
|
2、[如何部署MQTT网关开启MQTT+UDP协议](./mqtt-gateway-integration.md)<br/>
|
||||||
|
3、[如何与Nginx集成](https://github.com/xinnan-tech/xiaozhi-esp32-server/issues/791)<br/>
|
||||||
|
## 拓展相关教程
|
||||||
|
1、[如何开启手机号码注册智控台](./ali-sms-integration.md)<br/>
|
||||||
|
2、[如何集成HomeAssistant实现智能家居控制](./homeassistant-integration.md)<br/>
|
||||||
|
3、[如何开启视觉模型实现拍照识物](./mcp-vision-integration.md)<br/>
|
||||||
|
4、[如何部署MCP接入点](./mcp-endpoint-enable.md)<br/>
|
||||||
|
5、[如何接入MCP接入点](./mcp-endpoint-integration.md)<br/>
|
||||||
|
6、[如何开启声纹识别](./voiceprint-integration.md)<br/>
|
||||||
|
7、[新闻插件源配置指南](./newsnow_plugin_config.md)<br/>
|
||||||
|
8、[天气插件使用指南](./weather-integration.md)<br/>
|
||||||
|
## 语音克隆、本地语音部署相关教程
|
||||||
|
1、[如何在智控台克隆音色](./huoshan-streamTTS-voice-cloning.md)<br/>
|
||||||
|
2、[如何部署集成index-tts本地语音](./index-stream-integration.md)<br/>
|
||||||
|
3、[如何部署集成fish-speech本地语音](./fish-speech-integration.md)<br/>
|
||||||
|
4、[如何部署集成PaddleSpeech本地语音](./paddlespeech-deploy.md)<br/>
|
||||||
|
## 性能测试教程
|
||||||
|
1、[各组件速度测试指南](./performance_tester.md)<br/>
|
||||||
|
2、[定期公开测试结果](https://github.com/xinnan-tech/xiaozhi-performance-research)<br/>
|
||||||
|
|||||||
@@ -0,0 +1,492 @@
|
|||||||
|
# 部署架构图
|
||||||
|

|
||||||
|
# 方式一:Docker运行全模块
|
||||||
|
`0.8.2`版本开始,本项目发行的docker镜像只支持`x86架构`,如果需要在`arm64架构`的CPU上部署,可按照[这个教程](docker-build.md)在本机编译`arm64的镜像`。
|
||||||
|
|
||||||
|
## 1. 安装docker
|
||||||
|
|
||||||
|
如果您的电脑还没安装docker,可以按照这里的教程安装:[docker安装](https://www.runoob.com/docker/ubuntu-docker-install.html)
|
||||||
|
|
||||||
|
docker 安装全模块有两种方式,你可以[使用懒人脚本](./Deployment_all.md#11-懒人脚本)(作者[@VanillaNahida](https://github.com/VanillaNahida))
|
||||||
|
脚本会自动帮你下载所需的文件和配置文件,你也可以使用[手动部署](./Deployment_all.md#12-手动部署)从零搭建。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### 1.1 懒人脚本
|
||||||
|
部署简便,可以参考[视频教程](https://www.bilibili.com/video/BV17bbvzHExd/) ,文字版教程如下:
|
||||||
|
> [!NOTE]
|
||||||
|
> 暂且只支持Ubuntu服务器一键部署,其他系统未尝试,可能会有一些奇怪的bug
|
||||||
|
|
||||||
|
使用SSH工具连接到服务器,以root权限执行如下脚本
|
||||||
|
```bash
|
||||||
|
sudo bash -c "$(wget -qO- https://ghfast.top/https://raw.githubusercontent.com/xinnan-tech/xiaozhi-esp32-server/main/docker-setup.sh)"
|
||||||
|
```
|
||||||
|
|
||||||
|
脚本会自动完成以下操作:
|
||||||
|
> 1. 安装Docker
|
||||||
|
> 2. 配置镜像源
|
||||||
|
> 3. 下载/拉取镜像
|
||||||
|
> 4. 下载语音识别模型文件
|
||||||
|
> 5. 引导配置服务端
|
||||||
|
>
|
||||||
|
|
||||||
|
执行完成后简单配置后,再参照[4. 运行程序](#4. 运行程序)和[5.重启xiaozhi-esp32-server](#5.重启xiaozhi-esp32-server)里提到的最重要的3件事情,完成3这三项配置后即可使用。
|
||||||
|
|
||||||
|
### 1.2 手动部署
|
||||||
|
|
||||||
|
#### 1.2.1 创建目录
|
||||||
|
|
||||||
|
安装完后,你需要为这个项目找一个安放配置文件的目录,例如我们可以新建一个文件夹叫`xiaozhi-server`。
|
||||||
|
|
||||||
|
创建好目录后,你需要在`xiaozhi-server`下面创建`data`文件夹和`models`文件夹,`models`下面还要再创建`SenseVoiceSmall`文件夹。
|
||||||
|
|
||||||
|
最终目录结构如下所示:
|
||||||
|
|
||||||
|
```
|
||||||
|
xiaozhi-server
|
||||||
|
├─ data
|
||||||
|
├─ models
|
||||||
|
├─ SenseVoiceSmall
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 1.2.2 下载语音识别模型文件
|
||||||
|
|
||||||
|
本项目语音识别模型,默认使用`SenseVoiceSmall`模型,进行语音转文字。因为模型较大,需要独立下载,下载后把`model.pt`
|
||||||
|
文件放在`models/SenseVoiceSmall`
|
||||||
|
目录下。下面两个下载路线任选一个。
|
||||||
|
|
||||||
|
- 线路一:阿里魔搭下载[SenseVoiceSmall](https://modelscope.cn/models/iic/SenseVoiceSmall/resolve/master/model.pt)
|
||||||
|
- 线路二:百度网盘下载[SenseVoiceSmall](https://pan.baidu.com/share/init?surl=QlgM58FHhYv1tFnUT_A8Sg&pwd=qvna) 提取码:
|
||||||
|
`qvna`
|
||||||
|
|
||||||
|
|
||||||
|
#### 1.2.3 下载配置文件
|
||||||
|
|
||||||
|
你需要下载两个配置文件:`docker-compose_all.yaml` 和 `config_from_api.yaml`。需要从项目仓库下载这两个文件。
|
||||||
|
|
||||||
|
##### 1.2.3.1 下载 docker-compose_all.yaml
|
||||||
|
|
||||||
|
用浏览器打开[这个链接](../main/xiaozhi-server/docker-compose_all.yml)。
|
||||||
|
|
||||||
|
在页面的右侧找到名称为`RAW`按钮,在`RAW`按钮的旁边,找到下载的图标,点击下载按钮,下载`docker-compose_all.yml`文件。 把文件下载到你的
|
||||||
|
`xiaozhi-server`中。
|
||||||
|
|
||||||
|
或者直接执行 `wget https://raw.githubusercontent.com/xinnan-tech/xiaozhi-esp32-server/refs/heads/main/main/xiaozhi-server/docker-compose_all.yml` 下载。
|
||||||
|
|
||||||
|
下载完后,回到本教程继续往下。
|
||||||
|
|
||||||
|
##### 1.2.3.2 下载 config_from_api.yaml
|
||||||
|
|
||||||
|
用浏览器打开[这个链接](../main/xiaozhi-server/config_from_api.yaml)。
|
||||||
|
|
||||||
|
在页面的右侧找到名称为`RAW`按钮,在`RAW`按钮的旁边,找到下载的图标,点击下载按钮,下载`config_from_api.yaml`文件。 把文件下载到你的
|
||||||
|
`xiaozhi-server`下面的`data`文件夹中,然后把`config_from_api.yaml`文件重命名为`.config.yaml`。
|
||||||
|
|
||||||
|
或者直接执行 `wget https://raw.githubusercontent.com/xinnan-tech/xiaozhi-esp32-server/refs/heads/main/main/xiaozhi-server/config_from_api.yaml` 下载保存。
|
||||||
|
|
||||||
|
下载完配置文件后,我们确认一下整个`xiaozhi-server`里面的文件如下所示:
|
||||||
|
|
||||||
|
```
|
||||||
|
xiaozhi-server
|
||||||
|
├─ docker-compose_all.yml
|
||||||
|
├─ data
|
||||||
|
├─ .config.yaml
|
||||||
|
├─ models
|
||||||
|
├─ SenseVoiceSmall
|
||||||
|
├─ model.pt
|
||||||
|
```
|
||||||
|
|
||||||
|
如果你的文件目录结构也是上面的,就继续往下。如果不是,你就再仔细看看是不是漏操作了什么。
|
||||||
|
|
||||||
|
## 2. 备份数据
|
||||||
|
|
||||||
|
如果你之前已经成功运行智控台,如果上面保存有你的密钥信息,请先从智控台上拷贝重要数据下来。因为升级过程中,有可能会覆盖原来的数据。
|
||||||
|
|
||||||
|
## 3. 清除历史版本镜像和容器
|
||||||
|
接下来打开命令行工具,使用`终端`或`命令行`工具 进入到你的`xiaozhi-server`,执行以下命令
|
||||||
|
|
||||||
|
```
|
||||||
|
docker compose -f docker-compose_all.yml down
|
||||||
|
|
||||||
|
docker stop xiaozhi-esp32-server
|
||||||
|
docker rm xiaozhi-esp32-server
|
||||||
|
|
||||||
|
docker stop xiaozhi-esp32-server-web
|
||||||
|
docker rm xiaozhi-esp32-server-web
|
||||||
|
|
||||||
|
docker stop xiaozhi-esp32-server-db
|
||||||
|
docker rm xiaozhi-esp32-server-db
|
||||||
|
|
||||||
|
docker stop xiaozhi-esp32-server-redis
|
||||||
|
docker rm xiaozhi-esp32-server-redis
|
||||||
|
|
||||||
|
docker rmi ghcr.nju.edu.cn/xinnan-tech/xiaozhi-esp32-server:server_latest
|
||||||
|
docker rmi ghcr.nju.edu.cn/xinnan-tech/xiaozhi-esp32-server:web_latest
|
||||||
|
```
|
||||||
|
|
||||||
|
## 4. 运行程序
|
||||||
|
执行以下命令启动新版本容器
|
||||||
|
|
||||||
|
```
|
||||||
|
docker compose -f docker-compose_all.yml up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
执行完后,再执行以下命令,查看日志信息。
|
||||||
|
|
||||||
|
```
|
||||||
|
docker logs -f xiaozhi-esp32-server-web
|
||||||
|
```
|
||||||
|
|
||||||
|
当你看到输出日志时,说明你的`智控台`启动成功了。
|
||||||
|
|
||||||
|
```
|
||||||
|
2025-xx-xx 22:11:12.445 [main] INFO c.a.d.s.b.a.DruidDataSourceAutoConfigure - Init DruidDataSource
|
||||||
|
2025-xx-xx 21:28:53.873 [main] INFO xiaozhi.AdminApplication - Started AdminApplication in 16.057 seconds (process running for 17.941)
|
||||||
|
http://localhost:8002/xiaozhi/doc.html
|
||||||
|
```
|
||||||
|
|
||||||
|
请注意此刻仅是`智控台`能运行,如果8000端口`xiaozhi-esp32-server`报错,先不要理会。
|
||||||
|
|
||||||
|
这时,你需要使用浏览器,打开`智控台`,链接:http://127.0.0.1:8002 ,注册第一个用户。第一个用户即是超级管理员,以后的用户都是普通用户。普通用户只能绑定设备和配置智能体;超级管理员可以进行模型管理、用户管理、参数配置等功能。
|
||||||
|
|
||||||
|
接下来要做三件重要的事情:
|
||||||
|
|
||||||
|
### 第一件重要的事情
|
||||||
|
|
||||||
|
使用超级管理员账号,登录智控台,在顶部菜单找到`参数管理`,找到列表中第一条数据,参数编码是`server.secret`,复制它到`参数值`。
|
||||||
|
|
||||||
|
`server.secret`需要说明一下,这个`参数值`很重要,作用是让我们的`Server`端连接`manager-api`。`server.secret`是每次从零部署manager模块时,会自动随机生成的密钥。
|
||||||
|
|
||||||
|
复制`参数值`后,打开`xiaozhi-server`下的`data`目录的`.config.yaml`文件。此刻你的配置文件内容应该是这样的:
|
||||||
|
|
||||||
|
```
|
||||||
|
manager-api:
|
||||||
|
url: http://127.0.0.1:8002/xiaozhi
|
||||||
|
secret: 你的server.secret值
|
||||||
|
```
|
||||||
|
1、把你刚才从`智控台`复制过来的`server.secret`的`参数值`复制到`.config.yaml`文件里的`secret`里。
|
||||||
|
|
||||||
|
2、因为你是docker部署,把`url`改成下面的`http://xiaozhi-esp32-server-web:8002/xiaozhi`
|
||||||
|
|
||||||
|
3、因为你是docker部署,把`url`改成下面的`http://xiaozhi-esp32-server-web:8002/xiaozhi`
|
||||||
|
|
||||||
|
4、因为你是docker部署,把`url`改成下面的`http://xiaozhi-esp32-server-web:8002/xiaozhi`
|
||||||
|
|
||||||
|
类似这样的效果
|
||||||
|
```
|
||||||
|
manager-api:
|
||||||
|
url: http://xiaozhi-esp32-server-web:8002/xiaozhi
|
||||||
|
secret: 12345678-xxxx-xxxx-xxxx-123456789000
|
||||||
|
```
|
||||||
|
|
||||||
|
保存好后,继续往下做第二件重要的事情
|
||||||
|
|
||||||
|
### 第二件重要的事情
|
||||||
|
|
||||||
|
使用超级管理员账号,登录智控台,在顶部菜单找到`模型配置`,然后在左侧栏点击`大语言模型`,找到第一条数据`智谱AI`,点击`修改`按钮,
|
||||||
|
弹出修改框后,将你注册到的`智谱AI`的密钥填写到`API密钥`中。然后点击保存。
|
||||||
|
|
||||||
|
## 5.重启xiaozhi-esp32-server
|
||||||
|
|
||||||
|
接下来打开命令行工具,使用`终端`或`命令行`工具 输入
|
||||||
|
```
|
||||||
|
docker restart xiaozhi-esp32-server
|
||||||
|
docker logs -f xiaozhi-esp32-server
|
||||||
|
```
|
||||||
|
如果你能看到,类似以下日志,则是Server启动成功的标志。
|
||||||
|
|
||||||
|
```
|
||||||
|
25-02-23 12:01:09[core.websocket_server] - INFO - Websocket地址是 ws://xxx.xx.xx.xx:8000/xiaozhi/v1/
|
||||||
|
25-02-23 12:01:09[core.websocket_server] - INFO - =======上面的地址是websocket协议地址,请勿用浏览器访问=======
|
||||||
|
25-02-23 12:01:09[core.websocket_server] - INFO - 如想测试websocket请用谷歌浏览器打开test目录下的test_page.html
|
||||||
|
25-02-23 12:01:09[core.websocket_server] - INFO - =======================================================
|
||||||
|
```
|
||||||
|
|
||||||
|
由于你是全模块部署,因此你有两个重要的接口需要写入到esp32中。
|
||||||
|
|
||||||
|
OTA接口:
|
||||||
|
```
|
||||||
|
http://你宿主机局域网的ip:8002/xiaozhi/ota/
|
||||||
|
```
|
||||||
|
|
||||||
|
Websocket接口:
|
||||||
|
```
|
||||||
|
ws://你宿主机的ip:8000/xiaozhi/v1/
|
||||||
|
```
|
||||||
|
|
||||||
|
### 第三件重要的事情
|
||||||
|
|
||||||
|
使用超级管理员账号,登录智控台,在顶部菜单找到`参数管理`,找到参数编码是`server.websocket`,输入你的`Websocket接口`。
|
||||||
|
|
||||||
|
使用超级管理员账号,登录智控台,在顶部菜单找到`参数管理`,找到数编码是`server.ota`,输入你的`OTA接口`。
|
||||||
|
|
||||||
|
接下来,你就可以开始操作你的esp32设备了,你可以`自行编译esp32固件`也可以配置使用`虾哥编译好的1.6.1以上版本的固件`。两个任选一个
|
||||||
|
|
||||||
|
1、 [编译自己的esp32固件](firmware-build.md)了。
|
||||||
|
|
||||||
|
2、 [基于虾哥编译好的固件配置自定义服务器](firmware-setting.md)了。
|
||||||
|
|
||||||
|
|
||||||
|
# 方式二:本地源码运行全模块
|
||||||
|
|
||||||
|
## 1.安装MySQL数据库
|
||||||
|
|
||||||
|
如果本机已经安装了MySQL,可以直接在数据库中创建名为`xiaozhi_esp32_server`的数据库。
|
||||||
|
|
||||||
|
```sql
|
||||||
|
CREATE DATABASE xiaozhi_esp32_server CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||||
|
```
|
||||||
|
|
||||||
|
如果还没有MySQL,你可以通过docker安装mysql
|
||||||
|
|
||||||
|
```
|
||||||
|
docker run --name xiaozhi-esp32-server-db -e MYSQL_ROOT_PASSWORD=123456 -p 3306:3306 -e MYSQL_DATABASE=xiaozhi_esp32_server -e MYSQL_INITDB_ARGS="--character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci" -e TZ=Asia/Shanghai -d mysql:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
## 2.安装redis
|
||||||
|
|
||||||
|
如果还没有Redis,你可以通过docker安装redis
|
||||||
|
|
||||||
|
```
|
||||||
|
docker run --name xiaozhi-esp32-server-redis -d -p 6379:6379 redis
|
||||||
|
```
|
||||||
|
|
||||||
|
## 3.运行manager-api程序
|
||||||
|
|
||||||
|
3.1 安装JDK21,设置JDK环境变量
|
||||||
|
|
||||||
|
3.2 安装Maven,设置Maven环境变量
|
||||||
|
|
||||||
|
3.3 使用Vscode编程工具,安装好Java环境相关插件
|
||||||
|
|
||||||
|
3.4 使用Vscode编程工具加载manager-api模块
|
||||||
|
|
||||||
|
在`src/main/resources/application-dev.yml`中配置数据库连接信息
|
||||||
|
|
||||||
|
```
|
||||||
|
spring:
|
||||||
|
datasource:
|
||||||
|
username: root
|
||||||
|
password: 123456
|
||||||
|
```
|
||||||
|
在`src/main/resources/application-dev.yml`中配置Redis连接信息
|
||||||
|
```
|
||||||
|
spring:
|
||||||
|
data:
|
||||||
|
redis:
|
||||||
|
host: localhost
|
||||||
|
port: 6379
|
||||||
|
password:
|
||||||
|
database: 0
|
||||||
|
```
|
||||||
|
|
||||||
|
3.5 运行主程序
|
||||||
|
|
||||||
|
本项目为SpringBoot项目,启动方式为:
|
||||||
|
打开`Application.java`运行`Main`方法启动
|
||||||
|
|
||||||
|
```
|
||||||
|
路径地址:
|
||||||
|
src/main/java/xiaozhi/AdminApplication.java
|
||||||
|
```
|
||||||
|
|
||||||
|
当你看到输出日志时,说明你的`manager-api`启动成功了。
|
||||||
|
|
||||||
|
```
|
||||||
|
2025-xx-xx 22:11:12.445 [main] INFO c.a.d.s.b.a.DruidDataSourceAutoConfigure - Init DruidDataSource
|
||||||
|
2025-xx-xx 21:28:53.873 [main] INFO xiaozhi.AdminApplication - Started AdminApplication in 16.057 seconds (process running for 17.941)
|
||||||
|
http://localhost:8002/xiaozhi/doc.html
|
||||||
|
```
|
||||||
|
|
||||||
|
## 4.运行manager-web程序
|
||||||
|
|
||||||
|
4.1 安装nodejs
|
||||||
|
|
||||||
|
4.2 使用Vscode编程工具加载manager-web模块
|
||||||
|
|
||||||
|
终端命令进入manager-web目录下
|
||||||
|
|
||||||
|
```
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
然后启动
|
||||||
|
```
|
||||||
|
npm run serve
|
||||||
|
```
|
||||||
|
|
||||||
|
请注意,如果你的manager-api的接口不在`http://localhost:8002`,请在开发时,修改
|
||||||
|
`main/manager-web/.env.development`中的路径
|
||||||
|
|
||||||
|
运行成功后,你需要使用浏览器,打开`智控台`,链接:http://127.0.0.1:8001 ,注册第一个用户。第一个用户即是超级管理员,以后的用户都是普通用户。普通用户只能绑定设备和配置智能体;超级管理员可以进行模型管理、用户管理、参数配置等功能。
|
||||||
|
|
||||||
|
|
||||||
|
重要:注册成功后,使用超级管理员账号,登录智控台,在顶部菜单找到`模型配置`,然后在左侧栏点击`大语言模型`,找到第一条数据`智谱AI`,点击`修改`按钮,
|
||||||
|
弹出修改框后,将你注册到的`智谱AI`的密钥填写到`API密钥`中。然后点击保存。
|
||||||
|
|
||||||
|
重要:注册成功后,使用超级管理员账号,登录智控台,在顶部菜单找到`模型配置`,然后在左侧栏点击`大语言模型`,找到第一条数据`智谱AI`,点击`修改`按钮,
|
||||||
|
弹出修改框后,将你注册到的`智谱AI`的密钥填写到`API密钥`中。然后点击保存。
|
||||||
|
|
||||||
|
重要:注册成功后,使用超级管理员账号,登录智控台,在顶部菜单找到`模型配置`,然后在左侧栏点击`大语言模型`,找到第一条数据`智谱AI`,点击`修改`按钮,
|
||||||
|
弹出修改框后,将你注册到的`智谱AI`的密钥填写到`API密钥`中。然后点击保存。
|
||||||
|
|
||||||
|
## 5.安装Python环境
|
||||||
|
|
||||||
|
本项目使用`conda`管理依赖环境。如果不方便安装`conda`,需要根据实际的操作系统安装好`libopus`和`ffmpeg`。
|
||||||
|
如果确定使用`conda`,则安装好后,开始执行以下命令。
|
||||||
|
|
||||||
|
重要提示!windows 用户,可以通过安装`Anaconda`来管理环境。安装好`Anaconda`后,在`开始`那里搜索`anaconda`相关的关键词,
|
||||||
|
找到`Anaconda Prpmpt`,使用管理员身份运行它。如下图。
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
运行之后,如果你能看到命令行窗口前面有一个(base)字样,说明你成功进入了`conda`环境。那么你就可以执行以下命令了。
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
```
|
||||||
|
conda remove -n xiaozhi-esp32-server --all -y
|
||||||
|
conda create -n xiaozhi-esp32-server python=3.10 -y
|
||||||
|
conda activate xiaozhi-esp32-server
|
||||||
|
|
||||||
|
# 添加清华源通道
|
||||||
|
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
|
||||||
|
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
|
||||||
|
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
|
||||||
|
|
||||||
|
conda install libopus -y
|
||||||
|
conda install ffmpeg -y
|
||||||
|
|
||||||
|
# 在 Linux 环境下进行部署时,如出现类似缺失 libiconv.so.2 动态库的报错 请通过以下命令进行安装
|
||||||
|
conda install libiconv -y
|
||||||
|
```
|
||||||
|
|
||||||
|
请注意,以上命令,不是一股脑执行就成功的,你需要一步步执行,每一步执行完后,都检查一下输出的日志,查看是否成功。
|
||||||
|
|
||||||
|
## 6.安装本项目依赖
|
||||||
|
|
||||||
|
你先要下载本项目源码,源码可以通过`git clone`命令下载,如果你不熟悉`git clone`命令。
|
||||||
|
|
||||||
|
你可以用浏览器打开这个地址`https://github.com/xinnan-tech/xiaozhi-esp32-server.git`
|
||||||
|
|
||||||
|
打开完,找到页面中一个绿色的按钮,写着`Code`的按钮,点开它,然后你就看到`Download ZIP`的按钮。
|
||||||
|
|
||||||
|
点击它,下载本项目源码压缩包。下载到你电脑后,解压它,此时它的名字可能叫`xiaozhi-esp32-server-main`
|
||||||
|
你需要把它重命名成`xiaozhi-esp32-server`,在这个文件里,进入到`main`文件夹,再进入到`xiaozhi-server`,好了请记住这个目录`xiaozhi-server`。
|
||||||
|
|
||||||
|
```
|
||||||
|
# 继续使用conda环境
|
||||||
|
conda activate xiaozhi-esp32-server
|
||||||
|
# 进入到你的项目根目录,再进入main/xiaozhi-server
|
||||||
|
cd main/xiaozhi-server
|
||||||
|
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
|
||||||
|
pip install -r requirements.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
### 7.下载语音识别模型文件
|
||||||
|
|
||||||
|
本项目语音识别模型,默认使用`SenseVoiceSmall`模型,进行语音转文字。因为模型较大,需要独立下载,下载后把`model.pt`
|
||||||
|
文件放在`models/SenseVoiceSmall`
|
||||||
|
目录下。下面两个下载路线任选一个。
|
||||||
|
|
||||||
|
- 线路一:阿里魔搭下载[SenseVoiceSmall](https://modelscope.cn/models/iic/SenseVoiceSmall/resolve/master/model.pt)
|
||||||
|
- 线路二:百度网盘下载[SenseVoiceSmall](https://pan.baidu.com/share/init?surl=QlgM58FHhYv1tFnUT_A8Sg&pwd=qvna) 提取码:
|
||||||
|
`qvna`
|
||||||
|
|
||||||
|
## 8.配置项目文件
|
||||||
|
|
||||||
|
使用超级管理员账号,登录智控台 ,在顶部菜单找到`参数管理`,找到列表中第一条数据,参数编码是`server.secret`,复制它到`参数值`。
|
||||||
|
|
||||||
|
`server.secret`需要说明一下,这个`参数值`很重要,作用是让我们的`Server`端连接`manager-api`。`server.secret`是每次从零部署manager模块时,会自动随机生成的密钥。
|
||||||
|
|
||||||
|
如果你的`xiaozhi-server`目录没有`data`,你需要创建`data`目录。
|
||||||
|
如果你的`data`下面没有`.config.yaml`文件,你可以把`xiaozhi-server`目录下的`config_from_api.yaml`文件复制到`data`,并重命名为`.config.yaml`
|
||||||
|
|
||||||
|
复制`参数值`后,打开`xiaozhi-server`下的`data`目录的`.config.yaml`文件。此刻你的配置文件内容应该是这样的:
|
||||||
|
|
||||||
|
```
|
||||||
|
manager-api:
|
||||||
|
url: http://127.0.0.1:8002/xiaozhi
|
||||||
|
secret: 你的server.secret值
|
||||||
|
```
|
||||||
|
|
||||||
|
把你刚才从`智控台`复制过来的`server.secret`的`参数值`复制到`.config.yaml`文件里的`secret`里。
|
||||||
|
|
||||||
|
类似这样的效果
|
||||||
|
```
|
||||||
|
manager-api:
|
||||||
|
url: http://127.0.0.1:8002/xiaozhi
|
||||||
|
secret: 12345678-xxxx-xxxx-xxxx-123456789000
|
||||||
|
```
|
||||||
|
|
||||||
|
## 5.运行项目
|
||||||
|
|
||||||
|
```
|
||||||
|
# 确保在xiaozhi-server目录下执行
|
||||||
|
conda activate xiaozhi-esp32-server
|
||||||
|
python app.py
|
||||||
|
```
|
||||||
|
|
||||||
|
如果你能看到,类似以下日志,则是本项目服务启动成功的标志。
|
||||||
|
|
||||||
|
```
|
||||||
|
25-02-23 12:01:09[core.websocket_server] - INFO - Server is running at ws://xxx.xx.xx.xx:8000/xiaozhi/v1/
|
||||||
|
25-02-23 12:01:09[core.websocket_server] - INFO - =======上面的地址是websocket协议地址,请勿用浏览器访问=======
|
||||||
|
25-02-23 12:01:09[core.websocket_server] - INFO - 如想测试websocket请用谷歌浏览器打开test目录下的test_page.html
|
||||||
|
25-02-23 12:01:09[core.websocket_server] - INFO - =======================================================
|
||||||
|
```
|
||||||
|
|
||||||
|
由于你是全模块部署,因此你有两个重要的接口。
|
||||||
|
|
||||||
|
OTA接口:
|
||||||
|
```
|
||||||
|
http://你电脑局域网的ip:8002/xiaozhi/ota/
|
||||||
|
```
|
||||||
|
|
||||||
|
Websocket接口:
|
||||||
|
```
|
||||||
|
ws://你电脑局域网的ip:8000/xiaozhi/v1/
|
||||||
|
```
|
||||||
|
|
||||||
|
请你务必把以上两个接口地址写入到智控台中:他们将会影响websocket地址发放和自动升级功能。
|
||||||
|
|
||||||
|
1、使用超级管理员账号,登录智控台,在顶部菜单找到`参数管理`,找到参数编码是`server.websocket`,输入你的`Websocket接口`。
|
||||||
|
|
||||||
|
2、使用超级管理员账号,登录智控台,在顶部菜单找到`参数管理`,找到数编码是`server.ota`,输入你的`OTA接口`。
|
||||||
|
|
||||||
|
|
||||||
|
接下来,你就可以开始操作你的esp32设备了,你可以`自行编译esp32固件`也可以配置使用`虾哥编译好的1.6.1以上版本的固件`。两个任选一个
|
||||||
|
|
||||||
|
1、 [编译自己的esp32固件](firmware-build.md)了。
|
||||||
|
|
||||||
|
2、 [基于虾哥编译好的固件配置自定义服务器](firmware-setting.md)了。
|
||||||
|
|
||||||
|
# 常见问题
|
||||||
|
以下是一些常见问题,供参考:
|
||||||
|
|
||||||
|
1、[为什么我说的话,小智识别出来很多韩文、日文、英文](./FAQ.md)<br/>
|
||||||
|
2、[为什么会出现“TTS 任务出错 文件不存在”?](./FAQ.md)<br/>
|
||||||
|
3、[TTS 经常失败,经常超时](./FAQ.md)<br/>
|
||||||
|
4、[使用Wifi能连接自建服务器,但是4G模式却接不上](./FAQ.md)<br/>
|
||||||
|
5、[如何提高小智对话响应速度?](./FAQ.md)<br/>
|
||||||
|
6、[我说话很慢,停顿时小智老是抢话](./FAQ.md)<br/>
|
||||||
|
## 部署相关教程
|
||||||
|
1、[如何自动拉取本项目最新代码自动编译和启动](./dev-ops-integration.md)<br/>
|
||||||
|
2、[如何部署MQTT网关开启MQTT+UDP协议](./mqtt-gateway-integration.md)<br/>
|
||||||
|
3、[如何与Nginx集成](https://github.com/xinnan-tech/xiaozhi-esp32-server/issues/791)<br/>
|
||||||
|
## 拓展相关教程
|
||||||
|
1、[如何开启手机号码注册智控台](./ali-sms-integration.md)<br/>
|
||||||
|
2、[如何集成HomeAssistant实现智能家居控制](./homeassistant-integration.md)<br/>
|
||||||
|
3、[如何开启视觉模型实现拍照识物](./mcp-vision-integration.md)<br/>
|
||||||
|
4、[如何部署MCP接入点](./mcp-endpoint-enable.md)<br/>
|
||||||
|
5、[如何接入MCP接入点](./mcp-endpoint-integration.md)<br/>
|
||||||
|
6、[如何开启声纹识别](./voiceprint-integration.md)<br/>
|
||||||
|
7、[新闻插件源配置指南](./newsnow_plugin_config.md)<br/>
|
||||||
|
8、[天气插件使用指南](./weather-integration.md)<br/>
|
||||||
|
## 语音克隆、本地语音部署相关教程
|
||||||
|
1、[如何在智控台克隆音色](./huoshan-streamTTS-voice-cloning.md)<br/>
|
||||||
|
2、[如何部署集成index-tts本地语音](./index-stream-integration.md)<br/>
|
||||||
|
3、[如何部署集成fish-speech本地语音](./fish-speech-integration.md)<br/>
|
||||||
|
4、[如何部署集成PaddleSpeech本地语音](./paddlespeech-deploy.md)<br/>
|
||||||
|
## 性能测试教程
|
||||||
|
1、[各组件速度测试指南](./performance_tester.md)<br/>
|
||||||
|
2、[定期公开测试结果](https://github.com/xinnan-tech/xiaozhi-performance-research)<br/>
|
||||||
+99
@@ -0,0 +1,99 @@
|
|||||||
|
# 常见问题 ❓
|
||||||
|
|
||||||
|
### 1、为什么我说的话,小智识别出来很多韩文、日文、英文?🇰🇷
|
||||||
|
|
||||||
|
建议:检查一下`models/SenseVoiceSmall`是否已经有`model.pt`
|
||||||
|
文件,如果没有就要下载,查看这里[下载语音识别模型文件](Deployment.md#模型文件)
|
||||||
|
|
||||||
|
### 2、为什么会出现"TTS 任务出错 文件不存在"?📁
|
||||||
|
|
||||||
|
建议:检查一下是否正确使用`conda` 安装了`libopus`和`ffmpeg`库。
|
||||||
|
|
||||||
|
如果没有安装,就安装
|
||||||
|
|
||||||
|
```
|
||||||
|
conda install conda-forge::libopus
|
||||||
|
conda install conda-forge::ffmpeg
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3、TTS 经常失败,经常超时 ⏰
|
||||||
|
|
||||||
|
建议:如果 `EdgeTTS` 经常失败,请先检查是否使用了代理(梯子)。如果使用了,请尝试关闭代理后再试;
|
||||||
|
如果用的是火山引擎的豆包 TTS,经常失败时建议使用付费版本,因为测试版本仅支持 2 个并发。
|
||||||
|
|
||||||
|
### 4、使用Wifi能连接自建服务器,但是4G模式却接不上 🔐
|
||||||
|
|
||||||
|
原因:虾哥的固件,4G模式需要使用安全连接。
|
||||||
|
|
||||||
|
解决方法:目前有两种方法可以解决。任选一种:
|
||||||
|
|
||||||
|
1、改代码。参考这个视频解决 https://www.bilibili.com/video/BV18MfTYoE85
|
||||||
|
|
||||||
|
2、使用nginx配置ssl证书。参考教程 https://icnt94i5ctj4.feishu.cn/docx/GnYOdMNJOoRCljx1ctecsj9cnRe
|
||||||
|
|
||||||
|
### 5、如何提高小智对话响应速度? ⚡
|
||||||
|
|
||||||
|
本项目默认配置为低成本方案,建议初学者先使用默认免费模型,解决"跑得动"的问题,再优化"跑得快"。
|
||||||
|
如需提升响应速度,可尝试更换各组件。自`0.5.2`版本起,项目支持流式配置,相比早期版本,响应速度提升约`2.5秒`,显著改善用户体验。
|
||||||
|
|
||||||
|
| 模块名称 | 入门全免费设置 | 流式配置 |
|
||||||
|
|:---:|:---:|:---:|
|
||||||
|
| ASR(语音识别) | FunASR(本地) | 👍XunfeiStreamASR(讯飞流式) |
|
||||||
|
| LLM(大模型) | glm-4-flash(智谱) | 👍qwen-flash(阿里百炼) |
|
||||||
|
| VLLM(视觉大模型) | glm-4v-flash(智谱) | 👍qwen2.5-vl-3b-instructh(阿里百炼) |
|
||||||
|
| TTS(语音合成) | ✅LinkeraiTTS(灵犀流式) | 👍HuoshanDoubleStreamTTS(火山流式) |
|
||||||
|
| Intent(意图识别) | function_call(函数调用) | function_call(函数调用) |
|
||||||
|
| Memory(记忆功能) | mem_local_short(本地短期记忆) | mem_local_short(本地短期记忆) |
|
||||||
|
|
||||||
|
如果您关心各组件的耗时,请查阅[小智各组件性能测试报告](https://github.com/xinnan-tech/xiaozhi-performance-research),可按报告中的测试方法在您的环境中实际测试。
|
||||||
|
|
||||||
|
### 6、我说话很慢,停顿时小智老是抢话 🗣️
|
||||||
|
|
||||||
|
建议:在配置文件中找到如下部分,将 `min_silence_duration_ms` 的值调大(例如改为 `1000`):
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
VAD:
|
||||||
|
SileroVAD:
|
||||||
|
threshold: 0.5
|
||||||
|
model_dir: models/snakers4_silero-vad
|
||||||
|
min_silence_duration_ms: 700 # 如果说话停顿较长,可将此值调大
|
||||||
|
```
|
||||||
|
|
||||||
|
### 7、部署相关教程
|
||||||
|
1、[如何进行最简化部署](./Deployment.md)<br/>
|
||||||
|
2、[如何进行全模块部署](./Deployment_all.md)<br/>
|
||||||
|
3、[如何部署MQTT网关开启MQTT+UDP协议](./mqtt-gateway-integration.md)<br/>
|
||||||
|
4、[如何自动拉取本项目最新代码自动编译和启动](./dev-ops-integration.md)<br/>
|
||||||
|
5、[如何与Nginx集成](https://github.com/xinnan-tech/xiaozhi-esp32-server/issues/791)<br/>
|
||||||
|
|
||||||
|
### 9、编译固件相关教程
|
||||||
|
1、[如何自己编译小智固件](./firmware-build.md)<br/>
|
||||||
|
2、[如何基于虾哥编译好的固件修改OTA地址](./firmware-setting.md)<br/>
|
||||||
|
3、[单模块部署如何配置固件OTA自动升级](./ota-upgrade-guide.md)<br/>
|
||||||
|
|
||||||
|
### 10、拓展相关教程
|
||||||
|
1、[如何开启手机号码注册智控台](./ali-sms-integration.md)<br/>
|
||||||
|
2、[如何集成HomeAssistant实现智能家居控制](./homeassistant-integration.md)<br/>
|
||||||
|
3、[如何开启视觉模型实现拍照识物](./mcp-vision-integration.md)<br/>
|
||||||
|
4、[如何部署MCP接入点](./mcp-endpoint-enable.md)<br/>
|
||||||
|
5、[如何接入MCP接入点](./mcp-endpoint-integration.md)<br/>
|
||||||
|
6、[MCP方法如何获取设备信息](./mcp-get-device-info.md)<br/>
|
||||||
|
7、[如何开启声纹识别](./voiceprint-integration.md)<br/>
|
||||||
|
8、[新闻插件源配置指南](./newsnow_plugin_config.md)<br/>
|
||||||
|
9、[知识库ragflow集成指南](./ragflow-integration.md)<br/>
|
||||||
|
10、[如何部署上下文源](./context-provider-integration.md)<br/>
|
||||||
|
11、[如何集成PowerMem智能记忆](./powermem-integration.md)<br/>
|
||||||
|
|
||||||
|
### 11、语音克隆、本地语音部署相关教程
|
||||||
|
1、[如何在智控台克隆音色](./huoshan-streamTTS-voice-cloning.md)<br/>
|
||||||
|
2、[如何部署集成index-tts本地语音](./index-stream-integration.md)<br/>
|
||||||
|
3、[如何部署集成fish-speech本地语音](./fish-speech-integration.md)<br/>
|
||||||
|
4、[如何部署集成PaddleSpeech本地语音](./paddlespeech-deploy.md)<br/>
|
||||||
|
|
||||||
|
### 12、性能测试教程
|
||||||
|
1、[各组件速度测试指南](./performance_tester.md)<br/>
|
||||||
|
2、[定期公开测试结果](https://github.com/xinnan-tech/xiaozhi-performance-research)<br/>
|
||||||
|
|
||||||
|
### 13、更多问题,可联系我们反馈 💬
|
||||||
|
|
||||||
|
可以在[issues](https://github.com/xinnan-tech/xiaozhi-esp32-server/issues)提交您的问题。
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
# 阿里云短信集成指南
|
||||||
|
|
||||||
|
登录阿里云控制台,进入“短信服务”页面:https://dysms.console.aliyun.com/overview
|
||||||
|
|
||||||
|
## 第一步 添加签名
|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
以上步骤,会得到签名,请把它写入到智控台参数,`aliyun.sms.sign_name`
|
||||||
|
|
||||||
|
## 第二步 添加模版
|
||||||
|

|
||||||
|
|
||||||
|
以上步骤,会得到模版code,请把它写入到智控台参数,`aliyun.sms.sms_code_template_code`
|
||||||
|
|
||||||
|
注意,签名要等7个工作日,等运营商报备成功后才能发送成功。
|
||||||
|
|
||||||
|
注意,签名要等7个工作日,等运营商报备成功后才能发送成功。
|
||||||
|
|
||||||
|
注意,签名要等7个工作日,等运营商报备成功后才能发送成功。
|
||||||
|
|
||||||
|
可以等报备成功后,再继续往下操作。
|
||||||
|
|
||||||
|
## 第三步 创建短信账户和开通权限
|
||||||
|
|
||||||
|
登录阿里云控制台,进入“访问控制”页面:https://ram.console.aliyun.com/overview?activeTab=overview
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
以上步骤,会得到access_key_id和access_key_secret,请把它写入到智控台参数,`aliyun.sms.access_key_id`、`aliyun.sms.access_key_secret`
|
||||||
|
## 第四步 启动手机注册功能
|
||||||
|
|
||||||
|
1、正常来说,以上信息都填完后,会有这个效果,如果没有,可能缺少了某个步骤
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
2、开启允许非管理员用户可注册,将参数`server.allow_user_register`设置成`true`
|
||||||
|
|
||||||
|
3、开启手机注册功能,将参数`server.enable_mobile_register`设置成`true`
|
||||||
|

|
||||||
@@ -0,0 +1,224 @@
|
|||||||
|
# 上下文源使用教程
|
||||||
|
|
||||||
|
## 概述
|
||||||
|
|
||||||
|
`上下文源`,就是为小智系统提示词的上下文添加【数据源】。
|
||||||
|
|
||||||
|
`上下文源` 在小智在唤醒那一刻,获取外部系统的数据,并将其动态注入到大模型的系统提示词(System Prompt)中。
|
||||||
|
让其做到唤醒时感知世界某个事物的状态。
|
||||||
|
|
||||||
|
它和MCP、记忆有本质的区别:`上下文源`是强制让小智感知世界的数据;`记忆(Mem)`是让他知道之前聊了什么内容;`MCP(functionc all)`是当需要调用某项能力/知识的时候使用调用。
|
||||||
|
|
||||||
|
通过这个功能,在小智唤醒的一刹那,“感知”到:
|
||||||
|
- 人体健康传感器状态(体温、血压、血氧状态等)
|
||||||
|
- 业务系统的实时数据(服务器负载、待办数据、股票信息等)
|
||||||
|
- 任何可以通过 HTTP API 获取的文本信息
|
||||||
|
|
||||||
|
**注意**:该功能只是方便小智在唤醒的时候感知事物的状态,而如果想要小智唤醒后实时获取事物的状态,建议在此功能上再结合MCP工具的调用。
|
||||||
|
|
||||||
|
## 工作原理
|
||||||
|
|
||||||
|
1. **配置源**:用户配置一个或多个 HTTP API 地址。
|
||||||
|
2. **触发请求**:当系统构建 Prompt 时,如果发现模板中包含 `{{ dynamic_context }}` 占位符,会请求所有配置的 API。
|
||||||
|
3. **自动注入**:系统会自动将 API 返回的数据格式化为 Markdown 列表,替换 `{{ dynamic_context }}` 占位符。
|
||||||
|
|
||||||
|
## 接口规范
|
||||||
|
|
||||||
|
为了让小智正确解析数据,您的 API 需要满足以下规范:
|
||||||
|
|
||||||
|
- **请求方式**:`GET`
|
||||||
|
- **请求头**:系统会自动添加 `device-id` 字段到 Request Header。
|
||||||
|
- **响应格式**:必须返回 JSON 格式,且包含 `code` 和 `data` 字段。
|
||||||
|
|
||||||
|
### 响应示例
|
||||||
|
|
||||||
|
**情况 1:返回键值对**
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"code": 0,
|
||||||
|
"msg": "success",
|
||||||
|
"data": {
|
||||||
|
"客厅温度": "26℃",
|
||||||
|
"客厅湿度": "45%",
|
||||||
|
"大门状态": "已关闭"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
*注入效果:*
|
||||||
|
```markdown
|
||||||
|
<context>
|
||||||
|
- **客厅温度:** 26℃
|
||||||
|
- **客厅湿度:** 45%
|
||||||
|
- **大门状态:** 已关闭
|
||||||
|
</context>
|
||||||
|
```
|
||||||
|
|
||||||
|
**情况 2:返回列表**
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"code": 0,
|
||||||
|
"data": [
|
||||||
|
"您有10个待办事项",
|
||||||
|
"当前汽车的行驶速度是100km每小时"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
*注入效果:*
|
||||||
|
```markdown
|
||||||
|
<context>
|
||||||
|
- 您有10个待办事项
|
||||||
|
- 当前汽车的行驶速度是100km每小时
|
||||||
|
</context>
|
||||||
|
```
|
||||||
|
|
||||||
|
## 配置指南
|
||||||
|
|
||||||
|
### 方式 1:智控台配置(全模块部署)
|
||||||
|
|
||||||
|
1. 登录智控台,进入**角色配置**页面。
|
||||||
|
2. 找到**上下文源**配置项(点击“编辑源”按钮)。
|
||||||
|
3. 点击**添加**,输入您的 API 地址。
|
||||||
|
4. 如果 API 需要鉴权,可以在**请求头**部分添加 `Authorization` 或其他 Header。
|
||||||
|
5. 保存配置。
|
||||||
|
|
||||||
|
### 方式 2:配置文件配置(单模块部署)
|
||||||
|
|
||||||
|
编辑 `xiaozhi-server/data/.config.yaml` 文件,添加 `context_providers` 配置段:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# 上下文源配置
|
||||||
|
context_providers:
|
||||||
|
- url: "http://api.example.com/data"
|
||||||
|
headers:
|
||||||
|
Authorization: "Bearer your-token"
|
||||||
|
- url: "http://another-api.com/data"
|
||||||
|
```
|
||||||
|
|
||||||
|
## 启用功能
|
||||||
|
|
||||||
|
默认情况下,系统的提示词模板文件(`data/.agent-base-prompt.txt`)中已经预置了 `{{ dynamic_context }}` 占位符,您无需手动添加。
|
||||||
|
|
||||||
|
**示例:**
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
<context>
|
||||||
|
【重要!以下信息已实时提供,无需调用工具查询,请直接使用:】
|
||||||
|
- **设备ID:** {{device_id}}
|
||||||
|
- **当前时间:** {{current_time}}
|
||||||
|
...
|
||||||
|
{{ dynamic_context }}
|
||||||
|
</context>
|
||||||
|
```
|
||||||
|
|
||||||
|
**注意**:如果您不需要使用此功能,可以选择**不配置任何上下文源**,也可以从提示词模板文件中**删除** `{{ dynamic_context }}` 占位符。
|
||||||
|
|
||||||
|
## 附录:Mock 测试服务示例
|
||||||
|
|
||||||
|
为了方便您测试和开发,我们提供了一个简单的 Python Mock Server 脚本。您可以运行此脚本在本地模拟 API 接口。
|
||||||
|
|
||||||
|
**mock_api_server.py**
|
||||||
|
|
||||||
|
```python
|
||||||
|
import http.server
|
||||||
|
import socketserver
|
||||||
|
import json
|
||||||
|
from urllib.parse import urlparse, parse_qs
|
||||||
|
|
||||||
|
# 设置端口号
|
||||||
|
PORT = 8081
|
||||||
|
|
||||||
|
class MockRequestHandler(http.server.SimpleHTTPRequestHandler):
|
||||||
|
def do_GET(self):
|
||||||
|
# 解析路径和参数
|
||||||
|
parsed_path = urlparse(self.path)
|
||||||
|
path = parsed_path.path
|
||||||
|
query = parse_qs(parsed_path.query)
|
||||||
|
|
||||||
|
response_data = {}
|
||||||
|
status_code = 200
|
||||||
|
|
||||||
|
print(f"收到请求: {path}, 参数: {query}")
|
||||||
|
|
||||||
|
# Case 1: 模拟健康数据 (返回字典 Dict)
|
||||||
|
# 路径参数风格: /health
|
||||||
|
# device_id 从 Header 获取
|
||||||
|
if path == "/health":
|
||||||
|
device_id = self.headers.get("device-id", "unknown_device")
|
||||||
|
print(f"device_id: {device_id}")
|
||||||
|
response_data = {
|
||||||
|
"code": 0,
|
||||||
|
"msg": "success",
|
||||||
|
"data": {
|
||||||
|
"测试设备ID": device_id,
|
||||||
|
"心率": "80 bpm",
|
||||||
|
"血压": "120/80 mmHg",
|
||||||
|
"状态": "良好"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Case 2: 模拟新闻列表 (返回列表 List)
|
||||||
|
# 无参数: /news/list
|
||||||
|
elif path == "/news/list":
|
||||||
|
response_data = {
|
||||||
|
"code": 0,
|
||||||
|
"msg": "success",
|
||||||
|
"data": [
|
||||||
|
"今日头条:Python 3.14 发布",
|
||||||
|
"科技新闻:AI 助手改变生活",
|
||||||
|
"本地新闻:明日有大雨,记得带伞"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
# Case 3: 模拟天气简报 (返回字符串 String)
|
||||||
|
# 无参数: /weather/simple
|
||||||
|
elif path == "/weather/simple":
|
||||||
|
response_data = {
|
||||||
|
"code": 0,
|
||||||
|
"msg": "success",
|
||||||
|
"data": "今日晴转多云,气温 20-25 度,空气质量优,适合出行。"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Case 4: 模拟设备详情 (Query参数风格)
|
||||||
|
# 参数风格: /device/info
|
||||||
|
# device_id 从 Header 获取
|
||||||
|
elif path == "/device/info":
|
||||||
|
device_id = self.headers.get("device-id", "unknown_device")
|
||||||
|
response_data = {
|
||||||
|
"code": 0,
|
||||||
|
"msg": "success",
|
||||||
|
"data": {
|
||||||
|
"查询方式": "Header参数",
|
||||||
|
"设备ID": device_id,
|
||||||
|
"电量": "85%",
|
||||||
|
"固件": "v2.0.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Case 5: 404 Not Found
|
||||||
|
else:
|
||||||
|
status_code = 404
|
||||||
|
response_data = {"error": "接口不存在"}
|
||||||
|
|
||||||
|
# 发送响应
|
||||||
|
self.send_response(status_code)
|
||||||
|
self.send_header('Content-type', 'application/json; charset=utf-8')
|
||||||
|
self.end_headers()
|
||||||
|
self.wfile.write(json.dumps(response_data, ensure_ascii=False).encode('utf-8'))
|
||||||
|
|
||||||
|
# 启动服务
|
||||||
|
# 允许地址重用,防止快速重启报错
|
||||||
|
socketserver.TCPServer.allow_reuse_address = True
|
||||||
|
with socketserver.TCPServer(("", PORT), MockRequestHandler) as httpd:
|
||||||
|
print(f"==================================================")
|
||||||
|
print(f"Mock API Server 已启动: http://localhost:{PORT}")
|
||||||
|
print(f"可用接口列表:")
|
||||||
|
print(f"1. [字典] http://localhost:{PORT}/health")
|
||||||
|
print(f"2. [列表] http://localhost:{PORT}/news/list")
|
||||||
|
print(f"3. [文本] http://localhost:{PORT}/weather/simple")
|
||||||
|
print(f"4. [参数] http://localhost:{PORT}/device/info")
|
||||||
|
print(f"==================================================")
|
||||||
|
try:
|
||||||
|
httpd.serve_forever()
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
print("\n服务已停止")
|
||||||
|
```
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
# 致开发者的公开信
|
||||||
|
|
||||||
|
"春江水暖鸭先知,正是河豚欲上时!"
|
||||||
|
|
||||||
|
亲爱的朋友,我是John,是一名普通公司里的Java程序员,今天,我怀着无比真挚的心情,向热爱AI技术与创新的你发出这封公开信。
|
||||||
|
|
||||||
|
半年前我看到很多优秀的项目,比如`Dify`、`Chat2DB`等人工智能相关的项目,我在想,我要是能参与这些项目多好,可惜“报国无门,空打十年代码”。
|
||||||
|
|
||||||
|
我是2025年初刷到虾哥团队的视频,我非常好奇他是怎么实现的,我想复刻他们的后端服务,打造一个低成本民用贾维斯。很可惜现在做的作品依然只是一个人工智障,它并发低、没有灵魂,响应很慢,bug很多。
|
||||||
|
|
||||||
|
虾哥团队是我们学习的对象,我很想拥有像虾哥团队一样智能的小智后端服务。但是我也能理解虾哥不开源的决定。“一花独放不是春,百花齐放春满园”,人工智能遍地开花的时代,也许就在我们这代实现,我们可以用自己的双手,实现低成本民用贾维斯。我个人认为,他能实现的,我们也能实现,只是时间问题而已,我称之为“我们的取经之路”。
|
||||||
|
|
||||||
|
那么这条取经之路,我们会遇到什么困难?我想应该不少于八十一难。这一路必然会出现各种妖怪,当然也有神仙暗中帮助我们,也有人加入取经队伍。
|
||||||
|
|
||||||
|
以上内容,如果你觉得好笑。那我也觉得非常的幸运。我能够在你人生3万多天里博你笑五秒,也算是为你做了一次贡献。
|
||||||
|
|
||||||
|
民用低成本贾维斯这个想法,会失败吗,我不知道,但是我们普通人的一生,这种失败不是很常见吗?
|
||||||
|
|
||||||
|
未来,有一点是可以确定的,就一定会有人完全复刻虾哥团队的功能,实现民用低成本贾维斯。这个项目会是我们吗?
|
||||||
|
|
||||||
|
期待与你携手前行,共创未来。
|
||||||
|
|
||||||
|
John,2025.3.11,广州
|
||||||
|
|
||||||
|
# 附 开发贡献指南
|
||||||
|
## 项目目标
|
||||||
|
|
||||||
|
1. **民用低成本贾维斯解决方案**
|
||||||
|
|
||||||
|
2. **智能联动周边硬件的解决方案**
|
||||||
|
|
||||||
|
## 加入我们
|
||||||
|
|
||||||
|
我们热忱欢迎志同道合的朋友加入,共同为项目贡献力量。您可在[这个链接](https://github.com/users/xinnan-tech/projects/3)查看我们近期要实现的功能,功能列表中还没指派相关人员处理的,正是急需您的参与。参与方式如下:
|
||||||
|
|
||||||
|
### 1、成为普通贡献者
|
||||||
|
|
||||||
|
Fork 项目,提交 PR,由开发者审核后合入主分支。
|
||||||
|
|
||||||
|
### 2、成为开发者
|
||||||
|
|
||||||
|
当你累计提交 3 次有效 PR 后,可以联系群主申请成为开发者,群主将邀请你加入独立的开发者群,共同探讨项目未来。
|
||||||
|
|
||||||
|
## 开发者开发流程
|
||||||
|
|
||||||
|
1. **创建新分支**
|
||||||
|
每个功能点请以新分支方式开发,分支名称应简洁明了,让人一眼看出所实现的功能,避免功能撞车。
|
||||||
|
|
||||||
|
2. **提交 PR 审核**
|
||||||
|
功能开发完成后,请在 GitHub 上提交 PR,由其他开发者审核,审核通过后合并入主分支。
|
||||||
@@ -0,0 +1,182 @@
|
|||||||
|
# 全模块源码部署自动升级方法
|
||||||
|
|
||||||
|
本教程是方便全模块源码部署的爱好者,如何通过自动命令,自动拉取源码,自动编译,自动启动端口运行。实现最高效率的升级系统。
|
||||||
|
|
||||||
|
本项目的测试平台`https://2662r3426b.vicp.fun`,从开放以来就使用了该方法,效果良好。
|
||||||
|
|
||||||
|
教程可参考B站博主`毕乐labs`发布的视频教程:[《开源小智服务器xiaozhi-server自动更新以及最新版本MCP接入点配置保姆教程》](https://www.bilibili.com/video/BV15H37zHE7Q)
|
||||||
|
|
||||||
|
# 开始条件
|
||||||
|
- 你的电脑/服务器是linux操作系统
|
||||||
|
- 你已经跑通了整个流程
|
||||||
|
- 你喜欢跟进最新功能,但是觉得每次手动部署有点麻烦,期待有一个自动更新的方法
|
||||||
|
|
||||||
|
第二个条件必须满足,因为本教程所涉及的某些文件,JDK、Node.js环境、Conda环境等,是需要你跑通整个流程才有的,如果你没有跑通,当我讲到某个文件的时候,你可能就不知道什么意思。
|
||||||
|
|
||||||
|
# 教程效果
|
||||||
|
- 解决国内不能拉取最新项目源码问题
|
||||||
|
- 自动拉取代码编译前端文件
|
||||||
|
- 自动拉取代码编译java文件,自动杀掉8002端口,自动启动8002端口
|
||||||
|
- 自动拉取python代码,自动杀掉8000端口,自动启动8000端口
|
||||||
|
|
||||||
|
# 第一步 选好你的项目目录
|
||||||
|
|
||||||
|
例如,我规划了我的项目目录是,这是一个新建的空白的目录,如果你不想出错,可以和我一样
|
||||||
|
```
|
||||||
|
/home/system/xiaozhi
|
||||||
|
```
|
||||||
|
|
||||||
|
# 第二步 克隆本项目
|
||||||
|
此刻,先要执行第一句话,拉取源码,这句命令适用于国内网络的服务器和电脑,无需翻墙
|
||||||
|
|
||||||
|
```
|
||||||
|
cd /home/system/xiaozhi
|
||||||
|
git clone https://ghproxy.net/https://github.com/xinnan-tech/xiaozhi-esp32-server.git
|
||||||
|
```
|
||||||
|
|
||||||
|
执行完后,你的项目目录会多了一个文件夹`xiaozhi-esp32-server`,这个就是项目的源码
|
||||||
|
|
||||||
|
# 第三步 复制基础的文件
|
||||||
|
|
||||||
|
如果你之前已经跑通了整个流程,对funasr的模型文件`xiaozhi-server/models/SenseVoiceSmall/model.pt`和你的私有配置文件`xiaozhi-server/data/.config.yaml`这两个文件不会陌生。
|
||||||
|
|
||||||
|
此刻你需要把`model.pt`文件复制到新的目录去,你可以这样
|
||||||
|
```
|
||||||
|
# 创建需要的目录
|
||||||
|
mkdir -p /home/system/xiaozhi/xiaozhi-esp32-server/main/xiaozhi-server/data/
|
||||||
|
|
||||||
|
cp 你原来的.config.yaml完整路径 /home/system/xiaozhi/xiaozhi-esp32-server/main/xiaozhi-server/data/.config.yaml
|
||||||
|
cp 你原来的model.pt完整路径 /home/system/xiaozhi/xiaozhi-esp32-server/main/xiaozhi-server/models/SenseVoiceSmall/model.pt
|
||||||
|
```
|
||||||
|
|
||||||
|
# 第四步 建立三个自动编译文件
|
||||||
|
|
||||||
|
## 4.1 自动编译mananger-web模块
|
||||||
|
在`/home/system/xiaozhi/`目录下,创建名字为`update_8001.sh`的文件,内容如下
|
||||||
|
|
||||||
|
```
|
||||||
|
cd /home/system/xiaozhi/xiaozhi-esp32-server
|
||||||
|
git fetch --all
|
||||||
|
git reset --hard
|
||||||
|
git pull origin main
|
||||||
|
|
||||||
|
|
||||||
|
cd /home/system/xiaozhi/xiaozhi-esp32-server/main/manager-web
|
||||||
|
npm install
|
||||||
|
npm run build
|
||||||
|
rm -rf /home/system/xiaozhi/manager-web
|
||||||
|
mv /home/system/xiaozhi/xiaozhi-esp32-server/main/manager-web/dist /home/system/xiaozhi/manager-web
|
||||||
|
```
|
||||||
|
|
||||||
|
保存好后执行赋权命令
|
||||||
|
```
|
||||||
|
chmod 777 update_8001.sh
|
||||||
|
```
|
||||||
|
执行完后,继续往下
|
||||||
|
|
||||||
|
## 4.2 自动编译运行manager-api模块
|
||||||
|
在`/home/system/xiaozhi/`目录下,创建名字为`update_8002.sh`的文件,内容如下
|
||||||
|
|
||||||
|
```
|
||||||
|
cd /home/system/xiaozhi/xiaozhi-esp32-server
|
||||||
|
git pull origin main
|
||||||
|
|
||||||
|
|
||||||
|
cd /home/system/xiaozhi/xiaozhi-esp32-server/main/manager-api
|
||||||
|
rm -rf target
|
||||||
|
mvn clean package -Dmaven.test.skip=true
|
||||||
|
cd /home/system/xiaozhi/
|
||||||
|
|
||||||
|
# 查找占用8002端口的进程号
|
||||||
|
PID=$(sudo netstat -tulnp | grep 8002 | awk '{print $7}' | cut -d'/' -f1)
|
||||||
|
|
||||||
|
rm -rf /home/system/xiaozhi/xiaozhi-esp32-api.jar
|
||||||
|
mv /home/system/xiaozhi/xiaozhi-esp32-server/main/manager-api/target/xiaozhi-esp32-api.jar /home/system/xiaozhi/xiaozhi-esp32-api.jar
|
||||||
|
|
||||||
|
# 检查是否找到进程号
|
||||||
|
if [ -z "$PID" ]; then
|
||||||
|
echo "没有找到占用8002端口的进程"
|
||||||
|
else
|
||||||
|
echo "找到占用8002端口的进程,进程号为: $PID"
|
||||||
|
# 杀掉进程
|
||||||
|
kill -9 $PID
|
||||||
|
kill -9 $PID
|
||||||
|
echo "已杀掉进程 $PID"
|
||||||
|
fi
|
||||||
|
|
||||||
|
nohup java -jar xiaozhi-esp32-api.jar --spring.profiles.active=dev &
|
||||||
|
|
||||||
|
tail tail -f nohup.out
|
||||||
|
```
|
||||||
|
|
||||||
|
保存好后执行赋权命令
|
||||||
|
```
|
||||||
|
chmod 777 update_8002.sh
|
||||||
|
```
|
||||||
|
执行完后,继续往下
|
||||||
|
|
||||||
|
## 4.3 自动编译运行Python项目
|
||||||
|
在`/home/system/xiaozhi/`目录下,创建名字为`update_8000.sh`的文件,内容如下
|
||||||
|
|
||||||
|
```
|
||||||
|
cd /home/system/xiaozhi/xiaozhi-esp32-server
|
||||||
|
git pull origin main
|
||||||
|
|
||||||
|
# 查找占用8000端口的进程号
|
||||||
|
PID=$(sudo netstat -tulnp | grep 8000 | awk '{print $7}' | cut -d'/' -f1)
|
||||||
|
|
||||||
|
# 检查是否找到进程号
|
||||||
|
if [ -z "$PID" ]; then
|
||||||
|
echo "没有找到占用8000端口的进程"
|
||||||
|
else
|
||||||
|
echo "找到占用8000端口的进程,进程号为: $PID"
|
||||||
|
# 杀掉进程
|
||||||
|
kill -9 $PID
|
||||||
|
kill -9 $PID
|
||||||
|
echo "已杀掉进程 $PID"
|
||||||
|
fi
|
||||||
|
cd main/xiaozhi-server
|
||||||
|
# 初始化conda环境
|
||||||
|
source ~/.bashrc
|
||||||
|
conda activate xiaozhi-esp32-server
|
||||||
|
pip install -r requirements.txt
|
||||||
|
nohup python app.py >/dev/null &
|
||||||
|
tail -f /home/system/xiaozhi/xiaozhi-esp32-server/main/xiaozhi-server/tmp/server.log
|
||||||
|
```
|
||||||
|
|
||||||
|
保存好后执行赋权命令
|
||||||
|
```
|
||||||
|
chmod 777 update_8000.sh
|
||||||
|
```
|
||||||
|
执行完后,继续往下
|
||||||
|
|
||||||
|
# 日常更新
|
||||||
|
|
||||||
|
以上的脚本都建立好后,日常更新,我们只要依次执行以下命令就可以做到自动更新和启动
|
||||||
|
|
||||||
|
```
|
||||||
|
cd /home/system/xiaozhi
|
||||||
|
# 更新并启动Java程序
|
||||||
|
./update_8001.sh
|
||||||
|
# 更新web程序
|
||||||
|
./update_8002.sh
|
||||||
|
# 更新并启动python程序
|
||||||
|
./update_8000.sh
|
||||||
|
|
||||||
|
|
||||||
|
# 后期想查看java日志,执行以下命令
|
||||||
|
tail -f nohup.out
|
||||||
|
# 后期想查看python日志,执行以下命令
|
||||||
|
tail -f /home/system/xiaozhi/xiaozhi-esp32-server/main/xiaozhi-server/tmp/server.log
|
||||||
|
```
|
||||||
|
|
||||||
|
# 注意事项
|
||||||
|
测试平台`https://2662r3426b.vicp.fun`,是使用nginx做了反向代理。nginx.conf详细配置可以[参考这里](https://github.com/xinnan-tech/xiaozhi-esp32-server/issues/791)
|
||||||
|
|
||||||
|
## 常见问题
|
||||||
|
|
||||||
|
### 1、为什么没有见到8001端口?
|
||||||
|
回答:8001是开发环境使用的,用于运行前端的端口。如果你是服务器部署,不建议使用`npm run serve`启动8001端口运行前端,而是像本教程一样编译成html文件,然后使用nginx来管理访问。
|
||||||
|
|
||||||
|
### 2、每次更新需要更新手动SQL语句吗?
|
||||||
|
回答:不需要,因为项目使用**Liquibase**管理数据库版本,会自动执行新的sql脚本。
|
||||||
+9
-34
@@ -8,39 +8,14 @@ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin
|
|||||||
```
|
```
|
||||||
2、编译docker镜像
|
2、编译docker镜像
|
||||||
```
|
```
|
||||||
# 普通编译
|
#进入项目根目录
|
||||||
docker build -t xiaozhi-esp32-server:local -f ./Dockerfile-pip .
|
# 编译server
|
||||||
```
|
docker build -t xiaozhi-esp32-server:server_latest -f ./Dockerfile-server .
|
||||||
3、测试本地镜像
|
# 编译web
|
||||||
```
|
docker build -t xiaozhi-esp32-server:web_latest -f ./Dockerfile-web .
|
||||||
docker stop xiaozhi-esp32-server
|
|
||||||
docker rm xiaozhi-esp32-server
|
|
||||||
|
|
||||||
docker run -d --name xiaozhi-esp32-server --restart always -p 8000:8000 -v $(pwd)/data/.config.yaml:/opt/xiaozhi-esp32-server/config.yaml xiaozhi-esp32-server:local
|
|
||||||
|
|
||||||
docker logs -f xiaozhi-esp32-server
|
|
||||||
|
|
||||||
|
# 编译完成后,可以使用docker-compose启动项目
|
||||||
|
# docker-compose.yml你需要修改成自己编译的镜像版本
|
||||||
|
cd main/xiaozhi-server
|
||||||
|
docker compose up -d
|
||||||
```
|
```
|
||||||
5、发布腾讯云镜像
|
|
||||||
```
|
|
||||||
# amd64
|
|
||||||
docker tag xiaozhi-esp32-server:local ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest-amd64
|
|
||||||
docker push ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest-amd64
|
|
||||||
|
|
||||||
# arm64
|
|
||||||
docker tag xiaozhi-esp32-server:local ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest-arm64
|
|
||||||
docker push ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest-arm64
|
|
||||||
|
|
||||||
# 推送最新版本
|
|
||||||
docker manifest rm ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest
|
|
||||||
docker manifest create ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest-amd64 ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest-arm64 --amend
|
|
||||||
docker manifest inspect ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest
|
|
||||||
docker manifest push ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest
|
|
||||||
|
|
||||||
```
|
|
||||||
6、运行线上镜像
|
|
||||||
```
|
|
||||||
cd /Users/hrz/myworkspace/docker-java-env/thirddata/
|
|
||||||
docker run -d --name xiaozhi-esp32-server --restart always -p 8000:8000 -v $(pwd)/config.yaml:/opt/xiaozhi-esp32-server/config.yaml ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest
|
|
||||||
docker logs -f xiaozhi-esp32-server
|
|
||||||
```
|
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
user root;
|
||||||
|
worker_processes 4;
|
||||||
|
|
||||||
|
events {
|
||||||
|
worker_connections 1024;
|
||||||
|
}
|
||||||
|
|
||||||
|
http {
|
||||||
|
include mime.types;
|
||||||
|
default_type application/octet-stream;
|
||||||
|
sendfile on;
|
||||||
|
keepalive_timeout 300;
|
||||||
|
client_header_timeout 180s;
|
||||||
|
client_body_timeout 180s;
|
||||||
|
client_max_body_size 1024M;
|
||||||
|
|
||||||
|
gzip on;
|
||||||
|
gzip_buffers 32 4K;
|
||||||
|
gzip_comp_level 6;
|
||||||
|
gzip_min_length 100;
|
||||||
|
gzip_types application/javascript text/css text/xml image/jpeg image/gif image/png;
|
||||||
|
gzip_disable "MSIE [1-6]\.";
|
||||||
|
gzip_vary on;
|
||||||
|
|
||||||
|
server {
|
||||||
|
# 无域名访问,就用localhost
|
||||||
|
server_name localhost;
|
||||||
|
# 80端口
|
||||||
|
listen 8002;
|
||||||
|
|
||||||
|
# 转发到编译后到web目录
|
||||||
|
location / {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
}
|
||||||
|
|
||||||
|
# 转发到manager-api
|
||||||
|
location /xiaozhi/ {
|
||||||
|
proxy_pass http://127.0.0.1:8003;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_cookie_path /manager/ /;
|
||||||
|
proxy_set_header Referer $http_referer;
|
||||||
|
proxy_set_header Cookie $http_cookie;
|
||||||
|
|
||||||
|
proxy_connect_timeout 15;
|
||||||
|
proxy_send_timeout 15;
|
||||||
|
proxy_read_timeout 15;
|
||||||
|
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# 启动Java后端(docker内监听8003端口)
|
||||||
|
java -jar /app/xiaozhi-esp32-api.jar \
|
||||||
|
--server.port=8003 \
|
||||||
|
--spring.datasource.druid.url=${SPRING_DATASOURCE_DRUID_URL} \
|
||||||
|
--spring.datasource.druid.username=${SPRING_DATASOURCE_DRUID_USERNAME} \
|
||||||
|
--spring.datasource.druid.password=${SPRING_DATASOURCE_DRUID_PASSWORD} \
|
||||||
|
--spring.data.redis.host=${SPRING_DATA_REDIS_HOST} \
|
||||||
|
--spring.data.redis.password=${SPRING_DATA_REDIS_PASSWORD} \
|
||||||
|
--spring.data.redis.port=${SPRING_DATA_REDIS_PORT} &
|
||||||
|
|
||||||
|
# 启动Nginx(前台运行保持容器存活)
|
||||||
|
nginx -g 'daemon off;'
|
||||||
+90
-41
@@ -1,40 +1,81 @@
|
|||||||
# 编译esp32固件
|
# esp32固件编译
|
||||||
|
|
||||||
1. 下载`xiaozhi-esp32`
|
## 第1步 准备你的ota地址
|
||||||
项目,按照这个教程配置项目环境[《Windows搭建 ESP IDF 5.3.2开发环境以及编译小智》](https://icnynnzcwou8.feishu.cn/wiki/JEYDwTTALi5s2zkGlFGcDiRknXf)
|
|
||||||
|
|
||||||
2. 打开`xiaozhi-esp32/main/Kconfig.projbuild`文件,找到`WEBSOCKET_URL`的`default`的内容,把`wss://api.tenclass.net`
|
如果你,使用的是本项目0.3.12版本,不管是简单Server部署还是全模块部署,都会有ota地址。
|
||||||
改成你自己的地址,例如,我的接口地址是`ws://192.168.1.25:8000`,就把内容改成这个。
|
|
||||||
|
由于简单Server部署和全模块部署的OTA地址设置方式不一样,请你选择下面的具体方式:
|
||||||
|
|
||||||
|
### 如果你用的是简单Server部署
|
||||||
|
此刻,请你用浏览器打开你的ota地址,例如我的ota地址
|
||||||
|
```
|
||||||
|
http://192.168.1.25:8003/xiaozhi/ota/
|
||||||
|
```
|
||||||
|
如果显示“OTA接口运行正常,向设备发送的websocket地址是:ws://xxx:8000/xiaozhi/v1/
|
||||||
|
|
||||||
|
你可以使用项目自带的`test_page.html`测试一下,是否能连上ota页面输出的websocket地址。
|
||||||
|
|
||||||
|
如果访问不到,你需要到配置文件`.config.yaml`里修改`server.websocket`的地址,重启后再重新测试,直到`test_page.html`能正常访问。
|
||||||
|
|
||||||
|
成功后,请往下进行第2步
|
||||||
|
|
||||||
|
### 如果你用的是全模块部署
|
||||||
|
此刻,请你用浏览器打开你的ota地址,例如我的ota地址
|
||||||
|
```
|
||||||
|
http://192.168.1.25:8002/xiaozhi/ota/
|
||||||
|
```
|
||||||
|
|
||||||
|
如果显示“OTA接口运行正常,websocket集群数量:X”。那就往下进行2步。
|
||||||
|
|
||||||
|
如果显示“OTA接口运行不正常”,大概是你还没在`智控台`配置`Websocket`地址。那就:
|
||||||
|
|
||||||
|
- 1、使用超级管理员登录智控台
|
||||||
|
|
||||||
|
- 2、顶部菜单点击`参数管理`
|
||||||
|
|
||||||
|
- 3、在列表中找到`server.websocket`项目,输入你的`Websocket`地址。例如我的就是
|
||||||
|
|
||||||
|
```
|
||||||
|
ws://192.168.1.25:8000/xiaozhi/v1/
|
||||||
|
```
|
||||||
|
|
||||||
|
配置完后,再使用浏览器刷新你的ota接口地址,看看是不是正常了。如果还不正常就,就再次确认一下Websocket是否正常启动,是否配置了Websocket地址。
|
||||||
|
|
||||||
|
## 第2步 配置环境
|
||||||
|
先按照这个教程配置项目环境[《Windows搭建 ESP IDF 5.3.2开发环境以及编译小智》](https://icnynnzcwou8.feishu.cn/wiki/JEYDwTTALi5s2zkGlFGcDiRknXf)
|
||||||
|
|
||||||
|
## 第3步 打开配置文件
|
||||||
|
配置好编译环境后,下载虾哥iaozhi-esp32项目源码,
|
||||||
|
|
||||||
|
从这里下载虾哥[xiaozhi-esp32项目源码](https://github.com/78/xiaozhi-esp32)。
|
||||||
|
|
||||||
|
下载后,打开`xiaozhi-esp32/main/Kconfig.projbuild`文件。
|
||||||
|
|
||||||
|
## 第4步 修改OTA地址
|
||||||
|
|
||||||
|
找到`OTA_URL`的`default`的内容,把`https://api.tenclass.net/xiaozhi/ota/`
|
||||||
|
改成你自己的地址,例如,我的接口地址是`http://192.168.1.25:8002/xiaozhi/ota/`,就把内容改成这个。
|
||||||
|
|
||||||
修改前:
|
修改前:
|
||||||
|
|
||||||
```
|
```
|
||||||
config WEBSOCKET_URL
|
config OTA_URL
|
||||||
depends on CONNECTION_TYPE_WEBSOCKET
|
string "Default OTA URL"
|
||||||
string "Websocket URL"
|
default "https://api.tenclass.net/xiaozhi/ota/"
|
||||||
default "wss://api.tenclass.net/xiaozhi/v1/"
|
|
||||||
help
|
help
|
||||||
Communication with the server through websocket after wake up.
|
The application will access this URL to check for new firmwares and server address.
|
||||||
```
|
```
|
||||||
|
修改后:
|
||||||
修改后(示例):
|
|
||||||
|
|
||||||
```
|
```
|
||||||
config WEBSOCKET_URL
|
config OTA_URL
|
||||||
depends on CONNECTION_TYPE_WEBSOCKET
|
string "Default OTA URL"
|
||||||
string "Websocket URL"
|
default "http://192.168.1.25:8002/xiaozhi/ota/"
|
||||||
default "ws://192.168.1.25:8000/xiaozhi/v1/"
|
|
||||||
help
|
help
|
||||||
Communication with the server through websocket after wake up.
|
The application will access this URL to check for new firmwares and server address.
|
||||||
```
|
```
|
||||||
|
|
||||||
注意:你的地址是`ws://`开头,不是`wss://`开头,一定不要写错了。
|
## 第4步 设置编译参数
|
||||||
|
|
||||||
注意:你的地址是`ws://`开头,不是`wss://`开头,一定不要写错了。
|
设置编译参数
|
||||||
|
|
||||||
注意:你的地址是`ws://`开头,不是`wss://`开头,一定不要写错了。
|
|
||||||
|
|
||||||
3. 设置编译参数
|
|
||||||
|
|
||||||
```
|
```
|
||||||
# 终端命令行进入xiaozhi-esp32的根目录
|
# 终端命令行进入xiaozhi-esp32的根目录
|
||||||
@@ -45,40 +86,29 @@ idf.py set-target esp32s3
|
|||||||
idf.py menuconfig
|
idf.py menuconfig
|
||||||
```
|
```
|
||||||
|
|
||||||

|
进入菜单配置后,再进入`Xiaozhi Assistant`,将`BOARD_TYPE`设置你板子的具体型号
|
||||||
|
|
||||||
进入菜单配置后,再进入`Xiaozhi Assistant`,将`CONNECTION_TYPE`设置为`Websocket`
|
|
||||||
回退到主菜单,再进入`Xiaozhi Assistant`,将`BOARD_TYPE`设置你板子的具体型号
|
|
||||||
保存退出,回到终端命令行。
|
保存退出,回到终端命令行。
|
||||||
|
|
||||||

|
## 第5步 编译固件
|
||||||
|
|
||||||
4. 编译固件
|
|
||||||
|
|
||||||
```
|
```
|
||||||
idf.py build
|
idf.py build
|
||||||
```
|
```
|
||||||
|
|
||||||
如果是vscode安装的idf可以使用`F1`或者`ctrl+shift+p`,输入idf然后直接选择进行编译
|
## 第6步 打包bin固件
|
||||||
|
|
||||||
还可以直接进行烧录不用接下来的操作
|
|
||||||
|
|
||||||
<img src="./images/vscode_idf.png" width="500px"/>
|
|
||||||
|
|
||||||
5. 打包bin固件
|
|
||||||
|
|
||||||
```
|
```
|
||||||
cd scripts
|
cd scripts
|
||||||
python release.py
|
python release.py
|
||||||
```
|
```
|
||||||
|
|
||||||
编译成功后,会在项目根目录下的`build`目录下生成固件文件`merged-binary.bin`。
|
上面的打包命令执行完成后,会在项目根目录下的`build`目录下生成固件文件`merged-binary.bin`。
|
||||||
这个`merged-binary.bin`就是要烧录到硬件上的固件文件。
|
这个`merged-binary.bin`就是要烧录到硬件上的固件文件。
|
||||||
|
|
||||||
注意:如果执行到第二命令后,报了“zip”相关的错误,请忽略这个错误,只要`build`目录下生成固件文件`merged-binary.bin`
|
注意:如果执行到第二命令后,报了“zip”相关的错误,请忽略这个错误,只要`build`目录下生成固件文件`merged-binary.bin`
|
||||||
,对你没有太大影响,请继续。
|
,对你没有太大影响,请继续。
|
||||||
|
|
||||||
6. 烧录固件
|
## 第7步 烧录固件
|
||||||
将esp32设备连接电脑,使用chrome浏览器,打开以下网址
|
将esp32设备连接电脑,使用chrome浏览器,打开以下网址
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -87,3 +117,22 @@ https://espressif.github.io/esp-launchpad/
|
|||||||
|
|
||||||
打开这个教程,[Flash工具/Web端烧录固件(无IDF开发环境)](https://ccnphfhqs21z.feishu.cn/wiki/Zpz4wXBtdimBrLk25WdcXzxcnNS)。
|
打开这个教程,[Flash工具/Web端烧录固件(无IDF开发环境)](https://ccnphfhqs21z.feishu.cn/wiki/Zpz4wXBtdimBrLk25WdcXzxcnNS)。
|
||||||
翻到:`方式二:ESP-Launchpad 浏览器WEB端烧录`,从`3. 烧录固件/下载到开发板`开始,按照教程操作。
|
翻到:`方式二:ESP-Launchpad 浏览器WEB端烧录`,从`3. 烧录固件/下载到开发板`开始,按照教程操作。
|
||||||
|
|
||||||
|
烧录成功且联网成功后,通过唤醒词唤醒小智,留意server端输出的控制台信息。
|
||||||
|
|
||||||
|
## 常见问题
|
||||||
|
以下是一些常见问题,供参考:
|
||||||
|
|
||||||
|
[1、为什么我说的话,小智识别出来很多韩文、日文、英文](./FAQ.md)
|
||||||
|
|
||||||
|
[2、为什么会出现“TTS 任务出错 文件不存在”?](./FAQ.md)
|
||||||
|
|
||||||
|
[3、TTS 经常失败,经常超时](./FAQ.md)
|
||||||
|
|
||||||
|
[4、使用Wifi能连接自建服务器,但是4G模式却接不上](./FAQ.md)
|
||||||
|
|
||||||
|
[5、如何提高小智对话响应速度?](./FAQ.md)
|
||||||
|
|
||||||
|
[6、我说话很慢,停顿时小智老是抢话](./FAQ.md)
|
||||||
|
|
||||||
|
[7、我想通过小智控制电灯、空调、远程开关机等操作](./FAQ.md)
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
# 基于虾哥编译好的固件配置自定义服务器
|
||||||
|
|
||||||
|
## 第1步 确认版本
|
||||||
|
烧录虾哥已经编译好的[1.6.1版本以上固件](https://github.com/78/xiaozhi-esp32/releases)
|
||||||
|
|
||||||
|
## 第2步 准备你的ota地址
|
||||||
|
如果你按照教程使用的是全模块部署,就应该会有ota地址。
|
||||||
|
|
||||||
|
此刻,请你用浏览器打开你的ota地址,例如我的ota地址
|
||||||
|
```
|
||||||
|
https://2662r3426b.vicp.fun/xiaozhi/ota/
|
||||||
|
```
|
||||||
|
|
||||||
|
如果显示“OTA接口运行正常,websocket集群数量:X”。那就往下。
|
||||||
|
|
||||||
|
如果显示“OTA接口运行不正常”,大概是你还没在`智控台`配置`Websocket`地址。那就:
|
||||||
|
|
||||||
|
- 1、使用超级管理员登录智控台
|
||||||
|
|
||||||
|
- 2、顶部菜单点击`参数管理`
|
||||||
|
|
||||||
|
- 3、在列表中找到`server.websocket`项目,输入你的`Websocket`地址。例如我的就是
|
||||||
|
|
||||||
|
```
|
||||||
|
wss://2662r3426b.vicp.fun/xiaozhi/v1/
|
||||||
|
```
|
||||||
|
|
||||||
|
配置完后,再使用浏览器刷新你的ota接口地址,看看是不是正常了。如果还不正常就,就再次确认一下Websocket是否正常启动,是否配置了Websocket地址。
|
||||||
|
|
||||||
|
## 第3步 进入配网模式
|
||||||
|
进入机器的配网模式,在页面顶部,点击“高级选项”,在里面输入你服务器的`ota`地址,点击保存。重启设备
|
||||||
|

|
||||||
|
|
||||||
|
## 第4步 唤醒小智,查看日志输出
|
||||||
|
|
||||||
|
唤醒小智,看看日志是不是正常输出。
|
||||||
|
|
||||||
|
|
||||||
|
## 常见问题
|
||||||
|
以下是一些常见问题,供参考:
|
||||||
|
|
||||||
|
[1、为什么我说的话,小智识别出来很多韩文、日文、英文](./FAQ.md)
|
||||||
|
|
||||||
|
[2、为什么会出现“TTS 任务出错 文件不存在”?](./FAQ.md)
|
||||||
|
|
||||||
|
[3、TTS 经常失败,经常超时](./FAQ.md)
|
||||||
|
|
||||||
|
[4、使用Wifi能连接自建服务器,但是4G模式却接不上](./FAQ.md)
|
||||||
|
|
||||||
|
[5、如何提高小智对话响应速度?](./FAQ.md)
|
||||||
|
|
||||||
|
[6、我说话很慢,停顿时小智老是抢话](./FAQ.md)
|
||||||
|
|
||||||
|
[7、我想通过小智控制电灯、空调、远程开关机等操作](./FAQ.md)
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
登录AutoDL,租赁镜像
|
||||||
|
选择镜像:
|
||||||
|
```
|
||||||
|
PyTorch / 2.1.0 / 3.10(ubuntu22.04) / cuda 12.1
|
||||||
|
```
|
||||||
|
|
||||||
|
机器开机后,设置学术加速
|
||||||
|
```
|
||||||
|
source /etc/network_turbo
|
||||||
|
```
|
||||||
|
|
||||||
|
进入工作目录
|
||||||
|
```
|
||||||
|
cd autodl-tmp/
|
||||||
|
```
|
||||||
|
|
||||||
|
拉取项目
|
||||||
|
```
|
||||||
|
git clone https://gitclone.com/github.com/fishaudio/fish-speech.git ; cd fish-speech
|
||||||
|
```
|
||||||
|
|
||||||
|
安装依赖
|
||||||
|
```
|
||||||
|
pip install -e.
|
||||||
|
```
|
||||||
|
|
||||||
|
如果报错,安装portaudio
|
||||||
|
```
|
||||||
|
apt-get install portaudio19-dev -y
|
||||||
|
```
|
||||||
|
|
||||||
|
安装后执行
|
||||||
|
```
|
||||||
|
pip install torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 --index-url https://download.pytorch.org/whl/cu121
|
||||||
|
```
|
||||||
|
|
||||||
|
下载模型
|
||||||
|
```
|
||||||
|
cd tools
|
||||||
|
python download_models.py
|
||||||
|
```
|
||||||
|
|
||||||
|
下载完模型后运行接口
|
||||||
|
```
|
||||||
|
python -m tools.api_server --listen 0.0.0.0:6006
|
||||||
|
```
|
||||||
|
|
||||||
|
然后用浏览器去到aotodl实例页面
|
||||||
|
```
|
||||||
|
https://autodl.com/console/instance/list
|
||||||
|
```
|
||||||
|
|
||||||
|
如下图点击你刚才机器的`自定义服务`按钮,开启端口转发服务
|
||||||
|

|
||||||
|
|
||||||
|
端口转发服务设置完成后,你本地电脑打开网址`http://localhost:6006/`,就可以访问fish-speech的接口了
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
如果你是单模块部署,核心配置如下
|
||||||
|
```
|
||||||
|
selected_module:
|
||||||
|
TTS: FishSpeech
|
||||||
|
TTS:
|
||||||
|
FishSpeech:
|
||||||
|
reference_audio: ["config/assets/wakeup_words.wav",]
|
||||||
|
reference_text: ["哈啰啊,我是小智啦,声音好听的台湾女孩一枚,超开心认识你耶,最近在忙啥,别忘了给我来点有趣的料哦,我超爱听八卦的啦",]
|
||||||
|
api_key: "123"
|
||||||
|
api_url: "http://127.0.0.1:6006/v1/tts"
|
||||||
|
```
|
||||||
|
|
||||||
|
然后重启服务
|
||||||
@@ -0,0 +1,226 @@
|
|||||||
|
# 小智ESP32-开源服务端与HomeAssistant集成指南
|
||||||
|
|
||||||
|
[TOC]
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
## 简介
|
||||||
|
|
||||||
|
本文档将指导您如何将ESP32设备与HomeAssistant进行集成。
|
||||||
|
|
||||||
|
## 前提条件
|
||||||
|
|
||||||
|
- 已安装并配置好`HomeAssistant`
|
||||||
|
- 本次我选择的模型是:免费的ChatGLM,它支持functioncall函数调用
|
||||||
|
|
||||||
|
## 开始前的操作(必要)
|
||||||
|
|
||||||
|
### 1. 获取HA的网络网络地址信息
|
||||||
|
|
||||||
|
请访问你Home Assistant的网络地址,例如,我的HA的地址是192.168.4.7,端口则是默认的8123,则在浏览器打开
|
||||||
|
|
||||||
|
```
|
||||||
|
http://192.168.4.7:8123
|
||||||
|
```
|
||||||
|
|
||||||
|
> 手动查询 HA 的 IP 地址方法**(仅限小智esp32-server和HA部署在同一个网络设备[例如同一个wifi]下)**:
|
||||||
|
>
|
||||||
|
> 1. 进入 Home Assistant(前端)。
|
||||||
|
>
|
||||||
|
> 2. 点击左下角 **设置(Settings)** → **系统(System)** → **网络(Network)**。
|
||||||
|
>
|
||||||
|
> 3. 滑到最底部`Home Assistant 网址(Home Assistant website)`区域,在`本地网络(local network)`中,点击`眼睛`按钮,可以看到当前使用的 IP 地址(如 `192.168.1.10`)和网络接口。点击`复制连接(copy link)`可以直接复制。
|
||||||
|
>
|
||||||
|
> 
|
||||||
|
|
||||||
|
或,您已经设置了直接可以访问的Home Assistant的OAuth地址,您也可以在浏览器内直接访问
|
||||||
|
|
||||||
|
```
|
||||||
|
http://homeassistant.local:8123
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. 登录`Home Assistant`拿到开发密钥
|
||||||
|
|
||||||
|
登录`HomeAssistant`,点击`左下角头像 -> 个人`,切换`安全`导航栏,划到底部`长期访问令牌`生成api_key,并复制保存,后续的方法都需要使用这个api key且仅出现一次(小tips: 您可以保存生成的二维码图像,后续可以扫描二维码再此提取api key)。
|
||||||
|
|
||||||
|
## 方法1:小智社区共建的HA调用功能
|
||||||
|
|
||||||
|
### 功能描述
|
||||||
|
|
||||||
|
- 如您后续需要增加新的设备,该方法需要手动重启`xiaozhi-esp32-server服务端`以此更新设备信息**(重要**)。
|
||||||
|
|
||||||
|
- 需要您确保已经在HomeAssistant中集成`Xiaomi Home`,并将米家的设备导入进`HomeAssistant`。
|
||||||
|
|
||||||
|
- 需要您确保`xiaozhi-esp32-server智控台`能正常使用。
|
||||||
|
|
||||||
|
- 我的`xiaozhi-esp32-server智控台`和`HomeAssistant`部署在同一台机器的另一个端口,版本是`0.3.10`
|
||||||
|
|
||||||
|
```
|
||||||
|
http://192.168.4.7:8002
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### 配置步骤
|
||||||
|
|
||||||
|
#### 1. 登录`HomeAssistant`整理需要控制的设备清单
|
||||||
|
|
||||||
|
登录`HomeAssistant`,点击`左下角的设置`,然后进入`设备与服务`,再点击顶部的`实体`。
|
||||||
|
|
||||||
|
然后在实体中搜索你相关控制的开关,结果出来后,在列表中,点击其中一个结果,这是会出现一个开关的界面。
|
||||||
|
|
||||||
|
在开关的界面,我们尝试点击开关,看看是开发会随着我们的点击开/关。如果能操作,说明是正常联网的。
|
||||||
|
|
||||||
|
接着在开关面板找到设置按钮,点击后,可以查看这个开关的`实体标识符`。
|
||||||
|
|
||||||
|
我们打开一个记事本,按照这样格式整理一条数据:
|
||||||
|
|
||||||
|
位置+英文逗号+设备名称+英文逗号+`实体标识符`+英文分号
|
||||||
|
|
||||||
|
例如,我在公司,我有一个玩具灯,他的标识符是switch.cuco_cn_460494544_cp1_on_p_2_1,那么就这个写这一条数据
|
||||||
|
|
||||||
|
```
|
||||||
|
公司,玩具灯,switch.cuco_cn_460494544_cp1_on_p_2_1;
|
||||||
|
```
|
||||||
|
|
||||||
|
当然最后我可能要操作两个灯,我的最终的结果是:
|
||||||
|
|
||||||
|
```
|
||||||
|
公司,玩具灯,switch.cuco_cn_460494544_cp1_on_p_2_1;
|
||||||
|
公司,台灯,switch.iot_cn_831898993_socn1_on_p_2_1;
|
||||||
|
```
|
||||||
|
|
||||||
|
这段字符,我们称为“设备清单字符”需要保存好,等一下有用。
|
||||||
|
|
||||||
|
#### 2. 登录`智控台`
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
使用管理员账号,登录`智控台`。在`智能体管理`,找到你的智能体,再点击`配置角色`。
|
||||||
|
|
||||||
|
将意图识别设置成`外挂的大模型意图识别`或`大模型自主函数调用`。这时你会看到右侧有一个`编辑功能`。点击`编辑功能`按钮,会弹出`功能管理`的框。
|
||||||
|
|
||||||
|
在`功能管理`的框里,你需要勾选`HomeAssistant设备状态查询`和`HomeAssistant设备状态修改`。
|
||||||
|
|
||||||
|
勾选后,在`已选功能`点击`HomeAssistant设备状态查询`,然后在`参数配置`里配置你的`HomeAssistant`地址、密钥、设备清单字符。
|
||||||
|
|
||||||
|
编辑好后,点击`保存配置`,这时`功能管理`的框会隐藏,这时你再点击保存智能体配置。
|
||||||
|
|
||||||
|
保存成功后,即可唤醒设备操作。
|
||||||
|
|
||||||
|
#### 3. 唤醒设别进行控制
|
||||||
|
|
||||||
|
尝试和esp32说,“打开XXX灯”
|
||||||
|
|
||||||
|
## 方法2:小智将Home Assistant的语音助手作为LLM工具
|
||||||
|
|
||||||
|
### 功能描述
|
||||||
|
|
||||||
|
- 该方法有一个比较严重的缺点——**该方法无法使用小智开源生态的function_call插件功能的能力**,因为使用Home Assistant作为小智的LLM工具会将意图识别能力转让给Home Assistant。但是**这个方法是能体验到原生的Home Assistant操作功能,且小智的聊天能力不变**。如实在介意可以使用同样是Home Assistant支持的[方法3](##方法3:使用Home Assistant的MCP服务(推荐)),能够最大程度体验到Home Assistant的功能。
|
||||||
|
|
||||||
|
### 配置步骤:
|
||||||
|
|
||||||
|
#### 1. 配置Home Assistant的大模型语音助手。
|
||||||
|
|
||||||
|
**需要您提前配置好Home Assistant的语音助手或大模型工具。**
|
||||||
|
|
||||||
|
#### 2. 获取Home Assistant的语言助手的Agent ID.
|
||||||
|
|
||||||
|
1. 进入Home Assistant页面内。左侧点击`开发者助手`。
|
||||||
|
2. 在打开的`开发者助手`内,点击`动作`选项卡(如图示操作1),在页面内的选项栏`动作`中,找到或输入`conversation.process(对话-处理)`并选择`对话(conversation): 处理`(如图示操作2)。
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
3. 在页面内勾选`代理(agent)`选项,在变成常亮的`对话代理(conversation agent)`内选择您步骤一配置好的语音助手名称,如图示,我这边配置好的是`ZhipuAi`并选择。
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
4. 选中后,点击表单左下方的`进入YAML模式`。
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
5. 复制其中的agent-id的值,例如图示中我的是`01JP2DYMBDF7F4ZA2DMCF2AGX2`(仅供参考)。
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
6. 切换到小智开源服务端`xiaozhi-esp32-server`的`config.yaml`文件内,在LLM配置中,找到Home Assistant,设置您的Home Assistant的网络地址,Api key和刚刚查询到的agent_id。
|
||||||
|
7. 修改`config.yaml`文件内的`selected_module`属性的`LLM`为`HomeAssistant`,`Intent`为`nointent`。
|
||||||
|
8. 重启小智开源服务端`xiaozhi-esp32-server`即可正常使用。
|
||||||
|
|
||||||
|
## 方法3:使用Home Assistant的MCP服务(推荐)
|
||||||
|
|
||||||
|
### 功能描述
|
||||||
|
|
||||||
|
- 需要您提前在Home Assistant内集成并安装好HA集成——[Model Context Protocol Server](https://www.home-assistant.io/integrations/mcp_server/)。
|
||||||
|
|
||||||
|
- 这个方法与方法2都是HA官方提供的解决方法,与方法2不同的是,您可以正常使用小智开源服务端`xiaozhi-esp32-server`的开源共建的插件,同时允许您随意使用任何一个支持function_call功能的LLM大模型。
|
||||||
|
|
||||||
|
### 配置步骤
|
||||||
|
|
||||||
|
#### 1. 安装Home Assistant的MCP服务集成。
|
||||||
|
|
||||||
|
集成官方网址——[Model Context Protocol Server](https://www.home-assistant.io/integrations/mcp_server/)。。
|
||||||
|
|
||||||
|
或跟随以下手动操作。
|
||||||
|
|
||||||
|
> - 前往Home Assistant页面的**[设置 > 设备和服务(Settings > Devices & Services.)](https://my.home-assistant.io/redirect/integrations)**。
|
||||||
|
>
|
||||||
|
> - 在右下角,选择 **[添加集成(Add Integration)](https://my.home-assistant.io/redirect/config_flow_start?domain=mcp_server)**按钮。
|
||||||
|
>
|
||||||
|
> - 从列表中选择**模型上下文协议服务器(Model Context Protocol Server)**。
|
||||||
|
>
|
||||||
|
> - 按照屏幕上的说明完成设置。
|
||||||
|
|
||||||
|
#### 2. 配置小智开源服务端MCP配置信息
|
||||||
|
|
||||||
|
|
||||||
|
进入`data`目录,找到`.mcp_server_settings.json`文件。
|
||||||
|
|
||||||
|
如果你的`data`目录下没有`.mcp_server_settings.json`文件,
|
||||||
|
- 请把在`xiaozhi-server`文件夹根目录的`mcp_server_settings.json`文件复制到`data`目录下,并重命名为`.mcp_server_settings.json`
|
||||||
|
- 或[下载这个文件](https://github.com/xinnan-tech/xiaozhi-esp32-server/blob/main/main/xiaozhi-server/mcp_server_settings.json),下载到`data`目录下,并重命名为`.mcp_server_settings.json`
|
||||||
|
|
||||||
|
|
||||||
|
修改`"mcpServers"`里的这部分的内容:
|
||||||
|
|
||||||
|
```json
|
||||||
|
"Home Assistant": {
|
||||||
|
"command": "mcp-proxy",
|
||||||
|
"args": [
|
||||||
|
"http://YOUR_HA_HOST/mcp_server/sse"
|
||||||
|
],
|
||||||
|
"env": {
|
||||||
|
"API_ACCESS_TOKEN": "YOUR_API_ACCESS_TOKEN"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
```
|
||||||
|
|
||||||
|
注意:
|
||||||
|
|
||||||
|
1. **替换配置:**
|
||||||
|
- 替换`args`内的`YOUR_HA_HOST`为您的HA服务地址,如果你的服务地址已经包含了https/http字样(例如`http://192.168.1.101:8123`),则只需要填入`192.168.1.101:8123`即可。
|
||||||
|
- 将`env`内`API_ACCESS_TOKEN`的`YOUR_API_ACCESS_TOKEN`替换成您之前获取到的开发密钥api key。
|
||||||
|
2. **如果你添加配置是在`"mcpServers"`的括号内后续没有新的`mcpServers`的配置时,需要把最后的逗号`,`移除**,否则可能会解析失败。
|
||||||
|
|
||||||
|
**最后效果参考以下(参考如下)**:
|
||||||
|
|
||||||
|
```json
|
||||||
|
"mcpServers": {
|
||||||
|
"Home Assistant": {
|
||||||
|
"command": "mcp-proxy",
|
||||||
|
"args": [
|
||||||
|
"http://192.168.1.101:8123/mcp_server/sse"
|
||||||
|
],
|
||||||
|
"env": {
|
||||||
|
"API_ACCESS_TOKEN": "abcd.efghi.jkl"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 3. 配置小智开源服务端的系统配置
|
||||||
|
|
||||||
|
1. **选择任意一款支持function_call的LLM大模型作为小智的LLM聊天助手(但不要选择Home Assistant作为LLM工具)**,本次我选择的模型是:免费的ChatGLM,它支持functioncall函数调用,但部分时候调用不太稳定,如果像追求稳定建议把LLM设置成:DoubaoLLM,使用的具体model_name是:doubao-1-5-pro-32k-250115。
|
||||||
|
|
||||||
|
2. 切换到小智开源服务端`xiaozhi-esp32-server`的`config.yaml`文件内,设置您的LLM大模型配置,并且将`selected_module`配置的`Intent`调整为`function_call`。
|
||||||
|
|
||||||
|
3. 重启小智开源服务端`xiaozhi-esp32-server`即可正常使用。
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user