package ai import ( "git.ipao.vip/rogee/go-sip/internal/configread" "testing" ) func protocolTask(t *testing.T, protocol string) (configread.Task, map[string]configread.Provider) { t.Helper() task, ps := currentFixture(t, "full_ai") task = changeCurrentAgent(t, task, func(a map[string]any) { a["asr"].(map[string]any)["provider_ref"] = "ali_bailian" a["asr"].(map[string]any)["model"] = "unlisted-asr-model-2029" a["asr"].(map[string]any)["params"] = map[string]any{"sample_rate": 16000, "language": "English", "format": "pcm"} a["llm"].(map[string]any)["model"] = "unlisted-chat-model-2029" a["tts"].(map[string]any)["model"] = "unlisted-tts-model-2029" a["tts"].(map[string]any)["voice"] = "unlisted-voice" a["tts"].(map[string]any)["params"] = map[string]any{"sample_rate": 16000, "format": "pcm", "rate": 1.75, "language": "English"} }) return task, ps } func TestProtocolModelsAndVoicesAreTaskSelectedNotHardcoded(t *testing.T) { task, ps := protocolTask(t, TTSProtocolDashScopeTask) b, err := Bind(task, ps) if err != nil || b.ASR.Model != "unlisted-asr-model-2029" || b.LLM.Model != "unlisted-chat-model-2029" || b.TTS.Model != "unlisted-tts-model-2029" || b.TTS.Voice != "unlisted-voice" { t.Fatal("task-selected model rejected", err) } }