diff --git a/Build Tools.docx b/Build Tools.docx new file mode 100644 index 000000000..e0e890f1c Binary files /dev/null and b/Build Tools.docx differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows.htm b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows.htm new file mode 100644 index 000000000..99b80ecd7 --- /dev/null +++ b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows.htm @@ -0,0 +1,1191 @@ + + + + + + + + + + + +
+ +

如果有老板需要ESP32定制开发或者小智二次开发可加V:Kevincoooool +不提供免费指导服务,精力有限。

+ +

如需要ESP32开发板可进https://item.taobao.com/item.htm?id=681702043224

+ +

1、下载离线安装包

+ +

首先进入

+ +

https://dl.espressif.com/dl/esp-idf/

+ +

如果无法下载也可以进百度云链接:

+ +

https://pan.baidu.com/s/11jwTFJbcOsV2K_IlkBriJQ?pwd=qm34 +提取码: qm34

+ +

5.3.1和5.3.2和5.3.3在1.6.5之前的版本可以用,但是最新的代码需要5.4.1,因为增加了对摄像头的支持!!!

+ +

最新的小智需要IDF5.5.1啦!

+ +

这个链接是乐鑫官方的下载网,可以在这里下载离线安装包,点击5.5版本的下载

+ +

网页最下面也可以选各种版本

+ +

不要用VSCODE的插件编译!!!很容易出错!!用下面的命令行编译!!!

+ +

 

+ +

+ +

 

+ +

+ +

 

+ +

选择任意你需要安装的版本

+ +

 

+ +

2、安装环境

+ +

自行选择需要安装的版本,双击EXE文件开始安装

+ +

+ +

 

+ +

+ +

 

+ +

勾选我同意之后,一直点下一步就行了

+ +

+ +

可以在此处设置一下自己的IDF需要安装到的文件夹,尽量别安装到C盘

+ +

+ +

 

+ +

一直点下一步直到安装完成,等待安装完成

+ +

+ +

3、测试是否安装成功

+ +

+ +

双击桌面上的Powershell 会自动导入idf环境,电脑安装了windows terminal(win11自带,win10可以搜索store打开商店安装)的可以直接打开终端,终端的+号可以直接运行idf环境

+ +

+ +

+ +

 

+ +

当出现idf.py build字样就是安装成功了,可以编译固件了

+ +

运行  cd +.\examples\get-started\hello_world\进入工程的目录

+ +

+ +

输入idf.py build

+ +

+ +

这就开始编译了,编译的时候记得把所有的杀毒软件关闭,包括360、火绒、windows defender之类的,卸载电脑管家!会大大提高编译速度

+ +

+ +

如图就是正常编译成功的样子:

+ +

+ +

编译完成之后可以运行

+ +

idf.py build flash monitor

+ +

进行下载和查看串口输出的日志信息

+ +

如果嫌下载速度慢,可以运行以下命令,增加-b参数 后面就是下载的波特率

+ +

idf.py -b 2000000 build +flash monitor

+ +

如果不想所有分区都下载一遍,就运行以下命令,就只会下载app分区

+ +

idf.py build app-flash +monitor

+ +

当使用不同型号的芯片时,以下为设置芯片的命令示例:

+ +

 idf.py set-target +esp32  +     设置目标芯片为esp32

+ +

 idf.py set-target +esp32s2  +     设置目标芯片为esp32s2

+ +

 idf.py set-target +esp32s3  +     设置目标芯片为esp32s3

+ +

 idf.py set-target +esp32c3  +     设置目标芯片为esp32c3

+ +

 idf.py set-target +esp32p4  +     设置目标芯片为esp32p4

+ +

如果电脑上插入了很多个ESP32开发板,则需要区分端口,可以打开设备管理器看通信端口,比如我的板子端口是COM5,就需要运行:

+ +

idf.py -p COM5 build flash +monitor

+ +

把一个工程转移到别的路径时需要删除build文件夹

+ +

不要把工程放到中文目录路径下!

+ +

养成良好的删除build文件夹的习惯!能解决各种小问题

+ +

4、编译小智

+ +

1、下载源码

+ +

进入虾哥代码主页:https://github.com/78/xiaozhi-esp32

+ +

点击Code - Download +ZIP

+ +

电脑装了git的话,建议还是用命令git clone +https://github.com/78/xiaozhi-esp32,有时候下载zip会有问题

+ +

+ +

下载完成后解压到任意目录备用

+ +

+ +

进入终端,打开IDF 5.5或者双击桌面的ESP IDF5.5 Powershell

+ +

我解压的目录和你们的不一样,各自输入 刚刚解压的目录:

+ +

cd +J:\xiaozhi-esp32-main_2\xiaozhi-esp32-main

+ +

+ +

2、设置芯片类型

+ +

默认的编译芯片是ESP32的,所以自己的板子是S3的话一定要输入以下命令把芯片设置为S3

+ +

idf.py set-target esp32s3

+ +

如果你使用的芯片是ESP32C3的话,需要输入 idf.py set-target esp32c3先把芯片类型设置为C3,再去menuconfig里选择对应的板子类型

+ +

+ +

+ +

3、更换编译板子类型

+ +

默认编译出的固件是面包板的,如果需要更换板子,需要输入idf.py menuconfig

+ +

+ +

进入Xiaozhi Assistant选项

+ +

+ +

选Board Type进去选择自己的board类型

+ +

+ +

自己是什么板子就选什么型号,不是一定要选Kevin +SP V3板子,如果你是ESP32C3板子就要选C3的,并且一定要先运行idf.py set-target +esp32c3

+ +

 

+ +

+ +

选择需要编译的板子固件后按键盘的‘S’键保存 然后Esc退出menuconfig

+ +

4、开始编译

+ +

再次输入idf.py build进行编译

+ +

+ +

+ +

编译完成后输入idf.py build flash monitor进行下载和显示日志

+ +

5、如何修改唤醒词

+ +

输入idf.py menuconfig进入配置界面

+ +

+ +

键盘上下选择ESP Speech +Recognition

+ +

+ +

+ +

选择任意唤醒词后按Enter确定后按键盘的'S'保存退出

+ +

+ +

6、如何修改自定义唤醒词(不是选,而是完全自定义)

+ +

用最新源码

+ +

输入idf.py menuconfig进入配置界面,选择Xiaozhi Assistant

+ +

+ +

选择Wake Word +Implementation Type改成第三个

+ +

+ +

 

+ +

+ +

在Custom Wake Word中输入自己想要的任意唤醒词的拼音,需要有空格隔开,我输入的是小可小可的拼音

+ +

+ +

还有一个

+ +

+ +

+ +

+ +

然后就可以编译下载测试效果了,效果如下log:

+ +

+ +

+ +

7、如何修改websocket api接口

+ +

最新的1.6.2版本已经取消了从menuconfig配置websocket接口的源码,最新源码是从OTA接口接收websocket的api接口,无法自己设置,需要切换到1.6.0或者以下才可以

+ +

执行git checkout v1.6.0

+ +

输入idf.py menuconfig进入配置界面

+ +

+ +

键盘上下选择Xiaozhi Assistant

+ +

+ +

+ +

选择Websocket确定

+ +

+ +

+ +

输入自己的api地址后保存退出重新编译

+ +

+ +

8、如何打开AEC实时打断功能

+ +

目前暂时立创实战派S3、ESP-BOX、ESP32S3 Korvo开发板支持说话打断

+ +

在idf.py menuconfig中进入Xiaozhi Assistant选项,勾选最下面一栏

+ +

+ +

9、安装串口驱动

+ +

有的用户电脑没有串口驱动下载过程中一直卡着不动的情况下可以尝试一下安装以下驱动:

+ +

MAC下的驱动:

+ +

This content is only +supported in a Feishu Docs

+ +

Windows下的驱动:

+ +

This content is +only supported in a Feishu Docs

+ +

I2C冲突的问题解决办法:

+ +

如果您编译烧录后发现出现以下问题:

+ +

当然在最新版本代码里已经修复了此问题

+ +

+ +

进入idf.py +menuconifg->Component config->Audio Codec Device Configuration

+ +

关掉第一行后重新编译烧录就可以了

+ +

+ +

 

+ +

 

+ +
+ + + + diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image001.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image001.png new file mode 100644 index 000000000..f8c3257cc Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image001.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image002.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image002.png new file mode 100644 index 000000000..1a4c2bb55 Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image002.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image003.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image003.png new file mode 100644 index 000000000..5c2666af1 Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image003.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image004.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image004.png new file mode 100644 index 000000000..4de48157b Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image004.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image005.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image005.png new file mode 100644 index 000000000..30527770f Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image005.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image006.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image006.png new file mode 100644 index 000000000..a90823d0f Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image006.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image007.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image007.png new file mode 100644 index 000000000..3ca710349 Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image007.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image008.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image008.png new file mode 100644 index 000000000..eb2760a74 Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image008.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image009.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image009.png new file mode 100644 index 000000000..411816a11 Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image009.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image010.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image010.png new file mode 100644 index 000000000..0f239c178 Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image010.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image011.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image011.png new file mode 100644 index 000000000..ccfa6860d Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image011.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image012.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image012.png new file mode 100644 index 000000000..0d2d8f9b8 Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image012.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image013.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image013.png new file mode 100644 index 000000000..9b2080b7e Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image013.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image014.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image014.png new file mode 100644 index 000000000..8f4cd5e3a Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image014.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image015.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image015.png new file mode 100644 index 000000000..45541bfa9 Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image015.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image016.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image016.png new file mode 100644 index 000000000..78a73643d Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image016.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image017.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image017.png new file mode 100644 index 000000000..8c893a061 Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image017.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image018.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image018.png new file mode 100644 index 000000000..a8faef03b Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image018.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image019.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image019.png new file mode 100644 index 000000000..19e73c9a2 Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image019.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image020.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image020.png new file mode 100644 index 000000000..74d26c012 Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image020.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image021.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image021.png new file mode 100644 index 000000000..1828d8b16 Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image021.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image022.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image022.png new file mode 100644 index 000000000..d0cc16e95 Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image022.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image023.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image023.png new file mode 100644 index 000000000..3307d8f3f Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image023.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image024.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image024.png new file mode 100644 index 000000000..909d066b4 Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image024.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image025.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image025.png new file mode 100644 index 000000000..5a5685587 Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image025.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image026.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image026.png new file mode 100644 index 000000000..f00578c5e Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image026.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image027.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image027.png new file mode 100644 index 000000000..145c41266 Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image027.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image028.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image028.png new file mode 100644 index 000000000..5b0c73529 Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image028.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image029.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image029.png new file mode 100644 index 000000000..2ab73331f Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image029.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image030.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image030.png new file mode 100644 index 000000000..2322ae756 Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image030.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image031.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image031.png new file mode 100644 index 000000000..34374a72b Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image031.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image032.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image032.png new file mode 100644 index 000000000..2ae0d134a Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image032.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image033.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image033.png new file mode 100644 index 000000000..770199658 Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image033.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image034.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image034.png new file mode 100644 index 000000000..28e11061e Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image034.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image035.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image035.png new file mode 100644 index 000000000..e740ea2ed Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image035.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image036.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image036.png new file mode 100644 index 000000000..0a9ad27db Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image036.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image037.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image037.png new file mode 100644 index 000000000..499de8856 Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image037.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image038.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image038.png new file mode 100644 index 000000000..0f7309242 Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image038.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image039.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image039.png new file mode 100644 index 000000000..8fb949b9e Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image039.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image040.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image040.png new file mode 100644 index 000000000..4450bbb62 Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image040.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image041.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image041.png new file mode 100644 index 000000000..a623c82ea Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image041.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image042.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image042.png new file mode 100644 index 000000000..c7f288a1f Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image042.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image043.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image043.png new file mode 100644 index 000000000..a229c0b0b Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image043.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image044.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image044.png new file mode 100644 index 000000000..350f1b506 Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image044.png differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image045.jpg b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image045.jpg new file mode 100644 index 000000000..8c493cb8d Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image045.jpg differ diff --git a/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image046.png b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image046.png new file mode 100644 index 000000000..4cdba0b22 Binary files /dev/null and b/docs/Building ESP IDF 5.3.2 Development Environment and Compiling Xiaozhi on Windows_files/image046.png differ diff --git a/main/xiaozhi-server/core/providers/asr/aliyun.py b/main/xiaozhi-server/core/providers/asr/aliyun.py index 36f417457..59274684d 100644 --- a/main/xiaozhi-server/core/providers/asr/aliyun.py +++ b/main/xiaozhi-server/core/providers/asr/aliyun.py @@ -45,10 +45,10 @@ class AccessToken: "Timestamp": time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()), "Version": "2019-02-28", } - # 构造规范化的请求字符串 + # Construct a normalized request string query_string = AccessToken._encode_dict(parameters) - # print('规范化的请求字符串: %s' % query_string) - # 构造待签名字符串 + # print('Normalized request string: %s' % query_string) + # Construct a string to be signed string_to_sign = ( "GET" + "&" @@ -56,25 +56,25 @@ class AccessToken: + "&" + AccessToken._encode_text(query_string) ) - # print('待签名的字符串: %s' % string_to_sign) - # 计算签名 + # print('String to be signed: %s' % string_to_sign) + # Compute signature secreted_string = hmac.new( bytes(access_key_secret + "&", encoding="utf-8"), bytes(string_to_sign, encoding="utf-8"), hashlib.sha1, ).digest() signature = base64.b64encode(secreted_string) - # print('签名: %s' % signature) - # 进行URL编码 + # print('sign: %s' % signature) + # perform url encoding signature = AccessToken._encode_text(signature) - # print('URL编码后的签名: %s' % signature) - # 调用服务 + # print('Url encoded signature: %s' % signature) + # Call service full_url = "http://nls-meta.cn-shanghai.aliyuncs.com/?Signature=%s&%s" % ( signature, query_string, ) # print('url: %s' % full_url) - # 提交HTTP GET请求 + # Submit HTTP GET request response = requests.get(full_url) if response.ok: root_obj = response.json() @@ -91,8 +91,8 @@ class ASRProvider(ASRProviderBase): def __init__(self, config: dict, delete_audio_file: bool): super().__init__() self.interface_type = InterfaceType.NON_STREAM - """阿里云ASR初始化""" - # 新增空值判断逻辑 + """Alibaba Cloud asr initialization""" + # Added null value judgment logic self.access_key_id = config.get("access_key_id") self.access_key_secret = config.get("access_key_secret") @@ -105,27 +105,27 @@ class ASRProvider(ASRProviderBase): self.delete_audio_file = delete_audio_file if self.access_key_id and self.access_key_secret: - # 使用密钥对生成临时token + # Generate temporary token using key pair self._refresh_token() else: - # 直接使用预生成的长期token + # Use pre-generated long-term tokens directly self.token = config.get("token") self.expire_time = None - # 确保输出目录存在 + # Make sure the output directory exists os.makedirs(self.output_dir, exist_ok=True) def _refresh_token(self): - """刷新Token并记录过期时间""" + """Refresh the token and record the expiration time""" if self.access_key_id and self.access_key_secret: self.token, expire_time_str = AccessToken.create_token( self.access_key_id, self.access_key_secret ) if not expire_time_str: - raise ValueError("无法获取有效的Token过期时间") + raise ValueError("Unable to obtain valid token expiration time") try: - # 统一转换为字符串处理 + # Unified conversion to string processingnversion to string processing expire_str = str(expire_time_str).strip() if expire_str.isdigit(): @@ -134,28 +134,28 @@ class ASRProvider(ASRProviderBase): expire_time = datetime.strptime(expire_str, "%Y-%m-%dT%H:%M:%SZ") self.expire_time = expire_time.timestamp() - 60 except Exception as e: - raise ValueError(f"无效的过期时间格式: {expire_str}") from e + raise ValueError(f"Invalid expiration time format: {expire_str}") from e else: self.expire_time = None if not self.token: - raise ValueError("无法获取有效的访问Token") + raise ValueError("Unable to obtain valid access token") def _is_token_expired(self): - """检查Token是否过期""" + """Check if the token has expired""" if not self.expire_time: - return False # 长期Token不过期 - # 新增调试日志 + return False # Long-term tokens do not expire + # Add debug log # current_time = time.time() # remaining = self.expire_time - current_time - # print(f"Token过期检查: 当前时间 {datetime.fromtimestamp(current_time)} | " - # f"过期时间 {datetime.fromtimestamp(self.expire_time)} | " - # f"剩余 {remaining:.2f}秒") + # print(f"Token expiration check: current time {datetime.fromtimestamp(current_time)} | " + # f"Expiration time {datetime.fromtimestamp(self.expire_time)} | " + # f"Remaining {remaining:.2f}Second") return time.time() > self.expire_time def _construct_request_url(self) -> str: - """构造请求URL,包含参数""" + """Construct the request url, including parameters""" request = f"{self.base_url}?appkey={self.app_key}" request += f"&format={self.format}" request += f"&sample_rate={self.sample_rate}" @@ -165,16 +165,16 @@ class ASRProvider(ASRProviderBase): return request async def _send_request(self, pcm_data: bytes) -> Optional[str]: - """发送请求到阿里云ASR服务""" + """Send a request to Alibaba Cloud ASR service""" try: - # 设置HTTP头 + # Set http header headers = { "X-NLS-Token": self.token, "Content-type": "application/octet-stream", "Content-Length": str(len(pcm_data)), } - # 创建连接并发送请求 + # Create connection and send request conn = http.client.HTTPSConnection(self.host) request_url = self._construct_request_url() @@ -186,56 +186,56 @@ class ASRProvider(ASRProviderBase): ), ) - # 获取响应 + # Get response response = await loop.run_in_executor(None, conn.getresponse) body = await loop.run_in_executor(None, response.read) conn.close() - # 解析响应 + # Parse response try: body_json = json.loads(body) status = body_json.get("status") if status == 20000000: result = body_json.get("result", "") - logger.bind(tag=TAG).debug(f"ASR结果: {result}") + logger.bind(tag=TAG).debug(f"Asr results: {result}") return result else: - logger.bind(tag=TAG).error(f"ASR失败,状态码: {status}") + logger.bind(tag=TAG).error(f"Asr failed, status code: {status}") return None except ValueError: - logger.bind(tag=TAG).error("响应不是JSON格式") + logger.bind(tag=TAG).error("Response is not in json format") return None except Exception as e: - logger.bind(tag=TAG).error(f"ASR请求失败: {e}", exc_info=True) + logger.bind(tag=TAG).error(f"Asr request failed: {e}", exc_info=True) return None async def speech_to_text( self, opus_data: List[bytes], session_id: str, audio_format="opus" ) -> Tuple[Optional[str], Optional[str]]: - """将语音数据转换为文本""" + """Convert voice data to text""" if self._is_token_expired(): - logger.warning("Token已过期,正在自动刷新...") + logger.warning("Token has expired and is being refreshed automatically...") self._refresh_token() file_path = None try: - # 解码Opus为PCM + # Decode opus to pcm if audio_format == "pcm": pcm_data = opus_data else: pcm_data = self.decode_opus(opus_data) combined_pcm_data = b"".join(pcm_data) - # 判断是否保存为WAV文件 + # Determine whether to save as wav fileether to save as wav file if self.delete_audio_file: pass else: file_path = self.save_audio_to_file(pcm_data, session_id) - # 发送请求并获取文本 + # Send request and get text text = await self._send_request(combined_pcm_data) if text: @@ -244,5 +244,5 @@ class ASRProvider(ASRProviderBase): return "", file_path except Exception as e: - logger.bind(tag=TAG).error(f"语音识别失败: {e}", exc_info=True) + logger.bind(tag=TAG).error(f"Voice recognition failed: {e}", exc_info=True) return "", file_path diff --git a/main/xiaozhi-server/core/providers/asr/aliyun_stream.py b/main/xiaozhi-server/core/providers/asr/aliyun_stream.py index 61ba7dc92..dc172bc22 100644 --- a/main/xiaozhi-server/core/providers/asr/aliyun_stream.py +++ b/main/xiaozhi-server/core/providers/asr/aliyun_stream.py @@ -76,19 +76,19 @@ class ASRProvider(ASRProviderBase): self.asr_ws = None self.forward_task = None self.is_processing = False - self.server_ready = False # 服务器准备状态 + self.server_ready = False # Server readiness status - # 基础配置 + # Basic configuration self.access_key_id = config.get("access_key_id") self.access_key_secret = config.get("access_key_secret") self.appkey = config.get("appkey") self.token = config.get("token") self.host = config.get("host", "nls-gateway-cn-shanghai.aliyuncs.com") - # 如果配置的是内网地址(包含-internal.aliyuncs.com),则使用ws协议,默认是wss协议 + # If the configured internal network address (including internal.aliyuncs.com) is configured, the ws protocol is used. The default is wss protocol. if "-internal." in self.host: self.ws_url = f"ws://{self.host}/ws/v1" else: - # 默认使用wss协议 + # Use wss protocol by default self.ws_url = f"wss://{self.host}/ws/v1" self.max_sentence_silence = config.get("max_sentence_silence") @@ -96,17 +96,17 @@ class ASRProvider(ASRProviderBase): self.delete_audio_file = delete_audio_file self.expire_time = None - # Token管理 + # Token management if self.access_key_id and self.access_key_secret: self._refresh_token() elif not self.token: - raise ValueError("必须提供access_key_id+access_key_secret或者直接提供token") + raise ValueError("Access key id+access key secret or token must be provided directly") def _refresh_token(self): - """刷新Token""" + """Refresh token""" self.token, expire_time_str = AccessToken.create_token(self.access_key_id, self.access_key_secret) if not self.token: - raise ValueError("无法获取有效的访问Token") + raise ValueError("Unable to obtain valid access token") try: expire_str = str(expire_time_str).strip() @@ -119,30 +119,30 @@ class ASRProvider(ASRProviderBase): self.expire_time = None def _is_token_expired(self): - """检查Token是否过期""" + """Check if the token has expired""" return self.expire_time and time.time() > self.expire_time async def open_audio_channels(self, conn): await super().open_audio_channels(conn) async def receive_audio(self, conn, audio, audio_have_voice): - # 初始化音频缓存 + # Initialize audio cache if not hasattr(conn, 'asr_audio_for_voiceprint'): conn.asr_audio_for_voiceprint = [] - # 存储音频数据 + # Store audio data if audio: conn.asr_audio_for_voiceprint.append(audio) conn.asr_audio.append(audio) conn.asr_audio = conn.asr_audio[-10:] - # 只在有声音且没有连接时建立连接 + # Only establish connection when there is sound and no connection if audio_have_voice and not self.is_processing: try: await self._start_recognition(conn) except Exception as e: - logger.bind(tag=TAG).error(f"开始识别失败: {str(e)}") + logger.bind(tag=TAG).error(f"Start recognition failed: {str(e)}") await self._cleanup(conn) return @@ -151,15 +151,15 @@ class ASRProvider(ASRProviderBase): pcm_frame = self.decoder.decode(audio, 960) await self.asr_ws.send(pcm_frame) except Exception as e: - logger.bind(tag=TAG).warning(f"发送音频失败: {str(e)}") + logger.bind(tag=TAG).warning(f"Failed to send audio: {str(e)}") await self._cleanup(conn) async def _start_recognition(self, conn): - """开始识别会话""" + """Start recognition session""" if self._is_token_expired(): self._refresh_token() - # 建立连接 + # Establish connection headers = {"X-NLS-Token": self.token} self.asr_ws = await websockets.connect( self.ws_url, @@ -171,10 +171,10 @@ class ASRProvider(ASRProviderBase): ) self.is_processing = True - self.server_ready = False # 重置服务器准备状态 + self.server_ready = False # Reset server readiness status self.forward_task = asyncio.create_task(self._forward_results(conn)) - # 发送开始请求 + # Send start request start_request = { "header": { "namespace": "SpeechTranscriber", @@ -196,10 +196,10 @@ class ASRProvider(ASRProviderBase): } } await self.asr_ws.send(json.dumps(start_request, ensure_ascii=False)) - logger.bind(tag=TAG).info("已发送开始请求,等待服务器准备...") + logger.bind(tag=TAG).info("Start request sent, waiting for server to prepare...") async def _forward_results(self, conn): - """转发识别结果""" + """Forward recognition results""" try: while self.asr_ws and not conn.stop_event.is_set(): try: @@ -212,51 +212,51 @@ class ASRProvider(ASRProviderBase): status = header.get("status", 0) if status != 20000000: - if status in [40000004, 40010004]: # 连接超时或客户端断开 - logger.bind(tag=TAG).warning(f"连接问题,状态码: {status}") + if status in [40000004, 40010004]: # Connection timed out or client disconnected + logger.bind(tag=TAG).warning(f"Connection problem, status code: {status}") break - elif status in [40270002, 40270003]: # 音频问题 - logger.bind(tag=TAG).warning(f"音频处理问题,状态码: {status}") + elif status in [40270002, 40270003]: # Audio issues + logger.bind(tag=TAG).warning(f"Audio processing issues, status codes: {status}") continue else: - logger.bind(tag=TAG).error(f"识别错误,状态码: {status}, 消息: {header.get('status_text', '')}") + logger.bind(tag=TAG).error(f"Recognition error, status code: {status}, 消息: {header.get('status_text', '')}") continue - # 收到TranscriptionStarted表示服务器准备好接收音频数据 + # Receiving transcription started indicates that the server is ready to receive audio data if message_name == "TranscriptionStarted": self.server_ready = True - logger.bind(tag=TAG).info("服务器已准备,开始发送缓存音频...") + logger.bind(tag=TAG).info("The server is ready to start sending cached audio...") - # 发送缓存音频 + # Send buffered audio if conn.asr_audio: for cached_audio in conn.asr_audio[-10:]: try: pcm_frame = self.decoder.decode(cached_audio, 960) await self.asr_ws.send(pcm_frame) except Exception as e: - logger.bind(tag=TAG).warning(f"发送缓存音频失败: {e}") + logger.bind(tag=TAG).warning(f"Failed to send cached audio: {e}") break continue if message_name == "TranscriptionResultChanged": - # 中间结果 + # intermediate results text = payload.get("result", "") if text: self.text = text elif message_name == "SentenceEnd": - # 最终结果 + # final result text = payload.get("result", "") if text: self.text = text conn.reset_vad_states() - # 传递缓存的音频数据 + # Pass cached audio dataed audio data audio_data = getattr(conn, 'asr_audio_for_voiceprint', []) await self.handle_voice_stop(conn, audio_data) - # 清空缓存 + # Clear cache conn.asr_audio_for_voiceprint = [] break elif message_name == "TranscriptionCompleted": - # 识别完成 + # Recognition completed self.is_processing = False break @@ -265,26 +265,26 @@ class ASRProvider(ASRProviderBase): except websockets.exceptions.ConnectionClosed: break except Exception as e: - logger.bind(tag=TAG).error(f"处理结果失败: {str(e)}") + logger.bind(tag=TAG).error(f"Processing result failed: {str(e)}") break except Exception as e: - logger.bind(tag=TAG).error(f"结果转发失败: {str(e)}") + logger.bind(tag=TAG).error(f"Result forwarding failed: {str(e)}") finally: await self._cleanup(conn) async def _cleanup(self, conn): - """清理资源""" - logger.bind(tag=TAG).info(f"开始ASR会话清理 | 当前状态: processing={self.is_processing}, server_ready={self.server_ready}") + """Clean up resources""" + logger.bind(tag=TAG).info(f"Start asr session cleanup | Current status: processing={self.is_processing}, server_ready={self.server_ready}") - # 清理连接的音频缓存 + # Clear connected audio cache if conn and hasattr(conn, 'asr_audio_for_voiceprint'): conn.asr_audio_for_voiceprint = [] - # 判断是否需要发送终止请求 + # Determine whether a termination request needs to be sent should_stop = self.is_processing or self.server_ready - # 发送停止识别请求 + # Send stop recognition request if self.asr_ws and should_stop: try: stop_msg = { @@ -297,47 +297,47 @@ class ASRProvider(ASRProviderBase): "appkey": self.appkey } } - logger.bind(tag=TAG).info("正在发送ASR终止请求") + logger.bind(tag=TAG).info("Sending asr termination request") await self.asr_ws.send(json.dumps(stop_msg, ensure_ascii=False)) await asyncio.sleep(0.1) - logger.bind(tag=TAG).info("ASR终止请求已发送") + logger.bind(tag=TAG).info("Asr termination request sent") except Exception as e: - logger.bind(tag=TAG).error(f"ASR终止请求发送失败: {e}") + logger.bind(tag=TAG).error(f"Asr termination request failed to send: {e}") - # 状态重置(在终止请求发送后) + # Status reset (after termination request sent) self.is_processing = False self.server_ready = False - logger.bind(tag=TAG).info("ASR状态已重置") + logger.bind(tag=TAG).info("Asr status has been reset") - # 清理任务 + # Cleanup tasks if self.forward_task and not self.forward_task.done(): self.forward_task.cancel() try: await asyncio.wait_for(self.forward_task, timeout=1.0) except Exception as e: - logger.bind(tag=TAG).debug(f"forward_task取消异常: {e}") + logger.bind(tag=TAG).debug(f"Forward task cancellation exception: {e}") finally: self.forward_task = None - # 关闭连接 + # close connection if self.asr_ws: try: - logger.bind(tag=TAG).debug("正在关闭WebSocket连接") + logger.bind(tag=TAG).debug("Closing web socket connection") await asyncio.wait_for(self.asr_ws.close(), timeout=2.0) - logger.bind(tag=TAG).debug("WebSocket连接已关闭") + logger.bind(tag=TAG).debug("Web socket connection closed") except Exception as e: - logger.bind(tag=TAG).error(f"关闭WebSocket连接失败: {e}") + logger.bind(tag=TAG).error(f"Failed to close web socket connection: {e}") finally: self.asr_ws = None - logger.bind(tag=TAG).info("ASR会话清理完成") + logger.bind(tag=TAG).info("Asr session cleanup completed") async def speech_to_text(self, opus_data, session_id, audio_format): - """获取识别结果""" + """Get recognition results""" result = self.text self.text = "" return result, None async def close(self): - """关闭资源""" + """close resource""" await self._cleanup() diff --git a/main/xiaozhi-server/core/providers/asr/baidu.py b/main/xiaozhi-server/core/providers/asr/baidu.py index aa8ea9015..b0c3a4e8e 100644 --- a/main/xiaozhi-server/core/providers/asr/baidu.py +++ b/main/xiaozhi-server/core/providers/asr/baidu.py @@ -26,39 +26,39 @@ class ASRProvider(ASRProviderBase): self.client = AipSpeech(str(self.app_id), self.api_key, self.secret_key) - # 确保输出目录存在 + # Make sure the output directory exists os.makedirs(self.output_dir, exist_ok=True) async def speech_to_text( self, opus_data: List[bytes], session_id: str, audio_format="opus" ) -> Tuple[Optional[str], Optional[str]]: - """将语音数据转换为文本""" + """Convert voice data to text""" if not opus_data: - logger.bind(tag=TAG).warning("音频数据为空!") + logger.bind(tag=TAG).warning("Audio data is empty!") return None, None file_path = None try: - # 检查配置是否已设置 + # Check if the configuration is set if not self.app_id or not self.api_key or not self.secret_key: - logger.bind(tag=TAG).error("百度语音识别配置未设置,无法进行识别") + logger.bind(tag=TAG).error("Baidu speech recognition configuration is not set and recognition cannot be performed") return None, file_path - # 将Opus音频数据解码为PCM + # Decode opus audio data to pcm if audio_format == "pcm": pcm_data = opus_data else: pcm_data = self.decode_opus(opus_data) combined_pcm_data = b"".join(pcm_data) - # 判断是否保存为WAV文件 + # Determine whether to save as wav file if self.delete_audio_file: pass else: self.save_audio_to_file(pcm_data, session_id) start_time = time.time() - # 识别本地文件 + # Identify local files result = self.client.asr( combined_pcm_data, "pcm", @@ -70,16 +70,16 @@ class ASRProvider(ASRProviderBase): if result and result["err_no"] == 0: logger.bind(tag=TAG).debug( - f"百度语音识别耗时: {time.time() - start_time:.3f}s | 结果: {result}" + f"Baidu speech recognition takes timeeech recognition takes time: {time.time() - start_time:.3f}s | result: {result}" ) result = result["result"][0] return result, file_path else: raise Exception( - f"百度语音识别失败,错误码: {result['err_no']},错误信息: {result['err_msg']}" + f"Baidu speech recognition failed, error code: {result['err_no']},error message: {result['err_msg']}" ) return None, file_path except Exception as e: - logger.bind(tag=TAG).error(f"处理音频时发生错误!{e}", exc_info=True) + logger.bind(tag=TAG).error(f"An error occurred while processing audio!{e}", exc_info=True) return None, file_path diff --git a/main/xiaozhi-server/core/providers/asr/dto/dto.py b/main/xiaozhi-server/core/providers/asr/dto/dto.py index 85b2d7b21..b4afac76f 100644 --- a/main/xiaozhi-server/core/providers/asr/dto/dto.py +++ b/main/xiaozhi-server/core/providers/asr/dto/dto.py @@ -3,7 +3,7 @@ from typing import Union, Optional class InterfaceType(Enum): - # 接口类型 - STREAM = "STREAM" # 流式接口 - NON_STREAM = "NON_STREAM" # 非流式接口 - LOCAL = "LOCAL" # 本地服务 + # Interface type + STREAM = "STREAM" # streaming interface + NON_STREAM = "NON_STREAM" # non-streaming interface + LOCAL = "LOCAL" # local service