























@@ -7,7 +7,10 @@ import {
77registerProviderPlugin,
88requireRegisteredProvider,
99} from "openclaw/plugin-sdk/plugin-test-runtime";
10-import { runRealtimeSttLiveTest } from "openclaw/plugin-sdk/provider-test-contracts";
10+import {
11+expectOpenClawLiveTranscriptMarker,
12+runRealtimeSttLiveTest,
13+} from "openclaw/plugin-sdk/provider-test-contracts";
1114import { getRuntimeConfig } from "openclaw/plugin-sdk/runtime-config-snapshot";
1215import { describe, expect, it } from "vitest";
1316import plugin from "./index.js";
@@ -68,10 +71,6 @@ const registerXaiPlugin = () =>
6871name: "xAI Provider",
6972});
707371-function normalizeTranscriptForMatch(value: string): string {
72-return value.toLowerCase().replace(/[^a-z0-9]+/g, "");
73-}
74-7574describeLive("xai plugin live", () => {
7675it("synthesizes TTS through the registered speech provider", async () => {
7776const { speechProviders } = await registerXaiPlugin();
@@ -146,9 +145,8 @@ describeLive("xai plugin live", () => {
146145});
147146148147const normalized = transcript?.text.toLowerCase() ?? "";
149-const compact = normalizeTranscriptForMatch(normalized);
150148expect(transcript?.model).toBe(XAI_DEFAULT_STT_MODEL);
151-expect(compact).toContain("openclaw");
149+expectOpenClawLiveTranscriptMarker(normalized);
152150expect(normalized).toContain("speech");
153151expect(normalized).toContain("text");
154152expect(normalized).toContain("integration");
@@ -222,8 +220,7 @@ describeLive("xai plugin live", () => {
222220});
223221224222const normalized = transcripts.join(" ").toLowerCase();
225-const compact = normalizeTranscriptForMatch(normalized);
226-expect(compact).toContain("openclaw");
223+expectOpenClawLiveTranscriptMarker(normalized);
227224expect(normalized).toContain("transcription");
228225expect(partials.length + transcripts.length).toBeGreaterThan(0);
229226}, 180_000);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。