[实时字幕端点]:完成无新文字快速结束录音,包含1.5秒停滞配置、Capture端点和回归测试
This commit is contained in:
@@ -17,6 +17,7 @@ class AppConfig:
|
||||
llm_api_style: str = "chat_completions"
|
||||
llm_stream: bool = True
|
||||
realtime_transcript_enabled: bool = True
|
||||
realtime_transcript_idle_timeout_ms: int = 1500
|
||||
audio_input_device: str | None = None
|
||||
audio_output_device: str | None = None
|
||||
asset_dir: Path = Path("assets/pet")
|
||||
@@ -71,6 +72,9 @@ class AppConfig:
|
||||
llm_stream=(get("LLM_STREAM", "1") or "1").lower() not in {"0", "false", "no"},
|
||||
realtime_transcript_enabled=(get("REALTIME_TRANSCRIPT_ENABLED", "1") or "1").lower()
|
||||
not in {"0", "false", "no"},
|
||||
realtime_transcript_idle_timeout_ms=int(
|
||||
get("REALTIME_TRANSCRIPT_IDLE_TIMEOUT_MS", "1500") or "1500"
|
||||
),
|
||||
audio_input_device=get("AUDIO_INPUT_DEVICE"),
|
||||
audio_output_device=get("AUDIO_OUTPUT_DEVICE"),
|
||||
asset_dir=Path(get("ASSET_DIR", "assets/pet") or "assets/pet"),
|
||||
@@ -165,6 +169,16 @@ class AppConfig:
|
||||
"startup",
|
||||
)
|
||||
)
|
||||
if self.realtime_transcript_idle_timeout_ms < 0:
|
||||
errors.append(
|
||||
ProviderError(
|
||||
ErrorCode.CONFIG_MISSING_VALUE,
|
||||
"OWNER_REALTIME_TRANSCRIPT_IDLE_TIMEOUT_MS must be non-negative",
|
||||
False,
|
||||
"config",
|
||||
"startup",
|
||||
)
|
||||
)
|
||||
if self.wake_provider not in {"local_kws"}:
|
||||
errors.append(
|
||||
ProviderError(
|
||||
|
||||
Reference in New Issue
Block a user