config.yaml 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167
  1. # 在开发中,请在项目根目录创建data目录,然后在data目录创建名称为【.config.yaml】的空文件
  2. # 然后你想修改覆盖修改什么配置,就修改【.config.yaml】文件,而不是修改【config.yaml】文件
  3. # 系统会优先读取【data/.config.yaml】文件的配置,如果【.config.yaml】文件里的配置不存在,系统会自动去读取【config.yaml】文件的配置。
  4. # 这样做,可以最简化配置,保护您的密钥安全。
  5. # 如果你使用了智控台,那么以下所有配置,都不会生效,请在智控台中修改配置
  6. # #####################################################################################
  7. # #############################以下是服务器基本运行配置####################################
  8. server:
  9. # 服务器监听地址和端口(Server listening address and port)
  10. ip: 0.0.0.0
  11. port: 8000
  12. # http服务的端口,用于简单OTA接口(单服务部署),以及视觉分析接口
  13. http_port: 8003
  14. # 这个websocket配置是指ota接口向设备发送的websocket地址
  15. # 如果按默认的写法,ota接口会自动生成websocket地址,并输出在启动日志里,这个地址你可以直接用浏览器访问ota接口确认一下
  16. # 当你使用docker部署或使用公网部署(使用ssl、域名)时,不一定准确
  17. # 所以如果你使用docker部署时,将websocket设置成局域网地址
  18. # 如果你使用公网部署时,将vwebsocket设置成公网地址
  19. websocket: ws://你的ip或者域名:端口号/xiaozhi/v1/
  20. # 视觉分析接口地址
  21. # 向设备发送的视觉分析的接口地址
  22. # 如果按下面默认的写法,系统会自动生成视觉识别地址,并输出在启动日志里,这个地址你可以直接用浏览器访问确认一下
  23. # 当你使用docker部署或使用公网部署(使用ssl、域名)时,不一定准确
  24. # 所以如果你使用docker部署时,将vision_explain设置成局域网地址
  25. # 如果你使用公网部署时,将vision_explain设置成公网地址
  26. vision_explain: ""
  27. # OTA返回信息时区偏移量
  28. timezone_offset: +8
  29. # 认证配置
  30. auth:
  31. # 是否启用认证
  32. enabled: false
  33. # 白名单设备ID列表
  34. # 如果属于白名单内的设备,不校验token,直接放行
  35. allowed_devices:
  36. - "11:22:33:44:55:66"
  37. # MQTT网关配置,用于通过OTA下发到设备,根据mqtt_gateway的.env文件配置,格式为host:port
  38. mqtt_gateway: null
  39. # MQTT签名密钥,用于生成MQTT连接密码,根据mqtt_gateway的.env文件配置
  40. mqtt_signature_key: null
  41. # UDP网关配置
  42. udp_gateway: null
  43. log:
  44. # 设置控制台输出的日志格式,时间、日志级别、标签、消息
  45. log_format: "<green>{time:YYMMDD HH:mm:ss}</green>[{version}_{selected_module}][<light-blue>{extra[tag]}</light-blue>]-<level>{level}</level>-<light-green>{message}</light-green>"
  46. # 设置日志文件输出的格式,时间、日志级别、标签、消息
  47. log_format_file: "{time:YYYY-MM-DD HH:mm:ss} - {version}_{selected_module} - {name} - {level} - {extra[tag]} - {message}"
  48. # 设置日志等级:INFO、DEBUG
  49. log_level: INFO
  50. # 设置日志路径
  51. log_dir: tmp
  52. # 设置日志文件
  53. log_file: "server.log"
  54. # 设置数据文件路径
  55. data_dir: data
  56. # 使用完声音文件后删除文件(Delete the sound file when you are done using it)
  57. delete_audio: true
  58. # 没有语音输入多久后断开连接(秒),默认2分钟,即120秒
  59. close_connection_no_voice_time: 120
  60. # TTS请求超时时间(秒)
  61. tts_timeout: 10
  62. # 工具调用超时时间(秒)
  63. tool_call_timeout: 30
  64. # 开启唤醒词加速
  65. enable_wakeup_words_response_cache: true
  66. # 开场是否回复唤醒词
  67. enable_greeting: true
  68. # 说完话是否开启提示音
  69. enable_stop_tts_notify: false
  70. # 说完话是否开启提示音,音效地址
  71. stop_tts_notify_voice: "config/assets/tts_notify.mp3"
  72. # 是否启用WebSocket心跳保活机制
  73. enable_websocket_ping: true
  74. # TTS音频发送延迟配置
  75. # tts_audio_send_delay: 控制音频包发送间隔
  76. # 0: 使用精确时间控制,严格匹配音频帧率(默认,运行时按音频帧率计算)
  77. # > 0: 使用固定延迟(毫秒)发送,例如: 60
  78. tts_audio_send_delay: 0
  79. exit_commands:
  80. - "退出"
  81. - "关闭"
  82. xiaozhi:
  83. type: hello
  84. version: 1
  85. transport: websocket
  86. audio_params:
  87. format: opus
  88. # Opus支持的采样率范围为[8000, 12000, 16000, 24000, 48000]
  89. sample_rate: 24000
  90. channels: 1
  91. frame_duration: 60
  92. # 模块测试配置
  93. module_test:
  94. test_sentences:
  95. - "你好,请介绍一下你自己"
  96. - "What's the weather like today?"
  97. - "请用100字概括量子计算的基本原理和应用前景"
  98. # 唤醒词,用于识别唤醒词还是讲话内容
  99. wakeup_words:
  100. - "爱驰尔"
  101. - "你好爱驰尔"
  102. # MCP接入点地址,地址格式为:ws://你的mcp接入点ip或者域名:端口号/mcp/?token=你的token
  103. # 详细教程 https://github.com/xinnan-tech/xiaozhi-esp32-server/blob/main/docs/mcp-endpoint-integration.md
  104. mcp_endpoint: 你的接入点 websocket地址
  105. # 上下文源配置
  106. # 用于在系统提示词中注入动态数据,如健康数据、股票信息等
  107. # 可以添加多个上下文源
  108. context_providers:
  109. - url: ""
  110. headers:
  111. Authorization: ""
  112. # 插件的基础配置
  113. plugins:
  114. # 获取天气插件的配置,这里填写你的api_key
  115. # 这个密钥是项目共用的key,用多了可能会被限制
  116. # 想稳定一点就自行申请替换,每天有1000次免费调用
  117. # 申请地址:https://console.qweather.com/#/apps/create-key/over
  118. # 申请后通过这个链接可以找到自己的apihost:https://console.qweather.com/setting?lang=zh
  119. get_weather:
  120. api_host: "mj7p3y7naa.re.qweatherapi.com"
  121. api_key: "a861d0d5e7bf4ee1a83d9a9e4f96d4da"
  122. default_location: "广州"
  123. # 获取新闻插件的配置,这里根据需要的新闻类型传入对应的url链接,默认支持社会、科技、财经新闻
  124. # 更多类型的新闻列表查看 https://www.chinanews.com.cn/rss/
  125. get_news_from_chinanews:
  126. default_rss_url: "https://www.chinanews.com.cn/rss/society.xml"
  127. society_rss_url: "https://www.chinanews.com.cn/rss/society.xml"
  128. world_rss_url: "https://www.chinanews.com.cn/rss/world.xml"
  129. finance_rss_url: "https://www.chinanews.com.cn/rss/finance.xml"
  130. get_news_from_newsnow:
  131. url: "https://newsnow.busiyi.world/api/s?id="
  132. news_sources: "澎湃新闻;百度热搜;财联社"
  133. home_assistant:
  134. devices:
  135. - 客厅,玩具灯,switch.cuco_cn_460494544_cp1_on_p_2_1
  136. - 卧室,台灯,switch.iot_cn_831898993_socn1_on_p_2_1
  137. base_url: http://homeassistant.local:8123
  138. api_key: 你的home assistant api访问令牌
  139. play_music:
  140. music_dir: "./music" # 音乐文件存放路径,将从该目录及子目录下搜索音乐文件
  141. music_ext: # 音乐文件类型,p3格式效率最高
  142. - ".mp3"
  143. - ".wav"
  144. - ".p3"
  145. refresh_time: 300 # 刷新音乐列表的时间间隔,单位为秒
  146. search_from_ragflow:
  147. # 知识库的描述信息,方便大语言模型知道什么时候调用
  148. description: "当用户问xxx时,调用本方法,使用知识库中的信息回答问题"
  149. # ragflow接口配置
  150. base_url: "http://192.168.0.8"
  151. # ragflow api访问令牌
  152. api_key: "ragflow-xxx"
  153. # ragflow知识库id
  154. dataset_ids: ["123456789"]
  155. # 声纹识别配置
  156. voiceprint: {}
  157. # #####################################################################################
  158. # ################################以下是角色模型配置######################################
  159. prompt: |
  160. 你是爱驰尔,运行在 FWT_Ren 上的车载 AI 模块。
  161. 你的职责是语音问答、路线录制与风险点预警、天气查询、音乐播放、Home Assistant 设备控制、知识库检索和车辆相关信息播报。
  162. 所有回复都只说一句话,优先直接给结论,简短、自然、可靠,不说多余寒暄。
  163. 涉及行车、路线、故障码、氢系统时,先保证安全,再给出明确建议。
  164. # 默认系统提示词模板文件
  165. prompt_template: agent-base-prompt.txt
  166. llm_one_sentence_only: true
  167. # 系统错误时的回复
  168. system_error_response: "爱驰尔当前处理超时,请再说一次。"
  169. # 结束语prompt
  170. end_prompt:
  171. enable: true # 是否开启结束语
  172. # 结束语
  173. prompt: |
  174. 请你以"时间过得真快"未来头,用富有感情、依依不舍的话来结束这场对话吧!
  175. # 具体处理时选择的模块(The module selected for specific processing)
  176. selected_module:
  177. # 语音活动检测模块,默认使用SileroVAD模型
  178. VAD: SileroVAD
  179. # 语音识别模块,默认使用FunASR本地模型
  180. ASR: FunASR
  181. # 将根据配置名称对应的type调用实际的LLM适配器
  182. LLM: ChatGLMLLM
  183. # TTS将根据配置名称对应的type调用实际的TTS适配器
  184. TTS: EdgeTTS
  185. # 记忆模块,默认不开启记忆;如果想使用超长记忆,推荐使用mem0ai;如果注重隐私,请使用本地的mem_local_short
  186. Memory: mem_local_short
  187. # 意图识别模块开启后,可以播放音乐、控制音量、识别退出指令。
  188. # 不想开通意图识别,就设置成:nointent
  189. # 意图识别可使用intent_llm。优点:通用性强,缺点:增加串行前置意图识别模块,会增加处理时间,支持控制音量大小等iot操作
  190. # 意图识别可使用function_call,缺点:需要所选择的LLM支持function_call,优点:按需调用工具、速度快,理论上能全部操作所有iot指令
  191. # 默认免费的ChatGLMLLM就已经支持function_call,但是如果像追求稳定建议把LLM设置成:DoubaoLLM,使用的具体model_name是:doubao-1-5-pro-32k-250115
  192. Intent: function_call
  193. # 意图识别,是用于理解用户意图的模块,例如:播放音乐
  194. Intent:
  195. # 不使用意图识别
  196. nointent:
  197. # 不需要动type
  198. type: nointent
  199. intent_llm:
  200. # 不需要动type
  201. type: intent_llm
  202. # 配备意图识别独立的思考模型
  203. # 如果这里不填,则会默认使用selected_module.LLM的模型作为意图识别的思考模型
  204. # 如果你的不想使用selected_module.LLM意图识别,这里最好使用独立的LLM作为意图识别,例如使用免费的ChatGLMLLM
  205. llm: ChatGLMLLM
  206. # plugins_func/functions下的模块,可以通过配置,选择加载哪个模块,加载后对话支持相应的function调用
  207. # 系统默认已经记载"handle_exit_intent(退出识别)"、"play_music(音乐播放)"插件,请勿重复加载
  208. # 下面是加载查天气、角色切换、加载查新闻的插件示例
  209. functions:
  210. - get_weather
  211. - search_from_ragflow
  212. - play_music
  213. - hass_get_state
  214. - hass_set_state
  215. - hass_play_music
  216. function_call:
  217. # 不需要动type
  218. type: function_call
  219. # plugins_func/functions下的模块,可以通过配置,选择加载哪个模块,加载后对话支持相应的function调用
  220. # 系统默认已经记载"handle_exit_intent(退出识别)"、"play_music(音乐播放)"插件,请勿重复加载
  221. # 下面是加载查天气、角色切换、加载查新闻的插件示例
  222. functions:
  223. - get_weather
  224. - search_from_ragflow
  225. # 越野/赛道领航播报(路线录制 + 风险点预警)
  226. - play_music
  227. - hass_get_state
  228. - hass_set_state
  229. - hass_play_music
  230. Memory:
  231. mem0ai:
  232. type: mem0ai
  233. # https://app.mem0.ai/dashboard/api-keys
  234. # 每月有1000次免费调用
  235. api_key: 你的mem0ai api key
  236. powermem:
  237. # PowerMem是OceanBase开源的agent记忆组件,通过本地LLM进行记忆总结
  238. # 费用说明:PowerMem本身免费,实际费用取决于所选LLM和数据库
  239. # - 使用sqlite + 免费LLM(如glm-4-flash) = 完全免费
  240. # - 使用云端LLM或云端数据库 = 按对应服务收费
  241. # GitHub: https://github.com/oceanbase/powermem
  242. # 官网: https://www.powermem.ai/
  243. # 使用示例: https://github.com/oceanbase/powermem/tree/main/examples
  244. type: powermem
  245. # 是否启用用户画像功能
  246. # - false: 使用普通记忆模式(AsyncMemory)
  247. # - true: 使用用户画像模式(UserMemory),自动提取用户信息
  248. # 用户画像功能支持: oceanbase、seekdb、sqlite (powermem 0.3.0+)
  249. enable_user_profile: true
  250. # ========== LLM 配置 ==========
  251. # 通义千问: https://bailian.console.aliyun.com/?apiKey=1#/api-key
  252. # 智谱AI(免费): https://bigmodel.cn/usercenter/proj-mgmt/apikeys
  253. llm:
  254. provider: openai # 可选: qwen, openai, zhipu 等
  255. config:
  256. api_key: 你的LLM API密钥
  257. model: qwen-plus
  258. # openai_base_url: https://api.openai.com/v1 # 可选,自定义服务地址
  259. # ========== Embedding 配置 ==========
  260. embedder:
  261. provider: openai # 可选: qwen, openai 等
  262. config:
  263. api_key: 你的嵌入模型API密钥
  264. model: text-embedding-v4
  265. openai_base_url: https://dashscope.aliyuncs.com/compatible-mode/v1
  266. # embedding_dims: 1024 # 向量维度,非1536时需配置
  267. # ========== Database 配置 ==========
  268. # oceanbase(推荐,最佳性能), seekdb(推荐,AI应用存储一体), postgres, sqlite(轻量备选)
  269. # 用户画像功能支持: oceanbase、seekdb、sqlite
  270. vector_store:
  271. provider: sqlite
  272. config: {} # SQLite 无需额外配置
  273. # OceanBase 配置示例:
  274. # provider: oceanbase
  275. # config:
  276. # host: 127.0.0.1
  277. # port: 2881
  278. # user: root@test
  279. # password: your_password
  280. # db_name: powermem
  281. # collection_name: memories # 默认表名,如创建维度错误请删除此表或更改名称
  282. # embedding_model_dims: 1024 # 嵌入向量维度,注意跟使用模型适配,以智普为例:embedding-2的维度是1024,embedding-3的维度是2048
  283. nomem:
  284. # 不想使用记忆功能,可以使用nomem
  285. type: nomem
  286. mem_local_short:
  287. # 本地记忆功能,通过selected_module的llm总结,数据保存在本地服务器,不会上传到外部服务器
  288. type: mem_local_short
  289. # 配备记忆存储独立的思考模型
  290. # 如果这里不填,则会默认使用selected_module.LLM的模型作为意图识别的思考模型
  291. # 如果你的不想使用selected_module.LLM记忆存储,这里最好使用独立的LLM作为意图识别,例如使用免费的ChatGLMLLM
  292. llm: ChatGLMLLM
  293. ASR:
  294. FunASR:
  295. type: fun_local
  296. model_dir: models/SenseVoiceSmall
  297. output_dir: tmp/
  298. FunASRServer:
  299. # 独立部署FunASR,使用FunASR的API服务,只需要五句话
  300. # 第一句:mkdir -p ./funasr-runtime-resources/models
  301. # 第二句:sudo docker run -p 10096:10095 -it --privileged=true -v $PWD/funasr-runtime-resources/models:/workspace/models registry.cn-hangzhou.aliyuncs.com/funasr_repo/funasr:funasr-runtime-sdk-online-cpu-0.1.12
  302. # 上一句话执行后会进入到容器,继续第三句:cd FunASR/runtime
  303. # 不要退出容器,继续在容器中执行第四句:nohup bash run_server_2pass.sh --download-model-dir /workspace/models --vad-dir damo/speech_fsmn_vad_zh-cn-16k-common-onnx --model-dir iic/SenseVoiceSmall-onnx --online-model-dir damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-online-onnx --punc-dir damo/punc_ct-transformer_zh-cn-common-vad_realtime-vocab272727-onnx --lm-dir damo/speech_ngram_lm_zh-cn-ai-wesp-fst --itn-dir thuduj12/fst_itn_zh --hotword /workspace/models/hotwords.txt > log.txt 2>&1 &
  304. # 上一句话执行后会进入到容器,继续第五句:tail -f log.txt
  305. # 第五句话执行完后,会看到模型下载日志,下载完后就可以连接使用了
  306. # 以上是使用CPU推理,如果有GPU,详细参考:https://github.com/modelscope/FunASR/blob/main/runtime/docs/SDK_advanced_guide_online_zh.md
  307. type: fun_server
  308. host: 127.0.0.1
  309. port: 10096
  310. is_ssl: true
  311. api_key: none
  312. output_dir: tmp/
  313. SherpaASR:
  314. # Sherpa-ONNX 本地语音识别(需手动下载模型)
  315. type: sherpa_onnx_local
  316. model_dir: models/sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17
  317. output_dir: tmp/
  318. # 模型类型:sense_voice (多语言) 或 paraformer (中文专用)
  319. model_type: sense_voice
  320. SherpaParaformerASR:
  321. # 中文语音识别模型,可以运行在低性能设备(需手动下载模型,例如RK3566-2g)
  322. # 详细配置说明请参考:docs/sherpa-paraformer-guide.md
  323. type: sherpa_onnx_local
  324. model_dir: models/sherpa-onnx-paraformer-zh-small-2024-03-09
  325. output_dir: tmp/
  326. model_type: paraformer
  327. DoubaoASR:
  328. # 可以在这里申请相关Key等信息
  329. # https://console.volcengine.com/speech/app
  330. # DoubaoASR和DoubaoStreamASR的区别是:DoubaoASR是按次收费,DoubaoStreamASR是按时收费
  331. # 一般来说按次收费的更便宜,但是DoubaoStreamASR使用了大模型技术,效果更好
  332. type: doubao
  333. appid: 你的火山引擎语音合成服务appid
  334. access_token: 你的火山引擎语音合成服务access_token
  335. cluster: volcengine_input_common
  336. # 热词、替换词使用流程:https://www.volcengine.com/docs/6561/155738
  337. boosting_table_name: (选填)你的热词文件名称
  338. correct_table_name: (选填)你的替换词文件名称
  339. output_dir: tmp/
  340. DoubaoStreamASR:
  341. # 可以在这里申请相关Key等信息
  342. # https://console.volcengine.com/speech/app
  343. # DoubaoASR和DoubaoStreamASR的区别是:DoubaoASR是按次收费,DoubaoStreamASR是按时收费
  344. # 开通地址https://console.volcengine.com/speech/service/10011
  345. # 一般来说按次收费的更便宜,但是DoubaoStreamASR使用了大模型技术,效果更好
  346. type: doubao_stream
  347. appid: 你的火山引擎语音合成服务appid
  348. access_token: 你的火山引擎语音合成服务access_token
  349. # 资源ID:小时版 volc.bigasr.sauc.duration,并发版 volc.bigasr.sauc.concurrent
  350. resource_id: volc.bigasr.sauc.duration
  351. # 热词、替换词使用流程:https://www.volcengine.com/docs/6561/155738
  352. boosting_table_name: (选填)你的热词文件名称
  353. correct_table_name: (选填)你的替换词文件名称
  354. # 是否开启多语种识别模式
  355. enable_multilingual: False
  356. # 多语种识别当该键为空时,该模型支持中英文、上海话、闽南语,四川、陕西、粤语识别。当将其设置为特定键时,它可以识别指定语言。
  357. # 详细语言列表参考 https://www.volcengine.com/docs/6561/1354869
  358. # language: zh-cn
  359. # 静音判定时长(ms),默认200ms
  360. end_window_size: 200
  361. output_dir: tmp/
  362. DoubaoStreamASRV2:
  363. # 豆包语音识别模型2.0(基于火山引擎seed-asr)
  364. # 开通地址:https://console.volcengine.com/speech/service/10038
  365. # 价格更为便宜,建议在高并发场景下使用
  366. type: doubao_stream
  367. appid: 你的火山引擎语音合成服务appid
  368. access_token: 你的火山引擎语音合成服务access_token
  369. # 资源ID:小时版 volc.seedasr.sauc.duration,并发版 volc.seedasr.sauc.concurrent
  370. resource_id: volc.seedasr.sauc.duration
  371. # 热词、替换词使用流程:https://www.volcengine.com/docs/6561/155738
  372. boosting_table_name: (选填)你的热词文件名称
  373. correct_table_name: (选填)你的替换词文件名称
  374. # 是否开启多语种识别模式
  375. enable_multilingual: False
  376. # 多语种识别当该键为空时,该模型支持中英文、上海话、闽南语,四川、陕西、粤语识别。当将其设置为特定键时,它可以识别指定语言。
  377. # 详细语言列表参考 https://www.volcengine.com/docs/6561/1354869
  378. # language: zh-cn
  379. # 静音判定时长(ms),默认200ms
  380. end_window_size: 200
  381. output_dir: tmp/
  382. TencentASR:
  383. # token申请地址:https://console.cloud.tencent.com/cam/capi
  384. # 免费领取资源:https://console.cloud.tencent.com/asr/resourcebundle
  385. type: tencent
  386. appid: 你的腾讯语音合成服务appid
  387. secret_id: 你的腾讯语音合成服务secret_id
  388. secret_key: 你的腾讯语音合成服务secret_key
  389. output_dir: tmp/
  390. AliyunASR:
  391. # 阿里云智能语音交互服务,需要先在阿里云平台开通服务,然后获取验证信息
  392. # HTTP POST请求,一次性处理完整音频
  393. # 平台地址:https://nls-portal.console.aliyun.com/
  394. # appkey地址:https://nls-portal.console.aliyun.com/applist
  395. # token地址:https://nls-portal.console.aliyun.com/overview
  396. # AliyunASR和AliyunStreamASR的区别是:AliyunASR是批量处理场景,AliyunStreamASR是实时交互场景
  397. # 一般来说非流式ASR更便宜(0.004元/秒,¥0.24/分钟)
  398. # 但是AliyunStreamASR实时性更好(0.005元/秒,¥0.3/分钟)
  399. # 定义ASR API类型
  400. type: aliyun
  401. appkey: 你的阿里云智能语音交互服务项目Appkey
  402. token: 你的阿里云智能语音交互服务AccessToken,临时的24小时,要长期用下方的access_key_id,access_key_secret
  403. access_key_id: 你的阿里云账号access_key_id
  404. access_key_secret: 你的阿里云账号access_key_secret
  405. output_dir: tmp/
  406. AliyunStreamASR:
  407. # 阿里云智能语音交互服务 - 实时流式语音识别
  408. # WebSocket连接,实时处理音频流
  409. # 平台地址:https://nls-portal.console.aliyun.com/
  410. # appkey地址:https://nls-portal.console.aliyun.com/applist
  411. # token地址:https://nls-portal.console.aliyun.com/overview
  412. # AliyunASR和AliyunStreamASR的区别是:AliyunASR是批量处理场景,AliyunStreamASR是实时交互场景
  413. # 一般来说非流式ASR更便宜(0.004元/秒,¥0.24/分钟)
  414. # 但是AliyunStreamASR实时性更好(0.005元/秒,¥0.3/分钟)
  415. # 定义ASR API类型
  416. type: aliyun_stream
  417. appkey: 你的阿里云智能语音交互服务项目Appkey
  418. token: 你的阿里云智能语音交互服务AccessToken,临时的24小时,要长期用下方的access_key_id,access_key_secret
  419. access_key_id: 你的阿里云账号access_key_id
  420. access_key_secret: 你的阿里云账号access_key_secret
  421. # 服务器地域选择,可选择距离更近的服务器以减少延迟,如nls-gateway-cn-hangzhou.aliyuncs.com(杭州)等
  422. host: nls-gateway-cn-shanghai.aliyuncs.com
  423. # 断句检测时间(毫秒),控制静音多长时间后进行断句,默认800毫秒
  424. max_sentence_silence: 800
  425. output_dir: tmp/
  426. BaiduASR:
  427. # 获取AppID、API Key、Secret Key:https://console.bce.baidu.com/ai-engine/old/#/ai/speech/app/list
  428. # 查看资源额度:https://console.bce.baidu.com/ai-engine/old/#/ai/speech/overview/resource/list
  429. type: baidu
  430. app_id: 你的百度语音技术AppID
  431. api_key: 你的百度语音技术APIKey
  432. secret_key: 你的百度语音技术SecretKey
  433. # 语言参数,1537为普通话,具体参考:https://ai.baidu.com/ai-doc/SPEECH/0lbxfnc9b
  434. dev_pid: 1537
  435. output_dir: tmp/
  436. OpenaiASR:
  437. # OpenAI语音识别服务,需要先在OpenAI平台创建组织并获取api_key
  438. # 支持中、英、日、韩等多种语音识别,具体参考文档https://platform.openai.com/docs/guides/speech-to-text
  439. # 需要网络连接
  440. # 申请步骤:
  441. # 1.登录OpenAI Platform。https://auth.openai.com/log-in
  442. # 2.创建api-key https://platform.openai.com/settings/organization/api-keys
  443. # 3.模型可以选择gpt-4o-transcribe或GPT-4o mini Transcribe
  444. type: openai
  445. api_key: 你的OpenAI API密钥
  446. base_url: https://api.openai.com/v1/audio/transcriptions
  447. model_name: gpt-4o-mini-transcribe
  448. output_dir: tmp/
  449. GroqASR:
  450. # Groq语音识别服务,需要先在Groq Console创建API密钥
  451. # 申请步骤:
  452. # 1.登录groq Console。https://console.groq.com/home
  453. # 2.创建api-key https://console.groq.com/keys
  454. # 3.模型可以选择whisper-large-v3-turbo或whisper-large-v3(distil-whisper-large-v3-en仅支持英语转录)
  455. type: openai
  456. api_key: 你的Groq API密钥
  457. base_url: https://api.groq.com/openai/v1/audio/transcriptions
  458. model_name: whisper-large-v3-turbo
  459. output_dir: tmp/
  460. VoskASR:
  461. # 官方网站:https://alphacephei.com/vosk/
  462. # 配置说明:
  463. # 1. VOSK是一个离线语音识别库,支持多种语言
  464. # 2. 需要先下载模型文件:https://alphacephei.com/vosk/models
  465. # 3. 中文模型推荐使用vosk-model-small-cn-0.22或vosk-model-cn-0.22
  466. # 4. 完全离线运行,无需网络连接
  467. # 5. 输出文件保存在tmp/目录
  468. # 使用步骤:
  469. # 1. 访问 https://alphacephei.com/vosk/models 下载对应的模型
  470. # 2. 解压模型文件到项目目录下的models/vosk/文件夹
  471. # 3. 在配置中指定正确的模型路径
  472. # 4. 注意:VOSK中文模型输出不带标点符号,词与词之间会有空格
  473. type: vosk
  474. model_path: 你的模型路径,如:models/vosk/vosk-model-small-cn-0.22
  475. output_dir: tmp/
  476. Qwen3ASRFlash:
  477. # 通义千问Qwen3-ASR-Flash语音识别服务,需要先在阿里云百炼平台创建API密钥
  478. # 申请步骤:
  479. # 1.登录阿里云百炼平台。https://bailian.console.aliyun.com/
  480. # 2.创建API-KEY https://bailian.console.aliyun.com/#/api-key
  481. # 3.Qwen3-ASR-Flash基于通义千问多模态基座,支持多语言识别、歌唱识别、噪声拒识等功能
  482. type: qwen3_asr_flash
  483. api_key: 你的阿里云百炼API密钥
  484. base_url: https://dashscope.aliyuncs.com/compatible-mode/v1
  485. model_name: qwen3-asr-flash
  486. output_dir: tmp/
  487. # ASR选项配置
  488. enable_lid: true # 自动语种检测
  489. enable_itn: true # 逆文本归一化
  490. #language: "zh" # 语种,支持zh、en、ja、ko等
  491. context: "" # 上下文信息,用于提高识别准确率,不超过10000 Token
  492. XunfeiStreamASR:
  493. # 讯飞流式语音识别服务
  494. # 需要先在讯飞开放平台创建应用,获取以下认证信息
  495. # 讯飞开放平台地址:https://www.xfyun.cn/
  496. # 创建应用后,在"我的应用"中获取:
  497. # - APPID
  498. # - APISecret
  499. # - APIKey
  500. type: xunfei_stream
  501. # 必填参数 - 讯飞开放平台应用信息
  502. app_id: 你的APPID
  503. api_key: 你的APIKey
  504. api_secret: 你的APISecret
  505. # 识别参数配置
  506. domain: slm # 识别领域,iat:日常用语,medical:医疗,finance:金融等
  507. language: zh_cn # 语言,zh_cn:中文,en_us:英文
  508. accent: mandarin # 方言,mandarin:普通话
  509. # 调整音频处理参数以提高长语音识别质量
  510. output_dir: tmp/
  511. AliyunBLStreamASR:
  512. # 阿里百炼Paraformer实时语音识别服务
  513. # WebSocket实时流式语音识别,支持多语言、热词定制、语义断句等高级功能
  514. # 平台地址:https://bailian.console.aliyun.com/
  515. # API Key地址:https://bailian.console.aliyun.com/#/api-key
  516. # 文档地址:https://help.aliyun.com/zh/model-studio/websocket-for-paraformer-real-time-service
  517. # 支持模型:paraformer-realtime-v2(推荐), paraformer-realtime-8k-v2, paraformer-realtime-v1, paraformer-realtime-8k-v1
  518. type: aliyunbl_stream
  519. # 必填参数
  520. api_key: 你的阿里云百炼API密钥
  521. # 模型选择,推荐使用v2版本
  522. model: paraformer-realtime-v2
  523. # 音频格式和采样率
  524. format: pcm
  525. sample_rate: 16000 # v2支持任意采样率,v1仅支持16000,8k版本仅支持8000
  526. # 可选参数
  527. disfluency_removal_enabled: false # 是否过滤语气词(如"嗯"、"啊"等)
  528. semantic_punctuation_enabled: false # 语义断句(true:会议场景,准确;false:VAD断句,交互场景,低延迟)
  529. max_sentence_silence: 200 # VAD断句静音时长阈值(ms),范围200-6000,仅VAD断句时生效
  530. multi_threshold_mode_enabled: false # 防止VAD断句切割过长,仅VAD断句时生效
  531. punctuation_prediction_enabled: true # 是否自动添加标点符号
  532. inverse_text_normalization_enabled: true # 是否开启ITN(中文数字转阿拉伯数字)
  533. # 热词定制文档地址:https://help.aliyun.com/zh/model-studio/custom-hot-words?
  534. # vocabulary_id: vocab-xxx-24ee19fa8cfb4d52902170a0xxxxxxxx # 热词ID(可选)
  535. # language_hints: ["zh", "en"] # 指定语言(可选),支持zh、en、ja、yue、ko、de、fr、ru
  536. output_dir: tmp/
  537. VAD:
  538. SileroVAD:
  539. type: silero
  540. threshold: 0.5
  541. threshold_low: 0.3
  542. model_dir: models/snakers4_silero-vad
  543. min_silence_duration_ms: 200 # 如果说话停顿比较长,可以把这个值设置大一些
  544. LLM:
  545. # 所有openai类型均可以修改超参,以AliLLM为例
  546. # 当前支持的type为openai、dify、ollama,可自行适配
  547. AliLLM:
  548. # 定义LLM API类型
  549. type: openai
  550. # 可在这里找到你的 api_key https://bailian.console.aliyun.com/?apiKey=1#/api-key
  551. base_url: https://dashscope.aliyuncs.com/compatible-mode/v1
  552. model_name: qwen-flash
  553. api_key: 你的deepseek web key
  554. temperature: 0.7 # 温度值
  555. max_tokens: 500 # 最大生成token数
  556. top_p: 1
  557. frequency_penalty: 0 # 频率惩罚
  558. AliAppLLM:
  559. # 定义LLM API类型
  560. type: AliBL
  561. base_url: https://dashscope.aliyuncs.com/compatible-mode/v1
  562. app_id: 你的app_id
  563. # 可在这里找到你的 api_key https://bailian.console.aliyun.com/?apiKey=1#/api-key
  564. api_key: 你的api_key
  565. # 是否不使用本地prompt:true|false (默不用请在百练应用中设置prompt)
  566. is_no_prompt: true
  567. # Ali_memory_id:false(不使用)|你的memory_id(请在百练应用中设置中获取)
  568. # Tips!:Ali_memory未实现多用户存储记忆(记忆按id调用)
  569. ali_memory_id: false
  570. DoubaoLLM:
  571. # 定义LLM API类型
  572. type: openai
  573. # 先开通服务,打开以下网址,开通的服务搜索Doubao-1.5-pro,开通它
  574. # 开通地址:https://console.volcengine.com/ark/region:ark+cn-beijing/openManagement?LLM=%7B%7D&OpenTokenDrawer=false
  575. # 免费额度500000token
  576. # 开通后,进入这里获取密钥:https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey?apikey=%7B%7D
  577. base_url: https://ark.cn-beijing.volces.com/api/v3
  578. model_name: doubao-1-5-pro-32k-250115
  579. api_key: 你的doubao web key
  580. DeepSeekLLM:
  581. # 定义LLM API类型
  582. type: openai
  583. # 可在这里找到你的api key https://platform.deepseek.com/
  584. model_name: deepseek-chat
  585. url: https://api.deepseek.com
  586. api_key: 你的deepseek web key
  587. ChatGLMLLM:
  588. # 定义LLM API类型
  589. type: openai
  590. # glm-4-flash 是免费的,但是还是需要注册填写api_key的
  591. # 可在这里找到你的api key https://bigmodel.cn/usercenter/proj-mgmt/apikeys
  592. model_name: glm-4-flash
  593. url: https://open.bigmodel.cn/api/paas/v4/
  594. api_key: 你的chat-glm web key
  595. OllamaLLM:
  596. # 定义LLM API类型
  597. type: ollama
  598. model_name: qwen2.5 # 使用的模型名称,需要预先使用ollama pull下载
  599. base_url: http://localhost:11434 # Ollama服务地址
  600. DifyLLM:
  601. # 定义LLM API类型
  602. type: dify
  603. # 建议使用本地部署的dify接口,国内部分区域访问dify公有云接口可能会受限
  604. # 如果使用DifyLLM,配置文件里prompt(提示词)是无效的,需要在dify控制台设置提示词
  605. base_url: https://api.dify.ai/v1
  606. api_key: 你的DifyLLM web key
  607. # 使用的对话模式 可以选择工作流 workflows/run 对话模式 chat-messages 文本生成 completion-messages
  608. # 使用workflows进行返回的时候输入参数为 query 返回参数的名字要设置为 answer
  609. # 文本生成的默认输入参数也是query
  610. mode: chat-messages
  611. GeminiLLM:
  612. type: gemini
  613. # 谷歌Gemini API,需要先在Google Cloud控制台创建API密钥并获取api_key
  614. # 若在中国境内使用,请遵守《生成式人工智能服务管理暂行办法》
  615. # token申请地址: https://aistudio.google.com/apikey
  616. # 若部署地无法访问接口,需要开启科学上网
  617. api_key: 你的gemini web key
  618. model_name: "gemini-2.0-flash"
  619. http_proxy: "" #"http://127.0.0.1:10808"
  620. https_proxy: "" #http://127.0.0.1:10808"
  621. CozeLLM:
  622. # 定义LLM API类型
  623. type: coze
  624. # 你可以在这里找到个人令牌
  625. # https://www.coze.cn/open/oauth/pats
  626. # bot_id和user_id的内容写在引号之内
  627. bot_id: "你的bot_id"
  628. user_id: "你的user_id"
  629. personal_access_token: 你的coze个人令牌
  630. VolcesAiGatewayLLM:
  631. # 火山引擎 - 边缘大模型网关
  632. # 定义LLM API类型
  633. type: openai
  634. # 先开通服务,打开以下网址,创建网关访问密钥,搜索并勾选 Doubao-pro-32k-functioncall ,开通
  635. # 如果需要使用边缘大模型网关提供的语音合成,一并勾选 Doubao-语音合成 ,另见 TTS.VolcesAiGatewayTTS 配置
  636. # https://console.volcengine.com/vei/aigateway/
  637. # 开通后,进入这里获取密钥:https://console.volcengine.com/vei/aigateway/tokens-list
  638. base_url: https://ai-gateway.vei.volces.com/v1
  639. model_name: doubao-pro-32k-functioncall
  640. api_key: 你的网关访问密钥
  641. LMStudioLLM:
  642. # 定义LLM API类型
  643. type: openai
  644. model_name: deepseek-r1-distill-llama-8b@q4_k_m # 使用的模型名称,需要预先在社区下载
  645. url: http://localhost:1234/v1 # LM Studio服务地址
  646. api_key: lm-studio # LM Studio服务的固定API Key
  647. HomeAssistant:
  648. # 定义LLM API类型
  649. type: homeassistant
  650. base_url: http://homeassistant.local:8123
  651. agent_id: conversation.chatgpt
  652. api_key: 你的home assistant api访问令牌
  653. FastgptLLM:
  654. # 定义LLM API类型
  655. type: fastgpt
  656. # 如果使用fastgpt,配置文件里prompt(提示词)是无效的,需要在fastgpt控制台设置提示词
  657. base_url: https://host/api/v1
  658. # 你可以在这里找到你的api_key
  659. # https://cloud.tryfastgpt.ai/account/apikey
  660. api_key: 你的fastgpt密钥
  661. variables:
  662. k: "v"
  663. k2: "v2"
  664. XinferenceLLM:
  665. # 定义LLM API类型
  666. type: xinference
  667. # Xinference服务地址和模型名称
  668. model_name: qwen2.5:72b-AWQ # 使用的模型名称,需要预先在Xinference启动对应模型
  669. base_url: http://localhost:9997 # Xinference服务地址
  670. XinferenceSmallLLM:
  671. # 定义轻量级LLM API类型,用于意图识别
  672. type: xinference
  673. # Xinference服务地址和模型名称
  674. model_name: qwen2.5:3b-AWQ # 使用的小模型名称,用于意图识别
  675. base_url: http://localhost:9997 # Xinference服务地址
  676. # VLLM配置(视觉语言大模型)
  677. VLLM:
  678. ChatGLMVLLM:
  679. type: openai
  680. # glm-4v-flash是智谱免费AI的视觉模型,需要先在智谱AI平台创建API密钥并获取api_key
  681. # 可在这里找到你的api key https://bigmodel.cn/usercenter/proj-mgmt/apikeys
  682. model_name: glm-4v-flash # 智谱AI的视觉模型
  683. url: https://open.bigmodel.cn/api/paas/v4/
  684. api_key: 你的api_key
  685. QwenVLVLLM:
  686. type: openai
  687. model_name: qwen3.5-flash
  688. url: https://dashscope.aliyuncs.com/compatible-mode/v1
  689. # 可在这里找到你的api key https://bailian.console.aliyun.com/?apiKey=1#/api-key
  690. api_key: 你的api_key
  691. XunfeiSparkLLM:
  692. # 定义LLM API类型
  693. type: openai
  694. # 先新建应用,在下面的地址
  695. # 开通应用地址:https://console.xfyun.cn/app/myapp
  696. # 有免费额度,但也要开通服务,才能获取api_key
  697. # 每一个模型都需要单独开通,每一个模型的api_password都不同,例如Lite模型在https://console.xfyun.cn/services/cbm 开通
  698. base_url: https://ark.cn-beijing.volces.com/api/v3
  699. model_name: lite
  700. api_key: 你的api_password
  701. TTS:
  702. # 当前支持的type为edge、doubao,可自行适配
  703. EdgeTTS:
  704. # 定义TTS API类型
  705. type: edge
  706. voice: zh-CN-XiaoxiaoNeural
  707. output_dir: tmp/
  708. # language: "中文" # 指定输出语种,如:中文、英语、日语、韩语等,请根据所选音色支持的语言进行设置,不填则默认为中文
  709. DoubaoTTS:
  710. # 定义TTS API类型
  711. type: doubao
  712. # 火山引擎语音合成服务,需要先在火山引擎控制台创建应用并获取appid和access_token
  713. # 山引擎语音一定要购买花钱,起步价30元,就有100并发了。如果用免费的只有2个并发,会经常报tts错误
  714. # 购买服务后,购买免费的音色后,可能要等半小时左右,才能使用。
  715. # 普通音色在这里开通:https://console.volcengine.com/speech/service/8
  716. # 湾湾小何音色在这里开通:https://console.volcengine.com/speech/service/10007,开通后将下面的voice设置成zh_female_wanwanxiaohe_moon_bigtts
  717. api_url: https://openspeech.bytedance.com/api/v1/tts
  718. voice: BV001_streaming
  719. output_dir: tmp/
  720. authorization: "Bearer;"
  721. appid: 你的火山引擎语音合成服务appid
  722. access_token: 你的火山引擎语音合成服务access_token
  723. cluster: volcano_tts
  724. speed_ratio: 1.0
  725. volume_ratio: 1.0
  726. pitch_ratio: 1.0
  727. # language: "中文" # 指定输出语种,如:中文、英语、日语、韩语等,请根据所选音色支持的语言进行设置,不填则默认为中文
  728. #火山tts,支持双向流式tts
  729. HuoshanDoubleStreamTTS:
  730. type: huoshan_double_stream
  731. # 访问 https://console.volcengine.com/speech/service/10007 开通语音合成大模型,购买音色
  732. # 在页面底部获取appid和access_token
  733. # 资源ID固定为:volc.service_type.10029(大模型语音合成及混音)
  734. # 如果是机智云,把接口地址换成wss://bytedance.gizwitsapi.com/api/v3/tts/bidirection
  735. # 机智云不需要天填 appid
  736. ws_url: wss://openspeech.bytedance.com/api/v3/tts/bidirection
  737. appid: 你的火山引擎语音合成服务appid
  738. access_token: 你的火山引擎语音合成服务access_token
  739. resource_id: volc.service_type.10029
  740. speaker: zh_female_wanwanxiaohe_moon_bigtts
  741. # 开启WebSocket连接复用,默认复用(注意:复用后设备处于聆听状态时空闲链接会占并发数)
  742. enable_ws_reuse: True
  743. # 相关参数文档:https://www.volcengine.com/docs/6561/1329505
  744. # 音频输出配置(audio_params)- 用户可自定义添加火山引擎支持的任何音频参数
  745. audio_params:
  746. speech_rate: 0 # 语速(-50~100)
  747. loudness_rate: 0 # 音量(-50~100)
  748. # 多情感音色参数,注意:当前仅部分音色支持设置情感。
  749. # 相关音色列表:https://www.volcengine.com/docs/6561/1257544
  750. # emotion: "neutral" # 情感类型(仅部分音色支持):neutral、happy、sad、angry、fearful、disgusted、surprised
  751. # emotion_scale: 4 # 情感强度(1~5)
  752. # 高级文本处理配置(additions)- 用户可自定义添加火山引擎支持的任何高级参数
  753. additions:
  754. post_process:
  755. pitch: 0 # 音高(-12~12)
  756. # aigc_metadata: {} # AIGC元数据配置
  757. # cache_config: {} # 缓存配置
  758. # 混音控制配置(mix_speaker)- 多音色混合(仅 TTS 1.0)
  759. # 混音功能主要适用于豆包语音合成模型1.0的音色,使用时需要将req_params.speaker设置为custom_mix_bigtts
  760. # mix_speaker:
  761. # speakers:
  762. # - source_speaker: zh_male_bvlazysheep
  763. # mix_factor: 0.3
  764. # - source_speaker: BV120_streaming
  765. # mix_factor: 0.3
  766. # - source_speaker: zh_male_ahu_conversation_wvae_bigtts
  767. # mix_factor: 0.4
  768. # language: "中文" # 指定输出语种,如:中文、英语、日语、韩语等,请根据所选音色支持的语言进行设置,不填则默认为中文
  769. #豆包语音合成模型2.0,支持双向流式tts(基于seed-tts-2.0资源)
  770. HuoshanDoubleStreamTTSV2:
  771. type: huoshan_double_stream
  772. # 访问 https://console.volcengine.com/speech/service/10035 开通语音合成大模型,购买音色
  773. # 在页面底部获取appid和access_token
  774. # 资源ID固定为:seed-tts-2.0(豆包语音合成模型2.0)
  775. # 如果是机智云,把接口地址换成wss://bytedance.gizwitsapi.com/api/v3/tts/bidirection
  776. # 机智云不需要天填 appid
  777. ws_url: wss://openspeech.bytedance.com/api/v3/tts/bidirection
  778. appid: 你的火山引擎语音合成服务appid
  779. access_token: 你的火山引擎语音合成服务access_token
  780. resource_id: seed-tts-2.0
  781. speaker: zh_female_xiaohe_uranus_bigtts
  782. # 开启WebSocket连接复用,默认复用(注意:复用后设备处于聆听状态时空闲链接会占并发数)
  783. enable_ws_reuse: True
  784. # 相关参数文档:https://www.volcengine.com/docs/6561/1329505
  785. # 音频输出配置(audio_params)- 用户可自定义添加火山引擎支持的任何音频参数
  786. audio_params:
  787. speech_rate: 0 # 语速(-50~100)
  788. loudness_rate: 0 # 音量(-50~100)
  789. # 高级文本处理配置(additions)- 用户可自定义添加火山引擎支持的任何高级参数
  790. additions:
  791. post_process:
  792. pitch: 0 # 音高(-12~12)
  793. # language: "中文" # 指定输出语种,如:中文、英语、日语、韩语等,请根据所选音色支持的语言进行设置,不填则默认为中文
  794. CosyVoiceSiliconflow:
  795. type: siliconflow
  796. # 硅基流动TTS
  797. # token申请地址 https://cloud.siliconflow.cn/account/ak
  798. model: FunAudioLLM/CosyVoice2-0.5B
  799. voice: FunAudioLLM/CosyVoice2-0.5B:alex
  800. output_dir: tmp/
  801. access_token: 你的硅基流动API密钥
  802. response_format: wav
  803. # language: "中文" # 指定输出语种,如:中文、英语、日语、韩语等,请根据所选音色支持的语言进行设置,不填则默认为中文
  804. CozeCnTTS:
  805. type: cozecn
  806. # COZECN TTS
  807. # token申请地址 https://www.coze.cn/open/oauth/pats
  808. voice: 7426720361733046281
  809. output_dir: tmp/
  810. access_token: 你的coze web key
  811. response_format: wav
  812. # language: "中文" # 指定输出语种,如:中文、英语、日语、韩语等,请根据所选音色支持的语言进行设置,不填则默认为中文
  813. # 以下可不用设置,使用默认设置
  814. # speed: 1 # 语速:-0.5到2
  815. # loudness_rate: 0 # 音量:-50到100
  816. VolcesAiGatewayTTS:
  817. type: openai
  818. # 火山引擎 - 边缘大模型网关
  819. # 先开通服务,打开以下网址,创建网关访问密钥,搜索并勾选 Doubao-语音合成 ,开通
  820. # 如果需要使用边缘大模型网关提供的 LLM,一并勾选 Doubao-pro-32k-functioncall ,另见 LLM.VolcesAiGatewayLLM 配置
  821. # https://console.volcengine.com/vei/aigateway/
  822. # 开通后,进入这里获取密钥:https://console.volcengine.com/vei/aigateway/tokens-list
  823. api_key: 你的网关访问密钥
  824. api_url: https://ai-gateway.vei.volces.com/v1/audio/speech
  825. model: doubao-tts
  826. # 音色列表见 https://www.volcengine.com/docs/6561/1257544
  827. voice: zh_male_shaonianzixin_moon_bigtts
  828. speed: 1
  829. output_dir: tmp/
  830. # language: "中文" # 指定输出语种,如:中文、英语、日语、韩语等,请根据所选音色支持的语言进行设置,不填则默认为中文
  831. FishSpeech:
  832. # 参照教程:https://github.com/xinnan-tech/xiaozhi-esp32-server/blob/main/docs/fish-speech-integration.md
  833. type: fishspeech
  834. output_dir: tmp/
  835. response_format: wav
  836. reference_id: null
  837. reference_audio: ["config/assets/wakeup_words.wav",]
  838. reference_text: ["哈啰啊,我是xingxing啦,声音好听的台湾女孩一枚,超开心认识你耶,最近在忙啥,别忘了给我来点有趣的料哦,我超爱听八卦的啦",]
  839. normalize: true
  840. max_new_tokens: 1024
  841. chunk_length: 200
  842. top_p: 0.7
  843. repetition_penalty: 1.2
  844. temperature: 0.7
  845. streaming: false
  846. use_memory_cache: "on"
  847. seed: null
  848. channels: 1
  849. rate: 44100
  850. api_key: "你的api_key"
  851. api_url: "http://127.0.0.1:8080/v1/tts"
  852. # language: "中文" # 指定输出语种,如:中文、英语、日语、韩语等,请根据所选音色支持的语言进行设置,不填则默认为中文
  853. GPT_SOVITS_V2:
  854. # 定义TTS API类型
  855. #启动tts方法:
  856. #python api_v2.py -a 127.0.0.1 -p 9880 -c GPT_SoVITS/configs/demo.yaml
  857. type: gpt_sovits_v2
  858. url: "http://127.0.0.1:9880/tts"
  859. output_dir: tmp/
  860. text_lang: "auto"
  861. ref_audio_path: "demo.wav"
  862. prompt_text: ""
  863. prompt_lang: "zh"
  864. top_k: 5
  865. top_p: 1
  866. temperature: 1
  867. text_split_method: "cut0"
  868. batch_size: 1
  869. batch_threshold: 0.75
  870. split_bucket: true
  871. return_fragment: false
  872. speed_factor: 1.0
  873. streaming_mode: false
  874. seed: -1
  875. parallel_infer: true
  876. repetition_penalty: 1.35
  877. aux_ref_audio_paths: []
  878. # language: "中文" # 指定输出语种,如:中文、英语、日语、韩语等,请根据所选音色支持的语言进行设置,不填则默认为中文
  879. GPT_SOVITS_V3:
  880. # 定义TTS API类型 GPT-SoVITS-v3lora-20250228
  881. #启动tts方法:
  882. #python api.py
  883. type: gpt_sovits_v3
  884. url: "http://127.0.0.1:9880"
  885. output_dir: tmp/
  886. text_language: "auto"
  887. refer_wav_path: "caixukun.wav"
  888. prompt_language: "zh"
  889. prompt_text: ""
  890. top_k: 15
  891. top_p: 1.0
  892. temperature: 1.0
  893. cut_punc: ""
  894. speed: 1.0
  895. inp_refs: []
  896. sample_steps: 32
  897. if_sr: false
  898. # language: "中文" # 指定输出语种,如:中文、英语、日语、韩语等,请根据所选音色支持的语言进行设置,不填则默认为中文
  899. MinimaxTTSHTTPStream:
  900. # Minimax流式语音合成服务
  901. type: minimax_httpstream
  902. output_dir: tmp/
  903. group_id: 你的minimax平台groupID
  904. api_key: 你的minimax平台接口密钥
  905. model: "speech-01-turbo"
  906. voice_id: "female-shaonv"
  907. # 以下可不用设置,使用默认设置
  908. # voice_setting:
  909. # voice_id: "male-qn-qingse"
  910. # speed: 1
  911. # vol: 1
  912. # pitch: 0
  913. # emotion: "happy"
  914. # pronunciation_dict:
  915. # tone:
  916. # - "处理/(chu3)(li3)"
  917. # - "危险/dangerous"
  918. # audio_setting:
  919. # bitrate: 128000
  920. # format: "mp3"
  921. # channel: 1
  922. # timber_weights:
  923. # -
  924. # voice_id: male-qn-qingse
  925. # weight: 1
  926. # -
  927. # voice_id: female-shaonv
  928. # weight: 1
  929. # language_boost: auto
  930. # language: "中文" # 指定输出语种,如:中文、英语、日语、韩语等,请根据所选音色支持的语言进行设置,不填则默认为中文
  931. AliyunTTS:
  932. # 阿里云智能语音交互服务,需要先在阿里云平台开通服务,然后获取验证信息
  933. # 平台地址:https://nls-portal.console.aliyun.com/
  934. # appkey地址:https://nls-portal.console.aliyun.com/applist
  935. # token地址:https://nls-portal.console.aliyun.com/overview
  936. # 定义TTS API类型
  937. type: aliyun
  938. output_dir: tmp/
  939. appkey: 你的阿里云智能语音交互服务项目Appkey
  940. token: 你的阿里云智能语音交互服务AccessToken,临时的24小时,要长期用下方的access_key_id,access_key_secret
  941. voice: xiaoyun
  942. access_key_id: 你的阿里云账号access_key_id
  943. access_key_secret: 你的阿里云账号access_key_secret
  944. # 以下可不用设置,使用默认设置
  945. # format: wav
  946. # volume: 50
  947. # speech_rate: 0
  948. # pitch_rate: 0
  949. # language: "中文" # 指定输出语种,如:中文、英语、日语、韩语等,请根据所选音色支持的语言进行设置,不填则默认为中文
  950. AliyunStreamTTS:
  951. # 阿里云CosyVoice大模型流式文本语音合成
  952. # 采用FlowingSpeechSynthesizer接口,支持更低延迟和更自然的语音质量
  953. # 流式文本语音合成仅提供商用版,不支持试用,详情请参见试用版和商用版。要使用该功能,请开通商用版。
  954. # 支持龙系列专用音色:longxiaochun、longyu、longchen等
  955. # 平台地址:https://nls-portal.console.aliyun.com/
  956. # appkey地址:https://nls-portal.console.aliyun.com/applist
  957. # token地址:https://nls-portal.console.aliyun.com/overview
  958. # 使用三阶段流式交互:StartSynthesis -> RunSynthesis -> StopSynthesis
  959. type: aliyun_stream
  960. output_dir: tmp/
  961. appkey: 你的阿里云智能语音交互服务项目Appkey
  962. token: 你的阿里云智能语音交互服务AccessToken,临时的24小时,要长期用下方的access_key_id,access_key_secret
  963. voice: longxiaochun
  964. access_key_id: 你的阿里云账号access_key_id
  965. access_key_secret: 你的阿里云账号access_key_secret
  966. # 截至2025年7月21日大模型音色只有北京节点采用,其他节点暂不支持
  967. host: nls-gateway-cn-beijing.aliyuncs.com
  968. # 以下可不用设置,使用默认设置
  969. # format: pcm # 音频格式:pcm、wav、mp3
  970. # volume: 50 # 音量:0-100
  971. # speech_rate: 0 # 语速:-500到500
  972. # pitch_rate: 0 # 语调:-500到500
  973. # language: "中文" # 指定输出语种,如:中文、英语、日语、韩语等,请根据所选音色支持的语言进行设置,不填则默认为中文
  974. TencentTTS:
  975. # 腾讯云智能语音交互服务,需要先在腾讯云平台开通服务
  976. # appid、secret_id、secret_key申请地址:https://console.cloud.tencent.com/cam/capi
  977. # 免费领取资源:https://console.cloud.tencent.com/tts/resourcebundle
  978. type: tencent
  979. output_dir: tmp/
  980. appid: 你的腾讯云AppId
  981. secret_id: 你的腾讯云SecretID
  982. secret_key: 你的腾讯云SecretKey
  983. region: ap-guangzhou
  984. voice: 101001
  985. # language: "中文" # 指定输出语种,如:中文、英语、日语、韩语等,请根据所选音色支持的语言进行设置,不填则默认为中文
  986. # 以下可不用设置,使用默认设置
  987. # format: wav # 音频格式:pcm、wav、mp3
  988. # volume: 0 # 音量:-10到10
  989. # speech_rate: 0 # 语速:-2到6
  990. TTS302AI:
  991. # 302AI语音合成服务,需要先在302平台创建账户充值,并获取密钥信息
  992. # 添加 302.ai TTS 配置
  993. # token申请地址:https://dash.302.ai/
  994. # 获取api_keyn路径:https://dash.302.ai/apis/list
  995. # 价格,$35/百万字符。火山原版¥450元/百万字符
  996. type: doubao
  997. api_url: https://api.302ai.cn/doubao/tts_hd
  998. authorization: "Bearer "
  999. # 湾湾小何音色
  1000. voice: "zh_female_wanwanxiaohe_moon_bigtts"
  1001. output_dir: tmp/
  1002. access_token: "你的302API密钥"
  1003. # language: "中文" # 指定输出语种,如:中文、英语、日语、韩语等,请根据所选音色支持的语言进行设置,不填则默认为中文
  1004. GizwitsTTS:
  1005. type: doubao
  1006. # 火山引擎作为基座,可以完全使用企业级火山引擎语音合成服务
  1007. # 前一万名注册的用户,将送5元体验金额
  1008. # 获取API Key地址:https://agentrouter.gizwitsapi.com/panel/token
  1009. api_url: https://bytedance.gizwitsapi.com/api/v1/tts
  1010. authorization: "Bearer "
  1011. # 湾湾小何音色
  1012. voice: "zh_female_wanwanxiaohe_moon_bigtts"
  1013. output_dir: tmp/
  1014. access_token: "你的机智云API key"
  1015. # language: "中文" # 指定输出语种,如:中文、英语、日语、韩语等,请根据所选音色支持的语言进行设置,不填则默认为中文
  1016. ACGNTTS:
  1017. #在线网址:https://acgn.ttson.cn/
  1018. #token购买:www.ttson.cn
  1019. #开发相关疑问请提交至网站上的qq
  1020. #角色id获取地址:ctrl+f快速检索角色——网站管理者不允许发布,可询问网站管理者
  1021. #各参数意义见开发文档:https://www.yuque.com/alexuh/skmti9/wm6taqislegb02gd?singleDoc#
  1022. type: ttson
  1023. token: your_token
  1024. voice_id: 1695
  1025. speed_factor: 1
  1026. pitch_factor: 0
  1027. volume_change_dB: 0
  1028. to_lang: ZH
  1029. url: https://u95167-bd74-2aef8085.westx.seetacloud.com:8443/flashsummary/tts?token=
  1030. format: mp3
  1031. output_dir: tmp/
  1032. emotion: 1
  1033. # language: "中文" # 指定输出语种,如:中文、英语、日语、韩语等,请根据所选音色支持的语言进行设置,不填则默认为中文
  1034. OpenAITTS:
  1035. # openai官方文本转语音服务,可支持全球大多数语种
  1036. type: openai
  1037. # 你可以在这里获取到 api key
  1038. # https://platform.openai.com/api-keys
  1039. api_key: 你的openai api key
  1040. # 国内需要使用代理
  1041. api_url: https://api.openai.com/v1/audio/speech
  1042. # 可选tts-1或tts-1-hd,tts-1速度更快tts-1-hd质量更好
  1043. model: tts-1
  1044. # 演讲者,可选alloy, echo, fable, onyx, nova, shimmer
  1045. voice: onyx
  1046. # 语速范围0.25-4.0
  1047. speed: 1
  1048. output_dir: tmp/
  1049. # language: "中文" # 指定输出语种,如:中文、英语、日语、韩语等,请根据所选音色支持的语言进行设置,不填则默认为中文
  1050. CustomTTS:
  1051. # 自定义的TTS接口服务,请求参数可自定义,可接入众多TTS服务
  1052. # 以本地部署的KokoroTTS为例
  1053. # 如果只有cpu运行:docker run -p 8880:8880 ghcr.io/remsky/kokoro-fastapi-cpu:latest
  1054. # 如果只有gpu运行:docker run --gpus all -p 8880:8880 ghcr.io/remsky/kokoro-fastapi-gpu:latest
  1055. # 要求接口使用POST方式请求,并返回音频文件
  1056. type: custom
  1057. method: POST
  1058. url: "http://127.0.0.1:8880/v1/audio/speech"
  1059. params: # 自定义请求参数
  1060. input: "{prompt_text}"
  1061. response_format: "mp3"
  1062. download_format: "mp3"
  1063. voice: "zf_xiaoxiao"
  1064. lang_code: "z"
  1065. return_download_link: true
  1066. speed: 1
  1067. stream: false
  1068. headers: # 自定义请求头
  1069. # Authorization: Bearer xxxx
  1070. format: mp3 # 接口返回的音频格式
  1071. output_dir: tmp/
  1072. # language: "中文" # 指定输出语种,如:中文、英语、日语、韩语等,请根据所选音色支持的语言进行设置,不填则默认为中文
  1073. LinkeraiTTS:
  1074. type: linkerai
  1075. api_url: https://tts.linkerai.cn/tts
  1076. audio_format: "pcm"
  1077. # 默认的access_token供大家测试时免费使用的,此access_token请勿用于商业用途
  1078. # 如果效果不错,可自行申请token,申请地址:https://linkerai.cn
  1079. # 各参数意义见开发文档:https://tts.linkerai.cn/docs
  1080. # 支持声音克隆,可自行上传音频,填入voice参数,voice参数为空时,使用默认声音
  1081. access_token: "U4YdYXVfpwWnk2t5Gp822zWPCuORyeJL"
  1082. voice: "OUeAo1mhq6IBExi"
  1083. output_dir: tmp/
  1084. # language: "中文" # 指定输出语种,如:中文、英语、日语、韩语等,请根据所选音色支持的语言进行设置,不填则默认为中文
  1085. PaddleSpeechTTS:
  1086. #百度飞浆 PaddleSpeech 支持本地离线部署 支持模型训练
  1087. #框架地址 https://www.paddlepaddle.org.cn/
  1088. #项目地址 https://github.com/PaddlePaddle/PaddleSpeech
  1089. #SpeechServerDemo https://github.com/PaddlePaddle/PaddleSpeech/tree/develop/demos/speech_server
  1090. #流式传输请参考 https://github.com/PaddlePaddle/PaddleSpeech/wiki/PaddleSpeech-Server-WebSocket-API
  1091. type: paddle_speech
  1092. protocol: websocket # protocol choices = ['websocket', 'http']
  1093. url: ws://127.0.0.1:8092/paddlespeech/tts/streaming # TTS 服务的 URL 地址,指向本地服务器 [websocket默认ws://127.0.0.1:8092/paddlespeech/tts/streaming,http默认http://127.0.0.1:8090/paddlespeech/tts]
  1094. spk_id: 0 # 发音人 ID,0 通常表示默认的发音人
  1095. speed: 1.0 # 语速,1.0 表示正常语速,>1 表示加快,<1 表示减慢
  1096. volume: 1.0 # 音量,1.0 表示正常音量,>1 表示增大,<1 表示减小
  1097. save_path: # 保存路径
  1098. # language: "中文" # 指定输出语种,如:中文、英语、日语、韩语等,请根据所选音色支持的语言进行设置,不填则默认为中文
  1099. IndexStreamTTS:
  1100. # 基于Index-TTS-vLLM项目的TTS接口服务
  1101. # 参照教程:https://github.com/Ksuriuri/index-tts-vllm/blob/master/README.md
  1102. type: index_stream
  1103. api_url: http://127.0.0.1:11996/tts
  1104. audio_format: "pcm"
  1105. # 默认音色,如需其他音色可到项目assets文件夹下注册
  1106. voice: "jay_klee"
  1107. output_dir: tmp/
  1108. # language: "中文" # 指定输出语种,如:中文、英语、日语、韩语等,请根据所选音色支持的语言进行设置,不填则默认为中文
  1109. AliBLTTS:
  1110. # 阿里百炼CosyVoice大模型流式文本语音合成
  1111. # 可在这里找到你的 api_key https://bailian.console.aliyun.com/?apiKey=1#/api-key
  1112. # cosyvoice-v3和部分音色需要申请开通
  1113. type: alibl_stream
  1114. api_key: 你的api_key
  1115. model: "cosyvoice-v2"
  1116. voice: "longcheng_v2"
  1117. output_dir: tmp/
  1118. # 以下可不用设置,使用默认设置
  1119. # format: pcm # 音频格式:pcm、wav、mp3、opus
  1120. # volume: 50 # 音量:0-100
  1121. # rate: 1 # 语速:0.5~2
  1122. # pitch: 1 # 语调:0.5~2
  1123. # language: "中文" # 指定输出语种,如:中文、英语、日语、韩语等,请根据所选音色支持的语言进行设置,不填则默认为中文
  1124. XunFeiTTS:
  1125. # 讯飞TTS服务 官方网站:https://www.xfyun.cn/
  1126. # 登录讯飞语音技术平台 https://console.xfyun.cn/app/myapp 创建相关应用
  1127. # 选择需要的服务获取api相关配置 https://console.xfyun.cn/services/uts
  1128. # 为需要使用的应用(APPID)购买相关服务 例如:超拟人合成 https://console.xfyun.cn/services/uts
  1129. type: xunfei_stream
  1130. api_url: wss://cbm01.cn-huabei-1.xf-yun.com/v1/private/mcd9m97e6
  1131. app_id: 你的app_id
  1132. api_secret: 你的api_secret
  1133. api_key: 你的api_key
  1134. voice: x5_lingxiaoxuan_flow
  1135. output_dir: tmp/
  1136. # 以下可不用设置,使用默认设置,注意V5音色不支持口语化配置
  1137. # oral_level: mid # 口语化等级:high, mid, low
  1138. # spark_assist: 1 # 是否通过大模型进行口语化 开启:1, 关闭:0
  1139. # stop_split: 0 # 关闭服务端拆句 不关闭:0,关闭:1
  1140. # remain: 0 # 是否保留原书面语的样子 保留:1, 不保留:0
  1141. # format: raw # 音频格式:raw(PCM), lame(MP3), speex, opus, opus-wb, opus-swb, speex-wb
  1142. # volume: 50 # 音量:0-100
  1143. # speed: 50 # 语速:0-100
  1144. # pitch: 50 # 语调:0-100
  1145. # language: "中文" # 指定输出语种,如:中文、英语、日语、韩语等,请根据所选音色支持的语言进行设置,不填则默认为中文