Updated default models for OpenAISTTService and OpenAITTSService to gpt-4o based models
This commit is contained in:
committed by
Paul Kompfner
parent
f0774268cc
commit
70dbf0d6fc
@@ -169,6 +169,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
### Changed
|
### 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
|
- Updated the default model for `CartesiaTTSService` and
|
||||||
`CartesiaHttpTTSService` to `sonic-2`.
|
`CartesiaHttpTTSService` to `sonic-2`.
|
||||||
|
|
||||||
|
|||||||
@@ -409,13 +409,13 @@ class OpenAIImageGenService(ImageGenService):
|
|||||||
|
|
||||||
|
|
||||||
class OpenAISTTService(BaseWhisperSTTService):
|
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.
|
set via the api_key parameter or OPENAI_API_KEY environment variable.
|
||||||
|
|
||||||
Args:
|
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.
|
api_key: OpenAI API key. Defaults to None.
|
||||||
base_url: API base URL. Defaults to None.
|
base_url: API base URL. Defaults to None.
|
||||||
language: Language of the audio input. Defaults to English.
|
language: Language of the audio input. Defaults to English.
|
||||||
@@ -427,7 +427,7 @@ class OpenAISTTService(BaseWhisperSTTService):
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
model: str = "whisper-1",
|
model: str = "gpt-4o-transcribe",
|
||||||
api_key: Optional[str] = None,
|
api_key: Optional[str] = None,
|
||||||
base_url: Optional[str] = None,
|
base_url: Optional[str] = None,
|
||||||
language: Optional[Language] = Language.EN,
|
language: Optional[Language] = Language.EN,
|
||||||
@@ -472,7 +472,7 @@ class OpenAITTSService(TTSService):
|
|||||||
Args:
|
Args:
|
||||||
api_key: OpenAI API key. Defaults to None.
|
api_key: OpenAI API key. Defaults to None.
|
||||||
voice: Voice ID to use. Defaults to "alloy".
|
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.
|
sample_rate: Output audio sample rate in Hz. Defaults to None.
|
||||||
**kwargs: Additional keyword arguments passed to TTSService.
|
**kwargs: Additional keyword arguments passed to TTSService.
|
||||||
|
|
||||||
@@ -487,7 +487,7 @@ class OpenAITTSService(TTSService):
|
|||||||
*,
|
*,
|
||||||
api_key: Optional[str] = None,
|
api_key: Optional[str] = None,
|
||||||
voice: str = "alloy",
|
voice: str = "alloy",
|
||||||
model: str = "tts-1",
|
model: str = "gpt-4o-mini-tts",
|
||||||
sample_rate: Optional[int] = None,
|
sample_rate: Optional[int] = None,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
):
|
):
|
||||||
|
|||||||
Reference in New Issue
Block a user