feat: 更新配置文档

This commit is contained in:
hhs
2026-06-13 19:57:35 +08:00
parent f764b3a7d8
commit 0d9d3db73b
12 changed files with 83 additions and 34 deletions

View File

@@ -16,17 +16,22 @@ import (
// DeepgramService 基于 Deepgram WebSocket API 的语音识别实现。
type DeepgramService struct {
apiKey string
model string
endpoint string
logger *zap.SugaredLogger
}
// NewDeepgramService 创建 Deepgram STT 服务。
func NewDeepgramService(apiKey, endpoint string, logger *zap.SugaredLogger) *DeepgramService {
func NewDeepgramService(apiKey, model, endpoint string, logger *zap.SugaredLogger) *DeepgramService {
if model == "" {
model = "nova-2"
}
if endpoint == "" {
endpoint = "wss://api.deepgram.com/v1/listen"
}
return &DeepgramService{
apiKey: apiKey,
model: model,
endpoint: endpoint,
logger: logger,
}
@@ -128,7 +133,7 @@ func (d *DeepgramService) buildURL(opts Options) string {
q.Set("encoding", encoding)
q.Set("sample_rate", fmt.Sprintf("%d", sampleRate))
q.Set("language", language)
q.Set("model", "nova-2")
q.Set("model", d.model)
q.Set("punctuate", "true")
u.RawQuery = q.Encode()