From 951255def90e4c2fcf207e141e4bbed77d7fff5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Mon, 21 Oct 2024 20:41:39 -0700 Subject: [PATCH] transport(daily): use "nova-2-general" for transcription --- CHANGELOG.md | 4 ++++ pyproject.toml | 2 +- src/pipecat/transports/services/daily.py | 15 ++++++++++++--- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 647e41025..bf9ec4839 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated `GladiaSTTService` to use the V2 API. +- Changed `DailyTransport` transcription model to `nova-2-general`. + ### Fixed - Fixed `enable_usage_metrics` to control LLM/TTS usage metrics separately @@ -36,6 +38,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Changed `DeepgramSTTService` model to `nova-2-general`. + - Moved `SileroVAD` audio processor to `processors.audio.vad`. - Module `utils.audio` is now `audio.utils`. A new `resample_audio` function has diff --git a/pyproject.toml b/pyproject.toml index d4ee2edd4..10d790a51 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,9 +21,9 @@ classifiers = [ ] dependencies = [ "aiohttp~=3.10.3", + "loguru~=0.7.2", "Markdown~=3.7", "numpy~=1.26.4", - "loguru~=0.7.2", "Pillow~=10.4.0", "protobuf~=4.25.4", "pydantic~=2.8.2", diff --git a/src/pipecat/transports/services/daily.py b/src/pipecat/transports/services/daily.py index 243db7603..8c9095c65 100644 --- a/src/pipecat/transports/services/daily.py +++ b/src/pipecat/transports/services/daily.py @@ -6,6 +6,7 @@ import asyncio import time +import warnings from concurrent.futures import ThreadPoolExecutor from dataclasses import dataclass from typing import Any, Awaitable, Callable, Mapping, Optional @@ -20,7 +21,7 @@ VirtualSpeakerDevice, ) from loguru import logger -from pydantic.main import BaseModel +from pydantic import BaseModel, model_validator from pipecat.audio.vad.vad_analyzer import VADAnalyzer, VADParams from pipecat.frames.frames import ( @@ -93,8 +94,8 @@ class DailyDialinSettings(BaseModel): class DailyTranscriptionSettings(BaseModel): language: str = "en" - tier: str = "nova" - model: str = "2-conversationalai" + tier: Optional[str] = None + model: str = "nova-2-general" profanity_filter: bool = True redact: bool = False endpointing: bool = True @@ -102,6 +103,14 @@ class DailyTranscriptionSettings(BaseModel): includeRawResponse: bool = True extra: Mapping[str, Any] = {"interim_results": True} + @model_validator(mode="before") + def check_deprecated_fields(cls, values): + with warnings.catch_warnings(): + warnings.simplefilter("always") + if "tier" in values: + warnings.warn("'tier' is deprecated, use 'model' instead", DeprecationWarning) + return values + class DailyParams(TransportParams): api_url: str = "https://api.daily.co/v1"