






















@@ -561,25 +561,31 @@ describe("chat voice controls", () => {
561561});
562562563563const model = container.querySelector<HTMLInputElement>(
564-'.agent-chat__talk-options input[placeholder="gpt-realtime-2"]',
564+'.agent-chat__talk-options-primary input[placeholder="Auto"]',
565565);
566566const voice = container.querySelector<HTMLSelectElement>(
567-".agent-chat__talk-options label:nth-of-type(4) select",
567+".agent-chat__talk-options-primary label:nth-of-type(1) select",
568+);
569+const sensitivity = container.querySelector<HTMLSelectElement>(
570+".agent-chat__talk-options-primary label:nth-of-type(3) select",
568571);
569572const voiceOptions = Array.from(
570573container.querySelectorAll<HTMLOptionElement>(
571-".agent-chat__talk-options label:nth-of-type(4) option",
574+".agent-chat__talk-options-primary label:nth-of-type(1) option",
572575),
573576).map((option) => option.value);
574577const reasoningOptions = Array.from(
575578container.querySelectorAll<HTMLOptionElement>(
576-".agent-chat__talk-options label:nth-of-type(5) option",
579+".agent-chat__talk-options-advanced label:nth-of-type(3) option",
577580),
578581).map((option) => option.value);
579582580583if (voice === null) {
581584throw new Error("expected Talk voice select");
582585}
586+if (sensitivity === null) {
587+throw new Error("expected Talk sensitivity select");
588+}
583589expect(voiceOptions).toEqual([
584590"",
585591"alloy",
@@ -593,14 +599,58 @@ describe("chat voice controls", () => {
593599"marin",
594600"cedar",
595601]);
602+expect(sensitivity.value).toBe("__custom");
603+expect(Array.from(sensitivity.options).map((option) => option.value)).toEqual([
604+"",
605+"0.65",
606+"0.5",
607+"0.35",
608+"__custom",
609+]);
596610expect(reasoningOptions).toEqual(["", "minimal", "low", "medium", "high"]);
611+expect(container.textContent).toContain("Sensitivity");
612+expect(container.textContent).toContain("Advanced");
613+expect(container.textContent).toContain("Pause before send");
614+expect(container.textContent).not.toContain("Silence ms");
615+expect(container.textContent).not.toContain("Prefix ms");
597616if (model === null) {
598617throw new Error("expected Talk model input");
599618}
600619model.value = "gpt-realtime-mini";
601620model.dispatchEvent(new Event("input", { bubbles: true }));
621+sensitivity.value = "0.35";
622+sensitivity.dispatchEvent(new Event("change", { bubbles: true }));
623+sensitivity.value = "";
624+sensitivity.dispatchEvent(new Event("change", { bubbles: true }));
602625603626expect(onRealtimeTalkOptionsChange).toHaveBeenCalledWith({ model: "gpt-realtime-mini" });
627+expect(onRealtimeTalkOptionsChange).toHaveBeenCalledWith({ vadThreshold: "0.35" });
628+expect(onRealtimeTalkOptionsChange).toHaveBeenCalledWith({ vadThreshold: "" });
629+630+const defaultContainer = renderChatView({
631+realtimeTalkOptionsOpen: true,
632+realtimeTalkOptions: {
633+provider: "",
634+model: "",
635+voice: "",
636+transport: "",
637+vadThreshold: "",
638+silenceDurationMs: "",
639+prefixPaddingMs: "",
640+reasoningEffort: "",
641+},
642+ onRealtimeTalkOptionsChange,
643+});
644+const defaultSensitivity = defaultContainer.querySelector<HTMLSelectElement>(
645+".agent-chat__talk-options-primary label:nth-of-type(3) select",
646+);
647+expect(defaultSensitivity?.value).toBe("");
648+expect(Array.from(defaultSensitivity?.options ?? []).map((option) => option.value)).toEqual([
649+"",
650+"0.65",
651+"0.5",
652+"0.35",
653+]);
604654});
605655606656it("renders composer and Talk labels from the active locale", async () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。