fix(ai): pin approved Doubao ASR V2 resource
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user