Skip to main content

Deepgram plugin for GetStream

Project description

Deepgram Speech-to-Text Plugin

A high-quality Speech-to-Text (STT) plugin for GetStream that uses the Deepgram API.

Installation

pip install getstream-plugins-deepgram

Usage

from getstream.plugins.deepgram import DeepgramSTT

# Initialize with API key from environment variable
stt = DeepgramSTT()

# Or specify API key directly
stt = DeepgramSTT(api_key="your_deepgram_api_key")

# Register event handlers
@stt.on("transcript")
def on_transcript(text, user, metadata):
    print(f"Final transcript from {user}: {text}")

@stt.on("partial_transcript")
def on_partial(text, user, metadata):
    print(f"Partial transcript from {user}: {text}")

# Process audio
await stt.process_audio(pcm_data)

# When done
await stt.close()

Configuration Options

  • api_key: Deepgram API key (default: reads from DEEPGRAM_API_KEY environment variable)
  • options: Deepgram LiveOptions for configuring the transcription
  • sample_rate: Sample rate of the audio in Hz (default: 16000)
  • language: Language code for transcription (default: "en-US")
  • keep_alive_interval: Interval in seconds to send keep-alive messages (default: 5.0)

Requirements

  • Python 3.10+
  • deepgram-sdk>=4.5.0
  • numpy>=2.2.6,<2.3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

getstream_plugins_deepgram-0.1.1-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file getstream_plugins_deepgram-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for getstream_plugins_deepgram-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5ed7a9a283fc5a897108a8ca6bb4e1b3289b12ef64aa1dff8520ca45d023cd18
MD5 296caa1ad5fa7999562319f293e3414c
BLAKE2b-256 d96d595a7870c092a30f8df56c7e09d4e6aca6f4f3ed5ffc453cc2281ed1100f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page