BaseWhisperSTTService (whisper/base_stt.py)

ai-cold-calling-bot · src/pipecat/services/whisper/base_stt.py · python · BSD-2-Clause
voice, Voice / Speech

Copyright (c) 2025, Daily SPDX-License-Identifier: BSD 2-Clause License

# Source: https://github.com/cmwaseemyousef/ai-cold-calling-bot | License: BSD-2-Clause | Copyright 2024–2025, Daily
# Provided via justclaw.it.com; keep this notice with the code.
#
# Copyright (c) 2025, Daily
#
# SPDX-License-Identifier: BSD 2-Clause License
#

"""Base class for Whisper-based speech-to-text services.

This module provides common functionality for services implementing the Whisper API
interface, including language mapping, metrics generation, and error handling.
"""

from typing import AsyncGenerator, Optional

from loguru import logger
from openai import AsyncOpenAI
from openai.types.audio import Transcription

from pipecat.frames.frames import ErrorFrame, Frame, TranscriptionFrame
from pipecat.services.stt_service import SegmentedSTTService
from pipecat.transcriptions.l

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key