refactor: 简化热词配置为豆包控制台 ID

- 移除本地热词列表配置,改为直接使用豆包控制台的热词表 ID
- 删除 internal/asr/hotwords.go(不再需要本地解析)
- 简化 client.go 逻辑,直接传递 boosting_table_id
- 移除 protocol.go 中的 boosting_table_name 字段
- 更新配置示例,添加控制台链接说明

使用方法:
1. 在豆包控制台创建热词表:https://console.volcengine.com/speech/hotword
2. 复制热词表 ID 到 config.yaml 的 boosting_table_id 字段
This commit is contained in:
2026-03-02 01:16:34 +08:00
parent 96d685fdf2
commit 4120d6451e
6 changed files with 24 additions and 152 deletions

View File

@@ -144,10 +144,10 @@ func createServer(cfg config.Config, lanIP string, tlsResult *vpTLS.Result) *ser
func buildASRFactory(cfg config.Config) func(chan<- ws.ServerMsg) (func([]byte), func(), error) {
asrCfg := asr.Config{
AppID: cfg.Doubao.AppID,
AccessToken: cfg.Doubao.AccessToken,
ResourceID: cfg.Doubao.ResourceID,
Hotwords: cfg.Doubao.Hotwords,
AppID: cfg.Doubao.AppID,
AccessToken: cfg.Doubao.AccessToken,
ResourceID: cfg.Doubao.ResourceID,
BoostingTableID: cfg.Doubao.BoostingTableID,
}
return func(resultCh chan<- ws.ServerMsg) (func([]byte), func(), error) {
client, err := asr.Dial(asrCfg, resultCh)