Deepgram

From startups to NASA, Deepgram APIs are used to transcribe (transcript) and understand millions of audio minutes each day. Fast, accurate, scalable, and cost-effective.... ASR (Automatic Speech Recognition) sucks and it costs too much. So we rebuilt it. We believe we can fundamentally change the way we live and work by unlocking insights trapped in our conversations. We are working to make voice intelligence available to all with faster, more accurate, more scalable speech recognition made possible by end-to-end deep learning. https://deepgram.com/

Python

Dec20'2023

cannot import name 'DeepgramClientOptions' from 'deepgram' (/Users/billseitz/Documents/code/py3/other/deepgram/env/lib/python3.8/site-packages/deepgram/__init__.py)
  • looks like big chunks of the sdk weren't actually installed
  • noticing warning from when I installed sdk
  Installing build dependencies ... done
  WARNING: Missing build requirements in pyproject.toml for multidict<7.0,>=4.5 from https://files.pythonhosted.org/packages/4a/15/bd620f7a6eb9aa5112c4ef93e7031bcd071e0611763d8e17706ef8ba65e0/multidict-6.0.4.tar.gz#sha256=3666906492efb76453c0e7b97f2cf459b0682e7402c0489a95484965dbc1da49 (from aiohttp->deepgram-sdk).
  WARNING: The project does not specify a build backend, and pip cannot fall back to setuptools without 'wheel'.
  • looks like I need to git clone https://github.com/deepgram/deepgram-python-sdk.git
  • then do again
pip install deepgram-python-sdk
Collecting deepgram-python-sdk
  ERROR: Could not find a version that satisfies the requirement deepgram-python-sdk (from versions: none)
ERROR: No matching distribution found for deepgram-python-sdk
  • ah
cd deepgram-python-sdk
pip install -e .
  • no complaints now, so....
python3 main.py                
Traceback (most recent call last):
  File "main.py", line 9, in <module>
    from deepgram import (
  File "/Users/billseitz/Documents/code/py3/other/deepgram/deepgram-python-sdk/deepgram/__init__.py", line 9, in <module>
    from .client import DeepgramClient
  File "/Users/billseitz/Documents/code/py3/other/deepgram/deepgram-python-sdk/deepgram/client.py", line 125
    match self.parent:
          ^
SyntaxError: invalid syntax
  • tweeted

Dec22

  • no response to tweet, so post
    • ah, it wasn't just me
    • they just released new sdk version see install notes
  • so
pip install deepgram-sdk
Requirement already satisfied: deepgram-sdk in ./deepgram-python-sdk (0.0.0)
(and lots of others, no complaints
  • python3 main.py -> same invalid syntax issue as above
  • search deepgram folder for client.py see various dupes, decide to nuke it all
  • rename deepgram folder, make new deepgram folder,
cd deepgram
python3 -m venv .venv
source .venv/bin/activate
pip install deepgram-sdk
  • get 1 warning, rest seem ok
  Using cached https://files.pythonhosted.org/packages/4a/15/bd620f7a6eb9aa5112c4ef93e7031bcd071e0611763d8e17706ef8ba65e0/multidict-6.0.4.tar.gz
  Installing build dependencies ... done
  WARNING: Missing build requirements in pyproject.toml for multidict<7.0,>=4.5 from https://files.pythonhosted.org/packages/4a/15/bd620f7a6eb9aa5112c4ef93e7031bcd071e0611763d8e17706ef8ba65e0/multidict-6.0.4.tar.gz#sha256=3666906492efb76453c0e7b97f2cf459b0682e7402c0489a95484965dbc1da49 (from aiohttp->deepgram-sdk).
  WARNING: The project does not specify a build backend, and pip cannot fall back to setuptools without 'wheel'.
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
    Preparing wheel metadata ... done
Collecting async-timeout<5.0,>=4.0; python_version < "3.11" (from aiohttp->deepgram-sdk)
  • export DEEPGRAM_API_KEY="xx"
  • then
python3 main.py Traceback (most recent call last):
  File "main.py", line 9, in <module>
    from deepgram import (
  File "/Users/billseitz/Documents/code/py3/other/deepgram/.venv/lib/python3.8/site-packages/deepgram/__init__.py", line 9, in <module>
    from .client import DeepgramClient
  File "/Users/billseitz/Documents/code/py3/other/deepgram/.venv/lib/python3.8/site-packages/deepgram/client.py", line 125
    match self.parent:
          ^
SyntaxError: invalid syntax
  • try their Discord support.
  • then don't follow their use of .venv directory this time, use python3 -m venv venv (consistent with my other directories) then source venv/bin/activate
  • but realize everything inside that venv is still using Python 3.8 instead of 3.12. jfc
  • even tried repeating with python3 -m pip install deepgram-sdk but that didn't help
  • do I uninstall 3.8? What will that break?

Edited:    |       |    Search Twitter for discussion