CommitStrategy (elevenlabs/stt.py)

dograh-hq/pipecat · src/pipecat/services/elevenlabs/stt.py · python · BSD-2-Clause
voice

Integrates ElevenLabs speech-to-text services to enable real-time or segmented audio transcription within a processing pipeline.

# Source: https://github.com/dograh-hq/pipecat | License: BSD-2-Clause | Copyright 2024–2026, Daily
# Provided via justclaw.it.com; keep this notice with the code.
#
# Copyright (c) 2024-2026, Daily
#
# SPDX-License-Identifier: BSD 2-Clause License
#

"""ElevenLabs speech-to-text service implementation.

This module provides integration with ElevenLabs' Speech-to-Text API for transcription
using segmented audio processing. The service uploads audio files and receives
transcription results directly.
"""

import base64
import io
import json
from collections.abc import AsyncGenerator
from dataclasses import dataclass, field
from enum import StrEnum
from typing import Any
from urllib.parse import urlencode

import aiohttp
from loguru import logger
from pydantic import BaseModel
from websockets

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

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

Get a free API key