mirror of
https://github.com/livekit/agents.git
synced 2026-12-06 04:38:33 +00:00
Migrate provider WebSocket handling to shared typed protocols, pooling, pacing, and idle timers. Preserve SmallestAI continuations with response-based silence completion and isolated segments. Keep connection acquisition, reconnect controls, stream cleanup, and host wrapper ownership safe across cancellation. Consolidate provider interfaces and typed MCP contracts. Normalize pending speech boundaries and preserve conversation identity, ordering, late results, and acknowledged checkpoints across overlapping voice runs. Extend deterministic regressions, storage observations, and lifecycle documentation. Validation: rebuilt extension; 2900 Python tests passed; formatting, lint, and type checks passed. Rust, binding, codegen, and deterministic simulation checks are recorded in the audit and lifecycle verification records.
25 lines
586 B
Python
25 lines
586 B
Python
from typing import Literal
|
|
|
|
TTSModels = Literal["mistv2", "mistv3", "coda"]
|
|
|
|
MODEL_CODA = "coda"
|
|
MODEL_MIST_V2 = "mistv2"
|
|
MODEL_MIST_V3 = "mistv3"
|
|
|
|
DefaultMistVoice = "cove"
|
|
DefaultCodaVoice = "lyra"
|
|
|
|
# the WebSocket v1 endpoint of each model that streams; mistv2 synthesizes over HTTP only
|
|
WEBSOCKET_URLS: dict[str, str] = {
|
|
MODEL_CODA: "wss://coda.api.rime.ai/ws",
|
|
MODEL_MIST_V3: "wss://mist.api.rime.ai/ws",
|
|
}
|
|
|
|
|
|
def is_mist_model(model: str) -> bool:
|
|
return model.startswith("mist")
|
|
|
|
|
|
def supports_time_scale_factor(model: str) -> bool:
|
|
return model != MODEL_MIST_V2
|