Updated default models for OpenAISTTService and OpenAITTSService to gpt-4o based models

This commit is contained in:
Mark Backman
2025-03-20 11:48:06 -04:00
committed by Paul Kompfner
parent f0774268cc
commit 70dbf0d6fc
2 changed files with 11 additions and 6 deletions

View File

@@ -169,6 +169,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Updated `OpenAISTTService` to use `gpt-4o-transcribe` as the default
transcription model.
- Updated `OpenAITTSService` to use `gpt-4o-mini-tts` as the default TTS model.
- Updated the default model for `CartesiaTTSService` and
`CartesiaHttpTTSService` to `sonic-2`.

View File

@@ -409,13 +409,13 @@ class OpenAIImageGenService(ImageGenService):
class OpenAISTTService(BaseWhisperSTTService):
"""OpenAI Whisper speech-to-text service.
"""OpenAI Speech-to-Text service that generates text from audio.
Uses OpenAI's Whisper API to convert audio to text. Requires an OpenAI API key
Uses OpenAI's transcription API to convert audio to text. Requires an OpenAI API key
set via the api_key parameter or OPENAI_API_KEY environment variable.
Args:
model: Whisper model to use. Defaults to "whisper-1".
model: Model to use — either gpt-4o or Whisper. Defaults to "gpt-4o-transcribe".
api_key: OpenAI API key. Defaults to None.
base_url: API base URL. Defaults to None.
language: Language of the audio input. Defaults to English.
@@ -427,7 +427,7 @@ class OpenAISTTService(BaseWhisperSTTService):
def __init__(
self,
*,
model: str = "whisper-1",
model: str = "gpt-4o-transcribe",
api_key: Optional[str] = None,
base_url: Optional[str] = None,
language: Optional[Language] = Language.EN,
@@ -472,7 +472,7 @@ class OpenAITTSService(TTSService):
Args:
api_key: OpenAI API key. Defaults to None.
voice: Voice ID to use. Defaults to "alloy".
model: TTS model to use. Defaults to "tts-1".
model: TTS model to use. Defaults to "gpt-4o-mini-tts".
sample_rate: Output audio sample rate in Hz. Defaults to None.
**kwargs: Additional keyword arguments passed to TTSService.
@@ -487,7 +487,7 @@ class OpenAITTSService(TTSService):
*,
api_key: Optional[str] = None,
voice: str = "alloy",
model: str = "tts-1",
model: str = "gpt-4o-mini-tts",
sample_rate: Optional[int] = None,
**kwargs,
):