diff --git a/changelog/4340.added.md b/changelog/4340.added.md new file mode 100644 index 000000000..5abcc0f0e --- /dev/null +++ b/changelog/4340.added.md @@ -0,0 +1 @@ +- Added `XAISTTService` for real-time speech-to-text using xAI's voice STT WebSocket API (`wss://api.x.ai/v1/stt`). Streams raw audio (PCM, ยต-law, or A-law) and emits interim and final transcription frames driven by the server's `is_final` / `speech_final` flags. Settings expose `interim_results`, `endpointing`, `language`, `multichannel`, `channels`, and `diarize`. Requires the `xai` optional extra (`pip install "pipecat-ai[xai]"`). diff --git a/examples/transcription/transcription-xai.py b/examples/transcription/transcription-xai.py index f94dc045c..0cc667f9a 100644 --- a/examples/transcription/transcription-xai.py +++ b/examples/transcription/transcription-xai.py @@ -9,12 +9,10 @@ import os from dotenv import load_dotenv from loguru import logger -from pipecat.audio.vad.silero import SileroVADAnalyzer from pipecat.frames.frames import Frame, TranscriptionFrame from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineTask -from pipecat.processors.audio.vad_processor import VADProcessor from pipecat.processors.frame_processor import FrameDirection, FrameProcessor from pipecat.runner.types import RunnerArguments from pipecat.runner.utils import create_transport @@ -58,9 +56,8 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): ) tl = TranscriptionLogger() - vad_processor = VADProcessor(vad_analyzer=SileroVADAnalyzer()) - pipeline = Pipeline([transport.input(), vad_processor, stt, tl]) + pipeline = Pipeline([transport.input(), stt, tl]) task = PipelineTask( pipeline, diff --git a/src/pipecat/services/xai/stt.py b/src/pipecat/services/xai/stt.py index 9d5a5e176..df8406fc2 100644 --- a/src/pipecat/services/xai/stt.py +++ b/src/pipecat/services/xai/stt.py @@ -321,7 +321,6 @@ class XAISTTService(WebsocketSTTService): async def _handle_message(self, message: dict[str, Any]): """Branch on xAI STT event type.""" msg_type = message.get("type") - print(f"xAI STT message: {message}") if msg_type == "transcript.created": self._session_ready.set()