transport(daily): use "nova-2-general" for transcription

This commit is contained in:
Aleix Conchillo Flaqué
2024-10-21 20:41:39 -07:00
parent e556f34094
commit 951255def9
3 changed files with 17 additions and 4 deletions

View File

@@ -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 @@ from daily import (
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"