fix(ai): pin approved Doubao ASR V2 resource

This commit is contained in:
2026-10-04 16:37:45 +08:00
parent 4f319a58fa
commit d534f82e4d
2 changed files with 6 additions and 5 deletions
+5 -5
View File
@@ -13,9 +13,9 @@ import (
)
type currentASRWireCapture struct {
path, key string
frame []byte
err error
path, key, resourceID string
frame []byte
err error
}
func TestASRParametersReachDoubaoSDKWebSocket(t *testing.T) {
@@ -36,7 +36,7 @@ func TestASRParametersReachDoubaoSDKWebSocket(t *testing.T) {
}
defer conn.Close()
_, frame, err := conn.ReadMessage()
captures <- currentASRWireCapture{path: r.URL.Path, key: r.Header.Get("X-Api-Key"), frame: frame, err: err}
captures <- currentASRWireCapture{path: r.URL.Path, key: r.Header.Get("X-Api-Key"), resourceID: r.Header.Get("X-Api-Resource-Id"), frame: frame, err: err}
}))
defer server.Close()
task, providers := currentFixture(t, tc.mode)
@@ -54,7 +54,7 @@ func TestASRParametersReachDoubaoSDKWebSocket(t *testing.T) {
}
select {
case got := <-captures:
if got.err != nil || got.path != "/api/v3/sauc/bigmodel" || got.key != asrProvider.Credential {
if got.err != nil || got.path != "/api/v3/sauc/bigmodel" || got.key != asrProvider.Credential || got.resourceID != "volc.seedasr.sauc.duration" {
t.Fatalf("SDK ASR WebSocket endpoint/credential was changed: path=%q err=%v", got.path, got.err)
}
// Inspect the SDK-emitted JSON payload. No provider protocol is
+1
View File
@@ -126,6 +126,7 @@ func (b Binding) Recognize(ctx context.Context, pcm16 []byte) (string, error) {
}
client := doubaospeech.NewClient("",
doubaospeech.WithAPIKey(b.ASR.Provider.Credential),
doubaospeech.WithResourceID(doubaospeech.ResourceASRStreamV2),
doubaospeech.WithWebSocketURL(u.String()),
)
request := b.ASR.Request