config.yaml 57 KB

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