Add set_model to AssemblySTTService

This commit is contained in:
Mark Backman
2025-03-07 15:18:10 -05:00
parent 3caccab608
commit 615cbe966a
2 changed files with 13 additions and 2 deletions

View File

@@ -11,7 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added a `flush_audio()` method to `AzureTTSService` and `FishTTSService`.
- Added `set_language()` and `set_model()` to `AzureSTTService`.
- Added `set_language()` and `set_model()` to `AzureSTTService` and
`AssemblySTTService`.
- Added `on_user_turn_audio_data` and `on_bot_turn_audio_data` to
`AudioBufferProcessor`. This gives the ability to grab the audio of only that

View File

@@ -57,6 +57,17 @@ class AssemblyAISTTService(STTService):
logger.info(f"Switching STT language to: [{language}]")
self._settings["language"] = language
async def set_model(self, model: str):
"""Set the speech recognition model name for metrics.
Args:
model: Model name for metrics tracking
"""
self.set_model_name(model)
logger.info(
f"Set model name to '{model}' for metrics (AssemblyAI real-time API doesn't support model selection)"
)
async def start(self, frame: StartFrame):
await super().start(frame)
await self._connect()
@@ -90,7 +101,6 @@ class AssemblyAISTTService(STTService):
This method sets up the necessary callback functions and initializes the
AssemblyAI transcriber.
"""
if self._transcriber:
return