[Core] Graduate MiniCPM-o 4.5 and PersonaPlex full-duplex serving out of experimental (#6196)
Signed-off-by: chickeyton <ngton2014@gmail.com> Signed-off-by: Gao Han <hgaoaf@connect.ust.hk> Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: Gao Han <hgaoaf@connect.ust.hk>
This commit is contained in:
179 files changed
+6462
-3832
No files matched your search
@@ -15,11 +15,26 @@ import pytest
|
||||
from huggingface_hub import snapshot_download
|
||||
|
||||
from tests.helpers.runtime import OmniServerParams, get_model_prefix
|
||||
from tests.helpers.stage_config import get_deploy_config_path, get_deploy_duplex_max_sessions
|
||||
from tests.helpers.stage_config import (
|
||||
get_deploy_config_path,
|
||||
get_deploy_duplex_max_sessions,
|
||||
modify_stage_config,
|
||||
)
|
||||
|
||||
MODEL = "openbmb/MiniCPM-o-4_5"
|
||||
DEPLOY_CONFIG_REL = "minicpmo_4_5.yaml"
|
||||
DEPLOY_CONFIG = get_deploy_config_path(DEPLOY_CONFIG_REL)
|
||||
# Eager-execution variant for fast-startup core-tier probes (e.g. the duplex
|
||||
# client live test): skips CUDA-graph capture on the LLM and Talker stages.
|
||||
CORE_DEPLOY_CONFIG = modify_stage_config(
|
||||
DEPLOY_CONFIG,
|
||||
updates={
|
||||
"stages": {
|
||||
0: {"enforce_eager": True},
|
||||
1: {"enforce_eager": True},
|
||||
}
|
||||
},
|
||||
)
|
||||
ASSET_DIR = Path(__file__).resolve().parents[3] / "assets" / "minicpmo_4_5"
|
||||
RESPONSE_REQUIRED_WAV = ASSET_DIR / "response_required_16k.wav"
|
||||
RESPONSE_REQUIRED_SHA256 = "2e5fd4eb3ee434ce107ee3a0591fa624a33f7683c7462f45fe651c443c9af941"
|
||||
@@ -39,6 +54,18 @@ SERVER_PARAMS = [
|
||||
)
|
||||
]
|
||||
|
||||
CORE_SERVER_PARAMS = [
|
||||
pytest.param(
|
||||
OmniServerParams(
|
||||
model=MODEL,
|
||||
stage_config_path=CORE_DEPLOY_CONFIG,
|
||||
use_stage_cli=False,
|
||||
server_args=["--trust-remote-code"],
|
||||
),
|
||||
id="three-stage-single-gpu",
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
def deploy_max_sessions() -> int:
|
||||
"""Concurrent duplex sessions the deploy config under test admits.
|
||||
|
||||
@@ -52,28 +52,49 @@ try:
|
||||
except ImportError as exc: # pragma: no cover - demo dependency.
|
||||
raise SystemExit("Install websockets first: pip install websockets") from exc
|
||||
|
||||
from vllm_omni.experimental.fullduplex.client import ( # noqa: E402
|
||||
from vllm_omni.clients.duplex import ( # noqa: E402
|
||||
PCM16_BYTES_PER_SAMPLE,
|
||||
PCM16_SAMPLE_RATE,
|
||||
RealtimeEventCollector,
|
||||
EventCollector,
|
||||
build_realtime_url,
|
||||
duplex_unit_boundary_ms,
|
||||
read_pcm16_wav,
|
||||
summarize_session_request_metrics,
|
||||
)
|
||||
from vllm_omni.experimental.fullduplex.client import ( # noqa: E402
|
||||
from vllm_omni.clients.duplex import ( # noqa: E402
|
||||
reference_audio_data_url as _ref_audio_data_url,
|
||||
)
|
||||
from vllm_omni.experimental.fullduplex.video_stacking import ( # noqa: E402
|
||||
concat_frames_b64,
|
||||
unit_subframe_offsets,
|
||||
)
|
||||
from vllm_omni.metrics.definitions import compute_audio_rtf # noqa: E402
|
||||
|
||||
|
||||
def _url_with_model(url, model, *, autostart=None, session_id=None):
|
||||
# This driver speaks the MiniCPM-o native duplex wire contract.
|
||||
return build_realtime_url(
|
||||
url,
|
||||
model,
|
||||
autostart=autostart,
|
||||
session_id=session_id,
|
||||
extra_query={"native_duplex": "1"},
|
||||
)
|
||||
|
||||
|
||||
_url_with_model = build_realtime_url
|
||||
_read_wav_pcm16 = read_pcm16_wav
|
||||
DemoArgs = argparse.Namespace | SimpleNamespace
|
||||
|
||||
|
||||
def _audio_rtf_from_raw_metric(raw_metric: dict[str, object]) -> float | None:
|
||||
"""Derive audio RTF from the raw timings reported by the client."""
|
||||
generation_ms = raw_metric.get("audio_generation_ms")
|
||||
duration_ms = raw_metric.get("audio_duration_ms")
|
||||
if not isinstance(generation_ms, int | float) or not isinstance(duration_ms, int | float) or duration_ms <= 0:
|
||||
return None
|
||||
return round(compute_audio_rtf(float(generation_ms) / 1000.0, float(duration_ms) / 1000.0), 6)
|
||||
|
||||
|
||||
def _video_frames_from_file(
|
||||
path: Path,
|
||||
*,
|
||||
@@ -156,7 +177,7 @@ def _resolve_video_frames(args: DemoArgs) -> tuple[list[str], list[str | None]]:
|
||||
@dataclass
|
||||
class DemoState:
|
||||
events: list[dict[str, object]] = field(default_factory=list)
|
||||
timing_events: RealtimeEventCollector = field(default_factory=RealtimeEventCollector)
|
||||
timing_events: EventCollector = field(default_factory=EventCollector)
|
||||
audio_deltas: list[bytes] = field(default_factory=list)
|
||||
response_audio_deltas: dict[str, list[bytes]] = field(default_factory=dict)
|
||||
response_ids: list[str] = field(default_factory=list)
|
||||
@@ -273,6 +294,11 @@ class DemoState:
|
||||
after_s=created_at_s,
|
||||
input_committed_at_s=input_committed_at_s,
|
||||
response_id=response_id,
|
||||
measurement_origin={
|
||||
"ttft": "input_audio_buffer.commit client send to first non-empty text delta",
|
||||
"ttfp": "input_audio_buffer.commit client send to first audio packet",
|
||||
"rtf": "commit-to-last-audio receive time divided by emitted audio duration",
|
||||
},
|
||||
)
|
||||
timing["measurement_origin"] = {
|
||||
"response": "response.created client receive",
|
||||
@@ -292,14 +318,14 @@ class DemoState:
|
||||
metrics = timing.get("request_metrics")
|
||||
if not isinstance(metrics, dict):
|
||||
continue
|
||||
requests.append(
|
||||
{
|
||||
"session_id": session_id,
|
||||
"request_index": request_index,
|
||||
"response_id": response_id,
|
||||
**metrics,
|
||||
}
|
||||
)
|
||||
request_metrics = {
|
||||
"session_id": session_id,
|
||||
"request_index": request_index,
|
||||
"response_id": response_id,
|
||||
**metrics,
|
||||
"rtf": _audio_rtf_from_raw_metric(metrics),
|
||||
}
|
||||
requests.append(request_metrics)
|
||||
return requests
|
||||
|
||||
def session_metric_summary(
|
||||
@@ -602,7 +628,7 @@ def _session_update_event(args: DemoArgs) -> dict[str, object]:
|
||||
"playback_commit_policy": "ack_only",
|
||||
"extra_body": {
|
||||
"auto_response": True,
|
||||
"minicpmo45_native_duplex": True,
|
||||
"native_duplex": True,
|
||||
"force_listen_count": 0,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
|
||||
"""Strict PersonaPlex validation for the unified OpenAI Realtime duplex path."""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -18,17 +18,72 @@ from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit
|
||||
|
||||
import numpy as np
|
||||
|
||||
from vllm_omni.experimental.fullduplex.client import (
|
||||
RealtimeDuplexClient,
|
||||
wait_for,
|
||||
try:
|
||||
import websockets
|
||||
from websockets.exceptions import ConnectionClosed
|
||||
except ImportError as exc: # pragma: no cover - driver dependency.
|
||||
raise SystemExit("Install websockets first: pip install websockets") from exc
|
||||
|
||||
from vllm_omni.clients.duplex import (
|
||||
EventCollector,
|
||||
write_pcm16_wav,
|
||||
)
|
||||
from vllm_omni.clients.duplex import (
|
||||
wait_for_condition as wait_for,
|
||||
)
|
||||
|
||||
SAMPLE_RATE_HZ = 24_000
|
||||
FRAME_SAMPLES = 1_920
|
||||
FRAME_PERIOD_S = FRAME_SAMPLES / SAMPLE_RATE_HZ
|
||||
|
||||
|
||||
class RawRealtimeProbe:
|
||||
"""Raw-event Realtime probe: one websocket plus an :class:`EventCollector`.
|
||||
|
||||
This driver speaks the wire protocol directly (it validates handshake
|
||||
errors such as admission limits, which the public
|
||||
:class:`vllm_omni.clients.duplex.DuplexClient` treats as failures), so it
|
||||
keeps a transport-only client and reads everything from ``.events``.
|
||||
"""
|
||||
|
||||
def __init__(self, url: str, *, max_size: int = 64 * 1024 * 1024) -> None:
|
||||
self.url = url
|
||||
self.max_size = max_size
|
||||
self.events = EventCollector()
|
||||
self._ws = None
|
||||
self._reader_task: asyncio.Task[None] | None = None
|
||||
|
||||
async def __aenter__(self) -> RawRealtimeProbe:
|
||||
self._ws = await websockets.connect(self.url, max_size=self.max_size)
|
||||
self._reader_task = asyncio.create_task(self._read_events())
|
||||
return self
|
||||
|
||||
async def __aexit__(self, exc_type, exc, traceback) -> None:
|
||||
if self._ws is not None:
|
||||
await self._ws.close()
|
||||
if self._reader_task is not None:
|
||||
self._reader_task.cancel()
|
||||
try:
|
||||
await self._reader_task
|
||||
except asyncio.CancelledError:
|
||||
pass
|
||||
|
||||
async def _read_events(self) -> None:
|
||||
try:
|
||||
while True:
|
||||
raw = await self._ws.recv()
|
||||
if not isinstance(raw, str):
|
||||
continue
|
||||
event = json.loads(raw)
|
||||
if isinstance(event, dict):
|
||||
self.events.add(event)
|
||||
except ConnectionClosed:
|
||||
return
|
||||
|
||||
async def send(self, event: dict[str, object]) -> None:
|
||||
await self._ws.send(json.dumps(event))
|
||||
|
||||
|
||||
def _input_identity(
|
||||
path: Path,
|
||||
*,
|
||||
@@ -83,7 +138,7 @@ def _read_wav_as_float32(path: Path) -> np.ndarray:
|
||||
return pcm
|
||||
|
||||
|
||||
def _events(client: RealtimeDuplexClient, event_type: str) -> list[dict[str, object]]:
|
||||
def _events(client: RawRealtimeProbe, event_type: str) -> list[dict[str, object]]:
|
||||
return [event for event in client.events.events if event.get("type") == event_type]
|
||||
|
||||
|
||||
@@ -93,8 +148,8 @@ async def _open_session(
|
||||
session_id: str,
|
||||
persona: str,
|
||||
expect_error: bool = False,
|
||||
) -> tuple[RealtimeDuplexClient, dict[str, object]]:
|
||||
client = RealtimeDuplexClient(_realtime_url(args.url, args.model, session_id))
|
||||
) -> tuple[RawRealtimeProbe, dict[str, object]]:
|
||||
client = RawRealtimeProbe(_realtime_url(args.url, args.model, session_id))
|
||||
await client.__aenter__()
|
||||
await client.send(
|
||||
{
|
||||
@@ -121,7 +176,7 @@ async def _open_session(
|
||||
return client, _events(client, event_type)[-1]
|
||||
|
||||
|
||||
async def _close_session(client: RealtimeDuplexClient, *, timeout_s: float) -> None:
|
||||
async def _close_session(client: RawRealtimeProbe, *, timeout_s: float) -> None:
|
||||
await client.send({"type": "session.close"})
|
||||
await wait_for(
|
||||
lambda: client.events.count("session.closed") > 0,
|
||||
@@ -132,7 +187,7 @@ async def _close_session(client: RealtimeDuplexClient, *, timeout_s: float) -> N
|
||||
|
||||
|
||||
async def _stream_frames(
|
||||
client: RealtimeDuplexClient,
|
||||
client: RawRealtimeProbe,
|
||||
pcm: np.ndarray,
|
||||
*,
|
||||
max_frames: int | None = None,
|
||||
@@ -186,7 +241,7 @@ def _audio_frame_stats(
|
||||
}
|
||||
|
||||
|
||||
def _response_ids(client: RealtimeDuplexClient) -> set[str]:
|
||||
def _response_ids(client: RawRealtimeProbe) -> set[str]:
|
||||
return {
|
||||
str(event["response_id"])
|
||||
for event in _events(client, "response.audio.delta")
|
||||
@@ -195,7 +250,7 @@ def _response_ids(client: RealtimeDuplexClient) -> set[str]:
|
||||
|
||||
|
||||
def _session_result(
|
||||
client: RealtimeDuplexClient,
|
||||
client: RawRealtimeProbe,
|
||||
*,
|
||||
input_frames: int,
|
||||
args: argparse.Namespace,
|
||||
@@ -268,7 +323,7 @@ def _capabilities(created: dict[str, object]) -> dict[str, object]:
|
||||
return capabilities
|
||||
|
||||
|
||||
def _save(output_dir: Path, name: str, client: RealtimeDuplexClient, raw: bytes) -> None:
|
||||
def _save(output_dir: Path, name: str, client: RawRealtimeProbe, raw: bytes) -> None:
|
||||
(output_dir / f"{name}-events.jsonl").write_text(
|
||||
"".join(json.dumps(event, ensure_ascii=False) + "\n" for event in client.events.events),
|
||||
encoding="utf-8",
|
||||
|
||||
@@ -228,7 +228,7 @@ async def _open_admission_session(
|
||||
"session_id": session_id,
|
||||
"model": args.model,
|
||||
"modalities": ["audio", "text"],
|
||||
"extra_body": {"minicpmo45_native_duplex": True},
|
||||
"extra_body": {"native_duplex": True},
|
||||
**({"ref_audio": _ref_audio_data_url(args.ref_audio)} if getattr(args, "ref_audio", None) else {}),
|
||||
},
|
||||
}
|
||||
@@ -271,7 +271,7 @@ async def _admission_probe(args: argparse.Namespace, *, limit: int) -> dict[str,
|
||||
"session_id": overflow_id,
|
||||
"model": args.model,
|
||||
"modalities": ["audio", "text"],
|
||||
"extra_body": {"minicpmo45_native_duplex": True},
|
||||
"extra_body": {"native_duplex": True},
|
||||
**(
|
||||
{"ref_audio": _ref_audio_data_url(args.ref_audio)}
|
||||
if getattr(args, "ref_audio", None)
|
||||
@@ -337,7 +337,7 @@ async def _resume_probe(
|
||||
"session_id": session_id,
|
||||
"model": args.model,
|
||||
"modalities": ["audio", "text"],
|
||||
"extra_body": {"minicpmo45_native_duplex": True},
|
||||
"extra_body": {"native_duplex": True},
|
||||
**(
|
||||
{"ref_audio": _ref_audio_data_url(args.ref_audio)}
|
||||
if getattr(args, "ref_audio", None)
|
||||
@@ -442,7 +442,7 @@ async def _takeover_probe(
|
||||
"session_id": session_id,
|
||||
"model": args.model,
|
||||
"modalities": ["audio", "text"],
|
||||
"extra_body": {"minicpmo45_native_duplex": True},
|
||||
"extra_body": {"native_duplex": True},
|
||||
**(
|
||||
{"ref_audio": _ref_audio_data_url(args.ref_audio)}
|
||||
if getattr(args, "ref_audio", None)
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
|
||||
"""Live E2E coverage for the public duplex client (``vllm_omni.clients.duplex``).
|
||||
|
||||
Drives a real MiniCPM-o 4.5 duplex session end to end through
|
||||
:class:`DuplexClient`: session handshake with reference audio, paced PCM
|
||||
streaming, a speak response consumed via :class:`ResponseHandle` with
|
||||
incremental playback acks, a forced transport drop recovered by automatic
|
||||
``session.resume``, and a clean close.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import uuid
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from tests.e2e.online_serving.helpers.minicpmo_4_5_duplex import (
|
||||
CORE_SERVER_PARAMS,
|
||||
realtime_url,
|
||||
resolve_ref_audio,
|
||||
validated_input_wav,
|
||||
)
|
||||
from tests.helpers.mark import hardware_test
|
||||
from vllm_omni.clients.duplex import (
|
||||
DuplexClient,
|
||||
EventCollector,
|
||||
ReconnectPolicy,
|
||||
audio_data_url,
|
||||
read_pcm16_wav,
|
||||
)
|
||||
from vllm_omni.clients.minicpmo_4_5 import create_duplex_session_config
|
||||
|
||||
pytestmark = pytest.mark.omni
|
||||
|
||||
_SESSION_TIMEOUT_S = 900.0
|
||||
_MAX_LISTEN_ROUNDS = 30
|
||||
|
||||
|
||||
async def _run_live_session(*, url: str, model: str, ref_audio: Path, input_wav: Path) -> dict[str, object]:
|
||||
# temperature 0.0 keeps the response-required reply short and
|
||||
# deterministic (same as the validated demo driver).
|
||||
config = create_duplex_session_config(ref_audio=audio_data_url(ref_audio), temperature=0.0)
|
||||
client = DuplexClient(
|
||||
url,
|
||||
model=model,
|
||||
config=config,
|
||||
session_id=f"duplex-client-live-{uuid.uuid4().hex}",
|
||||
reconnect=ReconnectPolicy(max_attempts=5, backoff_s=(0.25, 1.0)),
|
||||
# Short interval so the periodic heartbeat path runs during the
|
||||
# session — including across the forced transport drop below.
|
||||
heartbeat_interval_s=5.0,
|
||||
)
|
||||
collector = EventCollector()
|
||||
pcm = read_pcm16_wav(input_wav)
|
||||
summary: dict[str, object] = {}
|
||||
async with client:
|
||||
collector_task = asyncio.create_task(collector.consume(client))
|
||||
summary["session_id"] = client.session_id
|
||||
summary["resume_token_issued"] = client.resume_token is not None
|
||||
|
||||
# Phase 1: stream the validated utterance and consume one speak response.
|
||||
await client.stream_pcm(pcm, chunk_ms=200)
|
||||
await client.commit()
|
||||
listens = 0
|
||||
async for response in client.responses():
|
||||
if response.decision == "listen":
|
||||
listens += 1
|
||||
if listens > _MAX_LISTEN_ROUNDS:
|
||||
raise AssertionError(f"no speak response after {listens} listen decisions")
|
||||
continue
|
||||
chunk_count = 0
|
||||
audio_byte_count = 0
|
||||
async for chunk in response.audio():
|
||||
chunk_count += 1
|
||||
audio_byte_count += len(chunk)
|
||||
await client.ack_playback(response.played_ms)
|
||||
summary.update(
|
||||
{
|
||||
"decision": response.decision,
|
||||
"listen_rounds": listens,
|
||||
"audio_chunks": chunk_count,
|
||||
"audio_bytes": audio_byte_count,
|
||||
"played_ms": response.played_ms,
|
||||
"transcript": response.transcript,
|
||||
}
|
||||
)
|
||||
break
|
||||
|
||||
# Phase 2: force-drop the transport underneath the client and require
|
||||
# the automatic session.resume path to bring the session back.
|
||||
resumed_waiter = asyncio.create_task(client.wait_for("session.resumed", timeout_s=90.0))
|
||||
await asyncio.sleep(0.1) # let the waiter subscribe before the drop
|
||||
assert client._ws is not None
|
||||
await client._ws.close()
|
||||
resumed = await resumed_waiter
|
||||
summary["resumed_session_id"] = resumed.session_id or client.session_id
|
||||
|
||||
# The resumed transport must be live: a heartbeat gets acknowledged.
|
||||
ack_waiter = asyncio.create_task(client.wait_for("session.heartbeat_ack", timeout_s=30.0))
|
||||
await asyncio.sleep(0.1)
|
||||
await client.send({"type": "session.heartbeat"})
|
||||
await ack_waiter
|
||||
summary["post_resume_heartbeat_ok"] = True
|
||||
|
||||
await client.close()
|
||||
await asyncio.wait_for(collector_task, timeout=10.0)
|
||||
|
||||
summary["error_events"] = collector.errors()
|
||||
summary["closed_cleanly"] = collector.count("session.closed") > 0
|
||||
summary["timing"] = collector.timing_summary(after_s=0.0)
|
||||
return summary
|
||||
|
||||
|
||||
@pytest.mark.core_model
|
||||
@hardware_test(res={"cuda": "H100"}, num_cards=1)
|
||||
@pytest.mark.parametrize("omni_server", CORE_SERVER_PARAMS, indirect=True)
|
||||
def test_duplex_client_live_session(omni_server) -> None:
|
||||
summary = asyncio.run(
|
||||
asyncio.wait_for(
|
||||
_run_live_session(
|
||||
url=realtime_url(omni_server),
|
||||
model=omni_server.model,
|
||||
ref_audio=resolve_ref_audio(),
|
||||
input_wav=validated_input_wav(),
|
||||
),
|
||||
timeout=_SESSION_TIMEOUT_S,
|
||||
)
|
||||
)
|
||||
assert summary["decision"] == "speak", summary
|
||||
assert summary["audio_chunks"] > 0, summary
|
||||
assert summary["played_ms"] > 0, summary
|
||||
assert summary["transcript"], summary
|
||||
assert summary["resume_token_issued"] is True, summary
|
||||
assert summary["post_resume_heartbeat_ok"] is True, summary
|
||||
assert summary["closed_cleanly"] is True, summary
|
||||
assert summary["error_events"] == [], summary
|
||||
@@ -30,7 +30,7 @@ from tests.e2e.online_serving.run_minicpmo_realtime_duplex_multi_session import
|
||||
run_multi_session,
|
||||
)
|
||||
from tests.helpers.mark import hardware_test
|
||||
from vllm_omni.experimental.fullduplex.client import build_realtime_url
|
||||
from vllm_omni.clients.duplex import build_realtime_url
|
||||
from vllm_omni.experimental.fullduplex.video_stacking import concat_frames_b64
|
||||
|
||||
pytestmark = pytest.mark.omni
|
||||
@@ -88,7 +88,13 @@ async def _receive_protocol_events(ws, required_types: set[str], *, timeout_s: f
|
||||
|
||||
async def _run_protocol_smoke(*, url: str, model: str, ref_audio: Path) -> list[dict[str, object]]:
|
||||
session_id = f"duplex-ci-protocol-{uuid.uuid4().hex}"
|
||||
websocket_url = build_realtime_url(url, model, autostart=False, session_id=session_id)
|
||||
websocket_url = build_realtime_url(
|
||||
url,
|
||||
model,
|
||||
autostart=False,
|
||||
session_id=session_id,
|
||||
extra_query={"native_duplex": "1"},
|
||||
)
|
||||
async with websockets.connect(websocket_url, max_size=64 * 1024 * 1024) as ws:
|
||||
await ws.send(
|
||||
json.dumps(
|
||||
@@ -99,7 +105,7 @@ async def _run_protocol_smoke(*, url: str, model: str, ref_audio: Path) -> list[
|
||||
"model": model,
|
||||
"modalities": ["audio", "text"],
|
||||
"ref_audio": _ref_audio_data_url(str(ref_audio)),
|
||||
"extra_body": {"minicpmo45_native_duplex": True},
|
||||
"extra_body": {"native_duplex": True},
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
@@ -1001,7 +1001,7 @@ def test_realtime_duplex_demo_explicitly_enables_native_runtime_before_connect()
|
||||
)
|
||||
|
||||
query = parse_qs(urlsplit(url).query)
|
||||
assert query["minicpmo45_native_duplex"] == ["1"]
|
||||
assert query["native_duplex"] == ["1"]
|
||||
|
||||
|
||||
def test_realtime_duplex_demo_explicit_session_id_reaches_autostart_query():
|
||||
@@ -1032,7 +1032,7 @@ def test_realtime_duplex_demo_session_update_uses_explicit_session_id():
|
||||
assert event["type"] == "session.update"
|
||||
assert "session_id" not in event
|
||||
assert event["session"]["session_id"] == "reopen-e2e"
|
||||
assert event["session"]["extra_body"]["minicpmo45_native_duplex"] is True
|
||||
assert event["session"]["extra_body"]["native_duplex"] is True
|
||||
|
||||
|
||||
def test_realtime_duplex_demo_response_required_uses_deterministic_sampling():
|
||||
|
||||
Reference in new issue
Block a user