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.0-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for getstream_plugins_deepgram-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 44a1741507bcebd2915c38317e39bffb77ffdcc76dfcaf3b4fee72351b2daf42
MD5 8b91eb24f98a28b6a4e20b0d3ce11fd1
BLAKE2b-256 47031f572f23341beb3f1c19b21b50347bcb5e44e21c582fa147a76c3f3b1960

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