feat: add Assembly AI STT

This commit is contained in:
Abhishek Kumar 2026-04-03 07:10:37 +05:30
parent 66b085dde2
commit 501d06c00d
7 changed files with 94 additions and 8 deletions

View file

@ -5,6 +5,7 @@ from loguru import logger
from api.constants import MPS_API_URL
from api.services.configuration.registry import ServiceProviders
from pipecat.services.assemblyai.stt import AssemblyAISTTService, AssemblyAISTTSettings
from pipecat.services.aws.llm import AWSBedrockLLMService, AWSBedrockLLMSettings
from pipecat.services.azure.llm import AzureLLMService, AzureLLMSettings
from pipecat.services.cartesia.stt import CartesiaSTTService
@ -156,6 +157,17 @@ def create_stt_service(
),
sample_rate=audio_config.transport_in_sample_rate,
)
elif user_config.stt.provider == ServiceProviders.ASSEMBLYAI.value:
language = getattr(user_config.stt, "language", None)
pipecat_language = _to_language_enum(language, default=Language.EN)
settings_kwargs = {"model": user_config.stt.model, "language": pipecat_language}
if keyterms:
settings_kwargs["keyterms_prompt"] = keyterms
return AssemblyAISTTService(
api_key=user_config.stt.api_key,
settings=AssemblyAISTTSettings(**settings_kwargs),
sample_rate=audio_config.transport_in_sample_rate,
)
elif user_config.stt.provider == ServiceProviders.SPEECHMATICS.value:
from pipecat.services.speechmatics.stt import (
AdditionalVocabEntry,