From fd7dd2e976e7e04ab1fe6753ff4e36a12516bbbc Mon Sep 17 00:00:00 2001 From: John Vajda Date: Wed, 21 May 2025 09:06:38 -0600 Subject: [PATCH 1/9] initial improvements --- README.md | 450 +++++++++++------- .../rest/{ => sync}/file/main.py | 0 .../rest/{ => sync}/file/preamble.wav | Bin examples/speech-to-text/rest/sync/url/main.py | 64 +++ 4 files changed, 345 insertions(+), 169 deletions(-) rename examples/speech-to-text/rest/{ => sync}/file/main.py (100%) rename examples/speech-to-text/rest/{ => sync}/file/preamble.wav (100%) create mode 100644 examples/speech-to-text/rest/sync/url/main.py diff --git a/README.md b/README.md index 33594618..1063bba6 100644 --- a/README.md +++ b/README.md @@ -5,16 +5,57 @@ Official Python SDK for [Deepgram](https://www.deepgram.com/). Power your apps with world-class speech and Language AI models. -- [Deepgram Python SDK](#deepgram-python-sdk) -- [Documentation](#documentation) -- [Getting an API Key](#getting-an-api-key) -- [Requirements](#requirements) -- [Installation](#installation) -- [Quickstarts](#quickstarts) - - [PreRecorded Audio Transcription Quickstart](#prerecorded-audio-transcription-quickstart) - - [Live Audio Transcription Quickstart](#live-audio-transcription-quickstart) - - [Self-Hosted](#self-hosted) -- [Examples](#examples) +- [Transcription (Synchronous)](#transcription-synchronous) + - [Remote Files](#remote-files) + - [Local Files](#local-files) +- [Transcription (Asynchronous / Callbacks)](#transcription-asynchronous--callbacks) + - [Remote Files](#remote-files-1) + - [Local Files](#local-files-1) +- [Transcription (Live / Streaming)](#transcription-live--streaming) + - [Live Audio](#live-audio) +- [Transcribing to Captions](#transcribing-to-captions) +- [Voice Agent](#voice-agent) +- [Text to Speech](#text-to-speech) +- [Text Intelligence](#text-intelligence) +- [Authentication](#authentication) + - [Get Token Details](#get-token-details) +- [Projects](#projects) + - [Get Projects](#get-projects) + - [Get Project](#get-project) + - [Update Project](#update-project) + - [Delete Project](#delete-project) +- [Keys](#keys) + - [List Keys](#list-keys) + - [Get Key](#get-key) + - [Create Key](#create-key) + - [Delete Key](#delete-key) +- [Members](#members) + - [Get Members](#get-members) + - [Remove Member](#remove-member) +- [Scopes](#scopes) + - [Get Member Scopes](#get-member-scopes) + - [Update Scope](#update-scope) +- [Invitations](#invitations) + - [List Invites](#list-invites) + - [Send Invite](#send-invite) + - [Delete Invite](#delete-invite) + - [Leave Project](#leave-project) +- [Usage](#usage) + - [Get All Requests](#get-all-requests) + - [Get Request](#get-request) + - [Summarize Usage](#summarize-usage) + - [Get Fields](#get-fields) +- [Billing](#billing) + - [Get All Balances](#get-all-balances) + - [Get Balance](#get-balance) +- [Models](#models) + - [Get All Models](#get-all-models) + - [Get Model](#get-model) +- [On-Prem APIs](#on-prem-apis) + - [List On-Prem credentials](#list-on-prem-credentials) + - [Get On-Prem credentials](#get-on-prem-credentials) + - [Create On-Prem credentials](#create-on-prem-credentials) + - [Delete On-Prem credentials](#delete-on-prem-credentials) - [Logging](#logging) - [Backwards Compatibility](#backwards-compatibility) - [Development and Contributing](#development-and-contributing) @@ -34,196 +75,265 @@ You can learn more about the Deepgram API at [developers.deepgram.com](https://d ## Installation -To install the latest version available (which will guarantee change over time): +To install the latest version available: ```sh pip install deepgram-sdk ``` -If you are going to write an application to consume this SDK, it's [highly recommended](https://discuss.python.org/t/how-to-pin-a-package-to-a-specific-major-version-or-lower/17077) and a [programming staple](https://www.easypost.com/dependency-pinning-guide) to pin to at **least** a major version of an SDK (ie `==2.*`) or **with due diligence**, to a minor and/or specific version (ie `==2.1.*` or `==2.12.0`, respectively). If you are unfamiliar with [semantic versioning or semver](https://semver.org/), it's a must-read. +## Transcription (Synchronous) +### Remote Files -In a `requirements.txt` file, pinning to a major (or minor) version, like if you want to stick to using the SDK `v2.12.0` release, that can be done like this: +``` python +from deepgram import DeepgramClient, PrerecordedOptions -```sh -deepgram-sdk==2.* +response = DeepgramClient().listen.rest.v("1").transcribe_url( + source={"url": "https://dpgr.am/spacewalk.wav"}, + options=PrerecordedOptions(model="nova-3") +) ``` -Or using pip: +[See our API reference for more info](https://developers.deepgram.com/reference/speech-to-text-api/listen). -```sh -pip install deepgram-sdk==2.* +[See the Example for more info](./examples/speech-to-text/rest/sync/url/main.py). + +### Local Files + +``` python +@TODO ``` -Pinning to a specific version can be done like this in a `requirements.txt` file: +[See our API reference for more info](https://developers.deepgram.com/reference/speech-to-text-api/listen). -```sh -deepgram-sdk==2.12.0 +[See the Example for more info](./examples/speech-to-text/rest/file/main.py). + +## Transcription (Asynchronous / Callbacks) +### Remote Files + +``` python +@TODO ``` -Or using pip: +[See our API reference for more info](https://developers.deepgram.com/reference/speech-to-text-api/listen). -```sh -pip install deepgram-sdk==2.12.0 +[See the Example for more info](./examples/speech-to-text/rest/async_file/main.py). + +### Local Files + +``` python +@TODO +``` + +[See our API reference for more info](https://developers.deepgram.com/reference/speech-to-text-api/listen). + +## Transcription (Live / Streaming) +### Live Audio + +``` python +@TODO ``` -We guarantee that major interfaces will not break in a given major semver (ie `2.*` release). However, all bets are off moving from a `2.*` to `3.*` major release. This follows standard semver best-practices. +[See our API reference for more info](). -## Quickstarts +[See the Example for more info]() -This SDK aims to reduce complexity and abtract/hide some internal Deepgram details that clients shouldn't need to know about. However you can still tweak options and settings if you need. +## Transcribing to Captions +@TODO -### PreRecorded Audio Transcription Quickstart +[See our API reference for more info](). -You can find a [walkthrough](https://developers.deepgram.com/docs/python-sdk-pre-recorded-transcription) on our documentation site. Transcribing Pre-Recorded Audio can be done using the following sample code: +## Voice Agent +@TODO -```python -AUDIO_URL = { - "url": "https://static.deepgram.com/examples/Bueller-Life-moves-pretty-fast.wav" -} +[See our API reference for more info](). -## STEP 1 Create a Deepgram client using the API key from environment variables -deepgram: DeepgramClient = DeepgramClient("", ClientOptionsFromEnv()) +[See the Example for more info]() -## STEP 2 Call the transcribe_url method on the prerecorded class -options: PrerecordedOptions = PrerecordedOptions( - model="nova-3", - smart_format=True, -) -response = deepgram.listen.rest.v("1").transcribe_url(AUDIO_URL, options) -print(f"response: {response}\n\n") -``` +## Text to Speech +@TODO -### Live Audio Transcription Quickstart +[See our API reference for more info](). -You can find a [walkthrough](https://developers.deepgram.com/docs/python-sdk-streaming-transcription) on our documentation site. Transcribing Live Audio can be done using the following sample code: +[See the Example for more info]() -```python -deepgram: DeepgramClient = DeepgramClient() +## Text Intelligence +@TODO -dg_connection = deepgram.listen.websocket.v("1") - -def on_open(self, open, **kwargs): - print(f"\n\n{open}\n\n") - -def on_message(self, result, **kwargs): - sentence = result.channel.alternatives[0].transcript - if len(sentence) == 0: - return - print(f"speaker: {sentence}") - -def on_metadata(self, metadata, **kwargs): - print(f"\n\n{metadata}\n\n") - -def on_speech_started(self, speech_started, **kwargs): - print(f"\n\n{speech_started}\n\n") - -def on_utterance_end(self, utterance_end, **kwargs): - print(f"\n\n{utterance_end}\n\n") - -def on_error(self, error, **kwargs): - print(f"\n\n{error}\n\n") - -def on_close(self, close, **kwargs): - print(f"\n\n{close}\n\n") - -dg_connection.on(LiveTranscriptionEvents.Open, on_open) -dg_connection.on(LiveTranscriptionEvents.Transcript, on_message) -dg_connection.on(LiveTranscriptionEvents.Metadata, on_metadata) -dg_connection.on(LiveTranscriptionEvents.SpeechStarted, on_speech_started) -dg_connection.on(LiveTranscriptionEvents.UtteranceEnd, on_utterance_end) -dg_connection.on(LiveTranscriptionEvents.Error, on_error) -dg_connection.on(LiveTranscriptionEvents.Close, on_close) - -options: LiveOptions = LiveOptions( - model="nova-3", - punctuate=True, - language="en-US", - encoding="linear16", - channels=1, - sample_rate=16000, - ## To get UtteranceEnd, the following must be set: - interim_results=True, - utterance_end_ms="1000", - vad_events=True, -) -dg_connection.start(options) +[See our API reference for more info](). -## create microphone -microphone = Microphone(dg_connection.send) +[See the Example for more info]() -## start microphone -microphone.start() +## Authentication +### Get Token Details +@TODO -## wait until finished -input("Press Enter to stop recording...\n\n") +[See our API reference for more info](). -## Wait for the microphone to close -microphone.finish() +[See the Example for more info]() -## Indicate that we've finished -dg_connection.finish() +## Projects +### Get Projects +@TODO -print("Finished") -``` +[See our API reference for more info](). -### Self-Hosted +### Get Project +@TODO -To use the SDKs with self-hosted, please see our self-hosted developer documentation for more information: +[See our API reference for more info](). - +### Update Project +@TODO -## Examples +[See our API reference for more info](). -There are examples for **every** API call in this SDK. You can find all of these examples in the [examples folder](https://github.com/deepgram/deepgram-python-sdk/tree/main/examples) at the root of this repo. +### Delete Project +@TODO -Before running any of these examples, then you need to take a look at the README and install the following dependencies: +[See our API reference for more info](). -```bash -pip install -r examples/requirements-examples.txt -``` +## Keys +### List Keys +@TODO + +[See our API reference for more info](). + +### Get Key +@TODO + +[See our API reference for more info](). + +### Create Key +@TODO + +[See our API reference for more info](). + +### Delete Key +@TODO + +[See our API reference for more info](). + +## Members +### Get Members +@TODO + +[See our API reference for more info](). + +### Remove Member +@TODO + +[See our API reference for more info](). + +## Scopes +### Get Member Scopes +@TODO + +[See our API reference for more info](). + +### Update Scope +@TODO + +[See our API reference for more info](). + +## Invitations +### List Invites +@TODO + +[See our API reference for more info](). + +### Send Invite +@TODO + +[See our API reference for more info](). + +### Delete Invite +@TODO + +[See our API reference for more info](). + +### Leave Project +@TODO + +[See our API reference for more info](). + +## Usage +### Get All Requests +@TODO + +[See our API reference for more info](). + +### Get Request +@TODO + +[See our API reference for more info](). + +### Summarize Usage +@TODO + +[See our API reference for more info](). + +### Get Fields +@TODO -To run each example set the `DEEPGRAM_API_KEY` as an environment variable, then `cd` into each example folder and execute the example with: `python main.py` or `python3 main.py`. +[See our API reference for more info](). -### Agent +## Billing +### Get All Balances +@TODO -- Simple - [examples/agent/simple](https://github.com/deepgram/deepgram-python-sdk/blob/main/examples/agent/simple/main.py) -- Async Simple - [examples/agent/async_simple](https://github.com/deepgram/deepgram-python-sdk/blob/main/examples/agent/async_simple/main.py) +[See our API reference for more info](). -### Text to Speech +### Get Balance +@TODO -- Asynchronous - [examples/text-to-speech](https://github.com/deepgram/deepgram-python-sdk/blob/main/examples/text-to-speech/rest/file/async_hello_world/main.py) -- Synchronous - [examples/text-to-speech](https://github.com/deepgram/deepgram-python-sdk/blob/main/examples/text-to-speech/rest/file/hello_world/main.py) +[See our API reference for more info](). -### Analyze Text +## Models +### Get All Models +@TODO -- Intent Recognition - [examples/analyze/intent](https://github.com/deepgram/deepgram-python-sdk/blob/main/examples/analyze/intent/main.py) -- Sentiment Analysis - [examples/sentiment/intent](https://github.com/deepgram/deepgram-python-sdk/blob/main/examples/analyze/sentiment/main.py) -- Summarization - [examples/analyze/intent](https://github.com/deepgram/deepgram-python-sdk/blob/main/examples/analyze/summary/main.py) -- Topic Detection - [examples/analyze/intent](https://github.com/deepgram/deepgram-python-sdk/blob/main/examples/analyze/topic/main.py) +[See our API reference for more info](). -### PreRecorded Audio +### Get Model +@TODO -- Transcription From an Audio File - [examples/prerecorded/file](https://github.com/deepgram/deepgram-python-sdk/blob/main/examples/speech-to-text/rest/file/main.py) -- Transcription From an URL - [examples/prerecorded/url](https://github.com/deepgram/deepgram-python-sdk/blob/main/examples/speech-to-text/rest/url/main.py) -- Intent Recognition - [examples/speech-to-text/rest/intent](https://github.com/deepgram/deepgram-python-sdk/blob/main/examples/speech-to-text/rest/intent/main.py) -- Sentiment Analysis - [examples/speech-to-text/rest/sentiment](https://github.com/deepgram/deepgram-python-sdk/blob/main/examples/speech-to-text/rest/sentiment/main.py) -- Summarization - [examples/speech-to-text/rest/summary](https://github.com/deepgram/deepgram-python-sdk/blob/main/examples/speech-to-text/rest/summary/main.py) -- Topic Detection - [examples/speech-to-text/rest/topic](https://github.com/deepgram/deepgram-python-sdk/blob/main/examples/speech-to-text/rest/topic/main.py) +[See our API reference for more info](). -### Live Audio Transcription +## On-Prem APIs +### List On-Prem credentials +@TODO -- From a Microphone - [examples/streaming/microphone](https://github.com/deepgram/deepgram-python-sdk/blob/main/examples/speech-to-text/websocket/microphone/main.py) -- From an HTTP Endpoint - [examples/streaming/http](https://github.com/deepgram/deepgram-python-sdk/blob/main/examples/speech-to-text/rest/async_url/main.py) +[See our API reference for more info](). -Management API exercise the full [CRUD](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete) operations for: +### Get On-Prem credentials +@TODO -- Balances - [examples/manage/balances](https://github.com/deepgram/deepgram-python-sdk/blob/main/examples/manage/balances/main.py) -- Invitations - [examples/manage/invitations](https://github.com/deepgram/deepgram-python-sdk/blob/main/examples/manage/invitations/main.py) -- Keys - [examples/manage/keys](https://github.com/deepgram/deepgram-python-sdk/blob/main/examples/manage/keys/main.py) -- Members - [examples/manage/members](https://github.com/deepgram/deepgram-python-sdk/blob/main/examples/manage/members/main.py) -- Projects - [examples/manage/projects](https://github.com/deepgram/deepgram-python-sdk/blob/main/examples/manage/projects/main.py) -- Scopes - [examples/manage/scopes](https://github.com/deepgram/deepgram-python-sdk/blob/main/examples/manage/scopes/main.py) -- Usage - [examples/manage/usage](https://github.com/deepgram/deepgram-python-sdk/blob/main/examples/manage/usage/main.py) +[See our API reference for more info](). + +### Create On-Prem credentials +@TODO + +[See our API reference for more info](). + +### Delete On-Prem credentials +@TODO + +[See our API reference for more info](). + +## Pinning Versions +To ensure your application remains stable and reliable, we recommend using version pinning in your project. This is a best practice in Python development that helps prevent unexpected changes. You can pin to a major version (like `==4.*`) for a good balance of stability and updates, or to a specific version (like `==4.1.0`) for maximum stability. We've included some helpful resources about [version pinning](https://discuss.python.org/t/how-to-pin-a-package-to-a-specific-major-version-or-lower/17077) and [dependency management](https://www.easypost.com/dependency-pinning-guide) if you'd like to learn more. For a deeper understanding of how version numbers work, check out[semantic versioning](https://semver.org/). + +In a `requirements.txt` file, you can pin to a specific version like this: + +```sh +deepgram-sdk==4.1.0 +``` + +Or using pip: + +```sh +pip install deepgram-sdk==4.1.0 +``` ## Logging @@ -242,29 +352,7 @@ config: DeepgramClientOptions = DeepgramClientOptions( deepgram: DeepgramClient = DeepgramClient("", config) ``` -## Backwards Compatibility - -Older SDK versions will receive Priority 1 (P1) bug support only. Security issues, both in our code and dependencies, are promptly addressed. Significant bugs without clear workarounds are also given priority attention. - -## Development and Contributing - -Interested in contributing? We ❤️ pull requests! - -To make sure our community is safe for all, be sure to review and agree to our -[Code of Conduct](https://github.com/deepgram/deepgram-python-sdk/blob/main/.github/CODE_OF_CONDUCT.md). Then see the -[Contribution](https://github.com/deepgram/deepgram-python-sdk/blob/main/.github/CONTRIBUTING.md) guidelines for more information. - -### Prerequisites - -In order to develop new features for the SDK itself, you first need to uninstall any previous installation of the `deepgram-sdk` and then install/pip the dependencies contained in the `requirements.txt` then instruct python (via pip) to use the SDK by installing it locally. - -From the root of the repo, that would entail: - -```bash -pip uninstall deepgram-sdk -pip install -r requirements.txt -pip install -e . -``` +## Testing ### Daily and Unit Tests @@ -274,7 +362,7 @@ If you are looking to use, run, contribute or modify to the daily/unit tests, th pip install -r requirements-dev.txt ``` -#### Daily Tests +### Daily Tests The daily tests invoke a series of checks against the actual/real API endpoint and save the results in the `tests/response_data` folder. This response data is updated nightly to reflect the latest response from the server. Running the daily tests does require a `DEEPGRAM_API_KEY` set in your environment variables. @@ -292,6 +380,30 @@ The unit tests invoke a series of checks against mock endpoints using the respon make unit-test ``` +## Backwards Compatibility + +We follow semantic versioning (semver) to ensure a smooth upgrade experience. Within a major version (like `4.*`), we will maintain backward compatibility so your code will continue to work without breaking changes. When we release a new major version (like moving from `3.*` to `4.*`), we may introduce breaking changes to improve the SDK. We'll always document these changes clearly in our release notes to help you upgrade smoothly. + +Older SDK versions will receive Priority 1 (P1) bug support only. Security issues, both in our code and dependencies, are promptly addressed. Significant bugs without clear workarounds are also given priority attention. + +## Development and Contributing + +Interested in contributing? We ❤️ pull requests! + +To make sure our community is safe for all, be sure to review and agree to our +[Code of Conduct](CODE_OF_CONDUCT.md). Then see the +[Contribution](CONTRIBUTING.md) guidelines for more information. + +In order to develop new features for the SDK itself, you first need to uninstall any previous installation of the `deepgram-sdk` and then install/pip the dependencies contained in the `requirements.txt` then instruct python (via pip) to use the SDK by installing it locally. + +From the root of the repo, that would entail: + +```bash +pip uninstall deepgram-sdk +pip install -r requirements.txt +pip install -e . +``` + ## Getting Help We love to hear from you so if you have questions, comments or find a bug in the diff --git a/examples/speech-to-text/rest/file/main.py b/examples/speech-to-text/rest/sync/file/main.py similarity index 100% rename from examples/speech-to-text/rest/file/main.py rename to examples/speech-to-text/rest/sync/file/main.py diff --git a/examples/speech-to-text/rest/file/preamble.wav b/examples/speech-to-text/rest/sync/file/preamble.wav similarity index 100% rename from examples/speech-to-text/rest/file/preamble.wav rename to examples/speech-to-text/rest/sync/file/preamble.wav diff --git a/examples/speech-to-text/rest/sync/url/main.py b/examples/speech-to-text/rest/sync/url/main.py new file mode 100644 index 00000000..51873b5e --- /dev/null +++ b/examples/speech-to-text/rest/sync/url/main.py @@ -0,0 +1,64 @@ +# Copyright 2023-2024 Deepgram SDK contributors. All Rights Reserved. +# Use of this source code is governed by a MIT license that can be found in the LICENSE file. +# SPDX-License-Identifier: MIT + +import os +from dotenv import load_dotenv +import logging +from deepgram.utils import verboselogs +from datetime import datetime +import httpx + +from deepgram import ( + DeepgramClient, + DeepgramClientOptions, + PrerecordedOptions, + UrlSource, +) + +load_dotenv() + +# URL to the audio file to transcribe +AUDIO_URL = "https://dpgr.am/spacewalk.wav" # Replace with your audio URL + + +def main(): + try: + # STEP 1 Create a Deepgram client using the API key in the environment variables + config: DeepgramClientOptions = DeepgramClientOptions( + verbose=verboselogs.SPAM, + ) + deepgram: DeepgramClient = DeepgramClient("", config) + # OR use defaults + # deepgram: DeepgramClient = DeepgramClient() + + # STEP 2 Call the transcribe_url method on the rest class + payload: UrlSource = { + "url": AUDIO_URL, + } + + options: PrerecordedOptions = PrerecordedOptions( + model="nova-3", + smart_format=True, + utterances=True, + punctuate=True, + diarize=True, + ) + + before = datetime.now() + response = deepgram.listen.rest.v("1").transcribe_url( + payload, options, timeout=httpx.Timeout(300.0, connect=10.0) + ) + after = datetime.now() + + print(response.to_json(indent=4)) + print("") + difference = after - before + print(f"time: {difference.seconds}") + + except Exception as e: + print(f"Exception: {e}") + + +if __name__ == "__main__": + main() From 08ef82a6b605b5f3620619b066034c6c46e4f350 Mon Sep 17 00:00:00 2001 From: John Vajda Date: Wed, 21 May 2025 09:16:08 -0600 Subject: [PATCH 2/9] fix mdlint errors --- README.md | 130 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 88 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 1063bba6..3c033ec0 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,8 @@ pip install deepgram-sdk ``` ## Transcription (Synchronous) -### Remote Files + +### Remote Files (Synchronous) ``` python from deepgram import DeepgramClient, PrerecordedOptions @@ -108,7 +109,8 @@ response = DeepgramClient().listen.rest.v("1").transcribe_url( [See the Example for more info](./examples/speech-to-text/rest/file/main.py). ## Transcription (Asynchronous / Callbacks) -### Remote Files + +### Remote Files (Asynchronous) ``` python @TODO @@ -118,7 +120,7 @@ response = DeepgramClient().listen.rest.v("1").transcribe_url( [See the Example for more info](./examples/speech-to-text/rest/async_file/main.py). -### Local Files +### Local Files (Asynchronous) ``` python @TODO @@ -127,198 +129,242 @@ response = DeepgramClient().listen.rest.v("1").transcribe_url( [See our API reference for more info](https://developers.deepgram.com/reference/speech-to-text-api/listen). ## Transcription (Live / Streaming) + ### Live Audio ``` python @TODO ``` -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/streaming-api) -[See the Example for more info]() +[See the Example for more info](./examples/speech-to-text/streaming/main.py) ## Transcribing to Captions + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/captions-api) ## Voice Agent + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/voice-agent-api) -[See the Example for more info]() +[See the Example for more info](./examples/voice-agent/main.py) ## Text to Speech + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/text-to-speech-api) -[See the Example for more info]() +[See the Example for more info](./examples/text-to-speech/main.py) ## Text Intelligence + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/text-intelligence-api) -[See the Example for more info]() +[See the Example for more info](./examples/text-intelligence/main.py) ## Authentication + ### Get Token Details + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/authentication-api) -[See the Example for more info]() +[See the Example for more info](./examples/authentication/main.py) ## Projects + ### Get Projects + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/projects-api) ### Get Project + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/projects-api) ### Update Project + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/projects-api) ### Delete Project + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/projects-api) ## Keys + ### List Keys + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/keys-api) ### Get Key + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/keys-api) ### Create Key + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/keys-api) ### Delete Key + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/keys-api) ## Members + ### Get Members + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/members-api) ### Remove Member + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/members-api) ## Scopes + ### Get Member Scopes + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/scopes-api) ### Update Scope + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/scopes-api) ## Invitations + ### List Invites + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/invites-api) ### Send Invite + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/invites-api) ### Delete Invite + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/invites-api) ### Leave Project + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/projects-api) ## Usage + ### Get All Requests + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/requests-api) ### Get Request + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/requests-api) ### Summarize Usage + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/usage-api) ### Get Fields + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/usage-api) ## Billing + ### Get All Balances + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/balances-api) ### Get Balance + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/balances-api) ## Models + ### Get All Models + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/models-api) ### Get Model + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/models-api) ## On-Prem APIs + ### List On-Prem credentials + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/on-prem-api) ### Get On-Prem credentials + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/on-prem-api) ### Create On-Prem credentials + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/on-prem-api) ### Delete On-Prem credentials + @TODO -[See our API reference for more info](). +[See our API reference for more info](https://developers.deepgram.com/reference/on-prem-api) ## Pinning Versions To ensure your application remains stable and reliable, we recommend using version pinning in your project. This is a best practice in Python development that helps prevent unexpected changes. You can pin to a major version (like `==4.*`) for a good balance of stability and updates, or to a specific version (like `==4.1.0`) for maximum stability. We've included some helpful resources about [version pinning](https://discuss.python.org/t/how-to-pin-a-package-to-a-specific-major-version-or-lower/17077) and [dependency management](https://www.easypost.com/dependency-pinning-guide) if you'd like to learn more. For a deeper understanding of how version numbers work, check out[semantic versioning](https://semver.org/). From 35423c4a41fab7d96d79bda0ba35fc0f10d5c31c Mon Sep 17 00:00:00 2001 From: John Vajda Date: Wed, 21 May 2025 09:17:52 -0600 Subject: [PATCH 3/9] more more lint fixes --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3c033ec0..7dfdfb9b 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,11 @@ Official Python SDK for [Deepgram](https://www.deepgram.com/). Power your apps with world-class speech and Language AI models. - [Transcription (Synchronous)](#transcription-synchronous) - - [Remote Files](#remote-files) + - [Remote Files (Synchronous)](#remote-files-synchronous) - [Local Files](#local-files) - [Transcription (Asynchronous / Callbacks)](#transcription-asynchronous--callbacks) - - [Remote Files](#remote-files-1) - - [Local Files](#local-files-1) + - [Remote Files (Asynchronous)](#remote-files-asynchronous) + - [Local Files (Asynchronous)](#local-files-asynchronous) - [Transcription (Live / Streaming)](#transcription-live--streaming) - [Live Audio](#live-audio) - [Transcribing to Captions](#transcribing-to-captions) From 0df4e11d4a9e57cec55a6ec6c07123082aa1d3a8 Mon Sep 17 00:00:00 2001 From: John Vajda Date: Wed, 21 May 2025 13:05:20 -0600 Subject: [PATCH 4/9] more updates --- README.md | 289 +++++++++++++++--- .../rest/{async_file => async/file}/main.py | 0 .../{async_file => async/file}/preamble.wav | Bin .../rest/{async_url => async/url}/main.py | 0 examples/speech-to-text/rest/url/main.py | 47 --- 5 files changed, 252 insertions(+), 84 deletions(-) rename examples/speech-to-text/rest/{async_file => async/file}/main.py (100%) rename examples/speech-to-text/rest/{async_file => async/file}/preamble.wav (100%) rename examples/speech-to-text/rest/{async_url => async/url}/main.py (100%) delete mode 100644 examples/speech-to-text/rest/url/main.py diff --git a/README.md b/README.md index 7dfdfb9b..1c2f334f 100644 --- a/README.md +++ b/README.md @@ -5,17 +5,17 @@ Official Python SDK for [Deepgram](https://www.deepgram.com/). Power your apps with world-class speech and Language AI models. -- [Transcription (Synchronous)](#transcription-synchronous) +- [Pre-Recorded (Synchronous)](#pre-recorded-synchronous) - [Remote Files (Synchronous)](#remote-files-synchronous) - - [Local Files](#local-files) -- [Transcription (Asynchronous / Callbacks)](#transcription-asynchronous--callbacks) + - [Local Files (Synchronous)](#local-files-synchronous) +- [Pre-Recorded (Asynchronous / Callbacks)](#pre-recorded-asynchronous--callbacks) - [Remote Files (Asynchronous)](#remote-files-asynchronous) - [Local Files (Asynchronous)](#local-files-asynchronous) -- [Transcription (Live / Streaming)](#transcription-live--streaming) - - [Live Audio](#live-audio) +- [Streaming Audio](#streaming-audio) - [Transcribing to Captions](#transcribing-to-captions) - [Voice Agent](#voice-agent) -- [Text to Speech](#text-to-speech) +- [Text to Speech REST](#text-to-speech-rest) +- [Text to Speech Streaming](#text-to-speech-streaming) - [Text Intelligence](#text-intelligence) - [Authentication](#authentication) - [Get Token Details](#get-token-details) @@ -81,16 +81,29 @@ To install the latest version available: pip install deepgram-sdk ``` -## Transcription (Synchronous) +## Pre-Recorded Initialization & Options -### Remote Files (Synchronous) +```python +from deepgram import DeepgramClient -``` python -from deepgram import DeepgramClient, PrerecordedOptions +# Initialize the client +deepgram = DeepgramClient("YOUR_API_KEY") # Replace with your API key -response = DeepgramClient().listen.rest.v("1").transcribe_url( +# set options +from deepgram import PrerecordedOptions +response = deepgram.listen.rest.v("1").transcribe_url( source={"url": "https://dpgr.am/spacewalk.wav"}, - options=PrerecordedOptions(model="nova-3") + options=PrerecordedOptions(model="nova-3") # Apply other options +) +``` + +## Pre-Recorded (Synchronous) + +### Remote Files (Synchronous) + +```python +response = deepgram.listen.rest.v("1").transcribe_url( + source={"url": "https://dpgr.am/spacewalk.wav"} ) ``` @@ -98,73 +111,216 @@ response = DeepgramClient().listen.rest.v("1").transcribe_url( [See the Example for more info](./examples/speech-to-text/rest/sync/url/main.py). -### Local Files +### Local Files (Synchronous) -``` python -@TODO +```python +response = deepgram.listen.rest.v("1").transcribe_file( + source=open("path/to/your/audio.wav", "rb") +) ``` [See our API reference for more info](https://developers.deepgram.com/reference/speech-to-text-api/listen). -[See the Example for more info](./examples/speech-to-text/rest/file/main.py). +[See the Example for more info](./examples/speech-to-text/rest/sync/file/main.py). -## Transcription (Asynchronous / Callbacks) +## Pre-Recorded (Asynchronous / Callbacks) ### Remote Files (Asynchronous) -``` python -@TODO +```python +response = deepgram.listen.rest.v("1").transcribe_url_async( + source={"url": "https://dpgr.am/spacewalk.wav"}, + callback_url="https://your-callback-url.com/webhook" +) ``` [See our API reference for more info](https://developers.deepgram.com/reference/speech-to-text-api/listen). -[See the Example for more info](./examples/speech-to-text/rest/async_file/main.py). +[See the Example for more info](./examples/speech-to-text/rest/async/url/main.py). ### Local Files (Asynchronous) -``` python -@TODO +```python +response = deepgram.listen.rest.v("1").transcribe_file_async( + source=open("path/to/your/audio.wav", "rb"), + callback_url="https://your-callback-url.com/webhook" +) ``` [See our API reference for more info](https://developers.deepgram.com/reference/speech-to-text-api/listen). -## Transcription (Live / Streaming) +[See the Example for more info](./examples/speech-to-text/rest/async/file/main.py). -### Live Audio +## Streaming Audio -``` python -@TODO +```python +from deepgram import LiveOptions, LiveTranscriptionEvents + +# Create a websocket connection +connection = deepgram.listen.websocket.v("1") + +# Handle transcription events +@connection.on(LiveTranscriptionEvents.Transcript) +def handle_transcript(result): + print(result.channel.alternatives[0].transcript) + +# Start connection with streaming options +connection.start(LiveOptions(model="nova-3", language="en-US")) + +# Send audio data +connection.send(open("path/to/your/audio.wav", "rb").read()) + +# Close when done +connection.finish() ``` -[See our API reference for more info](https://developers.deepgram.com/reference/streaming-api) +[See our API reference for more info](https://developers.deepgram.com/reference/streaming-api). -[See the Example for more info](./examples/speech-to-text/streaming/main.py) +[See the Examples for more info](./examples/speech-to-text/websocket/). ## Transcribing to Captions -@TODO +### WebVTT + +```python +from deepgram_captions import DeepgramConverter, webvtt + +transcription = DeepgramConverter(dg_response) +captions = webvtt(transcription) +``` + +### SRT + +```python +from deepgram_captions import DeepgramConverter, srt + +transcription = DeepgramConverter(dg_response) +captions = srt(transcription) +``` -[See our API reference for more info](https://developers.deepgram.com/reference/captions-api) +[See our stand alone captions library for more information.](https://github.com/deepgram/deepgram-python-captions). ## Voice Agent -@TODO +```python +from deepgram import ( + DeepgramClient, + SettingsOptions +) -[See our API reference for more info](https://developers.deepgram.com/reference/voice-agent-api) +deepgram = DeepgramClient("YOUR_API_KEY") -[See the Example for more info](./examples/voice-agent/main.py) +# Create websocket connection +connection = deepgram.agent.websocket.v("1") -## Text to Speech +# Configure agent settings +options = SettingsOptions() +options.language = "en" +options.agent.think.provider.type = "open_ai" +options.agent.think.provider.model = "gpt-4o-mini" +options.agent.think.prompt = "You are a helpful AI assistant." +options.agent.listen.provider.type = "deepgram" +options.agent.listen.provider.model = "nova-3" +options.agent.speak.provider.type = "deepgram" +options.agent.speak.provider.model ="aura-2-thalia-en" -@TODO +options.greeting = "Hello, I'm your AI assistant." + +# Start the connection +connection.start(options) + +# Close the connection +connection.finish() +``` + +This example demonstrates: + +- Setting up a WebSocket connection +- Configuring the agent with speech, language, and audio settings +- Handling various agent events (speech, transcripts, audio) +- Sending audio data and keeping the connection alive + +For a complete implementation, you would need to: + +1. Add your audio input source (e.g., microphone) +2. Implement audio playback for the agent's responses +3. Handle any function calls if your agent uses them +4. Add proper error handling and connection management + +[See our API reference for more info](https://developers.deepgram.com/reference/voice-agent-api/agent). + +[See the Examples for more info](./examples/agent/). + +## Text to Speech REST + +```python +from deepgram import DeepgramClient, SpeakOptions + +# Initialize the client +deepgram = DeepgramClient("YOUR_API_KEY") + +# Configure speech options +options = SpeakOptions(model="aura-2-thalia-en") + +# Convert text to speech and save to file +response = deepgram.speak.rest.v("1").save( + "output.mp3", + {"text": "Hello world!"}, + options +) +``` + +[See our API reference for more info](https://developers.deepgram.com/reference/text-to-speech-api/speak). + +[See the Example for more info](./examples/text-to-speech/rest/). + +## Text to Speech Streaming + +```python +from deepgram import ( + DeepgramClient, + SpeakWSOptions, + SpeakWebSocketEvents +) + +# Initialize the client +deepgram = DeepgramClient("YOUR_API_KEY") + +# Create websocket connection +connection = deepgram.speak.websocket.v("1") + +# Handle audio data +@connection.on(SpeakWebSocketEvents.AudioData) +def handle_audio(data): + # Process audio data or play it + pass -[See our API reference for more info](https://developers.deepgram.com/reference/text-to-speech-api) +# Configure streaming options +options = SpeakWSOptions( + model="aura-2-thalia-en", + encoding="linear16", + sample_rate=16000 +) + +# Start connection and send text +connection.start(options) +connection.send_text("Hello, this is a text to speech example.") +connection.flush() +connection.wait_for_complete() + +# Close when done +connection.finish() +``` + +[See our API reference for more info](https://developers.deepgram.com/reference/text-to-speech-api/speak). -[See the Example for more info](./examples/text-to-speech/main.py) +[See the Example for more info](./examples/text-to-speech/websocket/). ## Text Intelligence +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/text-intelligence-api) @@ -174,7 +330,9 @@ response = DeepgramClient().listen.rest.v("1").transcribe_url( ### Get Token Details +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/authentication-api) @@ -184,25 +342,33 @@ response = DeepgramClient().listen.rest.v("1").transcribe_url( ### Get Projects +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/projects-api) ### Get Project +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/projects-api) ### Update Project +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/projects-api) ### Delete Project +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/projects-api) @@ -210,25 +376,33 @@ response = DeepgramClient().listen.rest.v("1").transcribe_url( ### List Keys +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/keys-api) ### Get Key +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/keys-api) ### Create Key +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/keys-api) ### Delete Key +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/keys-api) @@ -236,13 +410,17 @@ response = DeepgramClient().listen.rest.v("1").transcribe_url( ### Get Members +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/members-api) ### Remove Member +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/members-api) @@ -250,13 +428,17 @@ response = DeepgramClient().listen.rest.v("1").transcribe_url( ### Get Member Scopes +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/scopes-api) ### Update Scope +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/scopes-api) @@ -264,25 +446,33 @@ response = DeepgramClient().listen.rest.v("1").transcribe_url( ### List Invites +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/invites-api) ### Send Invite +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/invites-api) ### Delete Invite +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/invites-api) ### Leave Project +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/projects-api) @@ -290,25 +480,33 @@ response = DeepgramClient().listen.rest.v("1").transcribe_url( ### Get All Requests +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/requests-api) ### Get Request +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/requests-api) ### Summarize Usage +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/usage-api) ### Get Fields +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/usage-api) @@ -316,13 +514,17 @@ response = DeepgramClient().listen.rest.v("1").transcribe_url( ### Get All Balances +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/balances-api) ### Get Balance +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/balances-api) @@ -330,13 +532,17 @@ response = DeepgramClient().listen.rest.v("1").transcribe_url( ### Get All Models +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/models-api) ### Get Model +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/models-api) @@ -344,29 +550,38 @@ response = DeepgramClient().listen.rest.v("1").transcribe_url( ### List On-Prem credentials +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/on-prem-api) ### Get On-Prem credentials +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/on-prem-api) ### Create On-Prem credentials +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/on-prem-api) ### Delete On-Prem credentials +```python @TODO +``` [See our API reference for more info](https://developers.deepgram.com/reference/on-prem-api) ## Pinning Versions + To ensure your application remains stable and reliable, we recommend using version pinning in your project. This is a best practice in Python development that helps prevent unexpected changes. You can pin to a major version (like `==4.*`) for a good balance of stability and updates, or to a specific version (like `==4.1.0`) for maximum stability. We've included some helpful resources about [version pinning](https://discuss.python.org/t/how-to-pin-a-package-to-a-specific-major-version-or-lower/17077) and [dependency management](https://www.easypost.com/dependency-pinning-guide) if you'd like to learn more. For a deeper understanding of how version numbers work, check out[semantic versioning](https://semver.org/). In a `requirements.txt` file, you can pin to a specific version like this: diff --git a/examples/speech-to-text/rest/async_file/main.py b/examples/speech-to-text/rest/async/file/main.py similarity index 100% rename from examples/speech-to-text/rest/async_file/main.py rename to examples/speech-to-text/rest/async/file/main.py diff --git a/examples/speech-to-text/rest/async_file/preamble.wav b/examples/speech-to-text/rest/async/file/preamble.wav similarity index 100% rename from examples/speech-to-text/rest/async_file/preamble.wav rename to examples/speech-to-text/rest/async/file/preamble.wav diff --git a/examples/speech-to-text/rest/async_url/main.py b/examples/speech-to-text/rest/async/url/main.py similarity index 100% rename from examples/speech-to-text/rest/async_url/main.py rename to examples/speech-to-text/rest/async/url/main.py diff --git a/examples/speech-to-text/rest/url/main.py b/examples/speech-to-text/rest/url/main.py deleted file mode 100644 index e28b5594..00000000 --- a/examples/speech-to-text/rest/url/main.py +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright 2023-2024 Deepgram SDK contributors. All Rights Reserved. -# Use of this source code is governed by a MIT license that can be found in the LICENSE file. -# SPDX-License-Identifier: MIT - -import os -from dotenv import load_dotenv -import logging -from deepgram.utils import verboselogs - -from deepgram import ( - DeepgramClient, - ClientOptionsFromEnv, - PrerecordedOptions, -) - -load_dotenv() - -AUDIO_URL = { - "url": "https://static.deepgram.com/examples/Bueller-Life-moves-pretty-fast.wav" -} - - -def main(): - try: - # STEP 1 Create a Deepgram client using the DEEPGRAM_API_KEY from your environment variables - deepgram: DeepgramClient = DeepgramClient() - - # STEP 2 Call the transcribe_url method on the rest class - options: PrerecordedOptions = PrerecordedOptions( - model="nova-3", - smart_format=True, - ) - response = deepgram.listen.rest.v("1").transcribe_url(AUDIO_URL, options) - print(f"response: {response}\n\n") - # print(f"metadata: {response['metadata']}\n\n") - # print( - # f"transcript: {response.results.channels[0].alternatives[0]['transcript']}\n\n" - # ) - # for word in response.results.channels[0].alternatives[0].words: - # print(f"Word: {word.word}, Start: {word.start}, End: {word.end}") - - except Exception as e: - print(f"Exception: {e}") - - -if __name__ == "__main__": - main() From 0160d66db95a1dea8a08fab9e71eeb903b75a388 Mon Sep 17 00:00:00 2001 From: John Vajda Date: Wed, 21 May 2025 14:56:55 -0600 Subject: [PATCH 5/9] more updates --- README.md | 117 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 80 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 1c2f334f..15996a4f 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ Official Python SDK for [Deepgram](https://www.deepgram.com/). Power your apps w - [Text Intelligence](#text-intelligence) - [Authentication](#authentication) - [Get Token Details](#get-token-details) + - [Grant Token](#grant-token) - [Projects](#projects) - [Get Projects](#get-projects) - [Get Project](#get-project) @@ -81,29 +82,27 @@ To install the latest version available: pip install deepgram-sdk ``` -## Pre-Recorded Initialization & Options +## Initialization + +All the examples below will require `DeepgramClient`. ```python from deepgram import DeepgramClient # Initialize the client deepgram = DeepgramClient("YOUR_API_KEY") # Replace with your API key - -# set options -from deepgram import PrerecordedOptions -response = deepgram.listen.rest.v("1").transcribe_url( - source={"url": "https://dpgr.am/spacewalk.wav"}, - options=PrerecordedOptions(model="nova-3") # Apply other options -) ``` ## Pre-Recorded (Synchronous) ### Remote Files (Synchronous) +Transcribe audio from a URL. + ```python response = deepgram.listen.rest.v("1").transcribe_url( source={"url": "https://dpgr.am/spacewalk.wav"} + options=PrerecordedOptions(model="nova-3") # Apply other options ) ``` @@ -113,9 +112,12 @@ response = deepgram.listen.rest.v("1").transcribe_url( ### Local Files (Synchronous) +Transcribe audio from a file. + ```python response = deepgram.listen.rest.v("1").transcribe_file( source=open("path/to/your/audio.wav", "rb") + options=PrerecordedOptions(model="nova-3") # Apply other options ) ``` @@ -127,10 +129,13 @@ response = deepgram.listen.rest.v("1").transcribe_file( ### Remote Files (Asynchronous) +Transcribe audio from a URL. + ```python response = deepgram.listen.rest.v("1").transcribe_url_async( source={"url": "https://dpgr.am/spacewalk.wav"}, callback_url="https://your-callback-url.com/webhook" + options=PrerecordedOptions(model="nova-3") # Apply other options ) ``` @@ -140,10 +145,13 @@ response = deepgram.listen.rest.v("1").transcribe_url_async( ### Local Files (Asynchronous) +Transcribe audio from a file. + ```python response = deepgram.listen.rest.v("1").transcribe_file_async( source=open("path/to/your/audio.wav", "rb"), callback_url="https://your-callback-url.com/webhook" + options=PrerecordedOptions(model="nova-3") # Apply other options ) ``` @@ -153,6 +161,8 @@ response = deepgram.listen.rest.v("1").transcribe_file_async( ## Streaming Audio +Transcribe streaming audio. + ```python from deepgram import LiveOptions, LiveTranscriptionEvents @@ -180,6 +190,8 @@ connection.finish() ## Transcribing to Captions +Transcribe audio to captions. + ### WebVTT ```python @@ -202,14 +214,13 @@ captions = srt(transcription) ## Voice Agent +Configure a Voice Agent. + ```python from deepgram import ( - DeepgramClient, SettingsOptions ) -deepgram = DeepgramClient("YOUR_API_KEY") - # Create websocket connection connection = deepgram.agent.websocket.v("1") @@ -253,11 +264,10 @@ For a complete implementation, you would need to: ## Text to Speech REST -```python -from deepgram import DeepgramClient, SpeakOptions +Convert text into speech using the REST API. -# Initialize the client -deepgram = DeepgramClient("YOUR_API_KEY") +```python +from deepgram import SpeakOptions # Configure speech options options = SpeakOptions(model="aura-2-thalia-en") @@ -276,24 +286,19 @@ response = deepgram.speak.rest.v("1").save( ## Text to Speech Streaming +Convert streaming text into speech using a Websocket. + ```python from deepgram import ( - DeepgramClient, SpeakWSOptions, SpeakWebSocketEvents ) -# Initialize the client -deepgram = DeepgramClient("YOUR_API_KEY") - # Create websocket connection connection = deepgram.speak.websocket.v("1") # Handle audio data @connection.on(SpeakWebSocketEvents.AudioData) -def handle_audio(data): - # Process audio data or play it - pass # Configure streaming options options = SpeakWSOptions( @@ -314,63 +319,101 @@ connection.finish() [See our API reference for more info](https://developers.deepgram.com/reference/text-to-speech-api/speak). -[See the Example for more info](./examples/text-to-speech/websocket/). +[See the Examples for more info](./examples/text-to-speech/websocket/). ## Text Intelligence +Analyze text. + ```python -@TODO +from deepgram import ReadOptions + +# Configure read options +options = ReadOptions( + model="nova-3", + language="en" +) + +# Process text for intelligence +response = deepgram.read.rest.v("1").process( + text="The quick brown fox jumps over the lazy dog.", + options=options +) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/text-intelligence-api) +[See our API reference for more info](https://developers.deepgram.com/reference/text-intelligence-api/text-read). -[See the Example for more info](./examples/text-intelligence/main.py) ## Authentication ### Get Token Details +Retrieves the details of the current authentication token. + ```python -@TODO +response = deepgram.manage.rest.v("1").get_token_details() ``` -[See our API reference for more info](https://developers.deepgram.com/reference/authentication-api) +[See our API reference for more info](https://developers.deepgram.com/reference/authentication). + +### Grant Token -[See the Example for more info](./examples/authentication/main.py) +Creates a temporary token with a 30-second TTL. + +```python +response = deepgram.auth.v("1").grant_token() + +``` + +[See our API reference for more info](https://developers.deepgram.com/reference/token-based-auth-api/grant-token). + +[See The Examples for more info](./examples/auth/) ## Projects ### Get Projects +Returns all projects accessible by the API key. + ```python -@TODO +response = deepgram.manage.rest.v("1").get_projects() ``` -[See our API reference for more info](https://developers.deepgram.com/reference/projects-api) +[See our API reference for more info](https://developers.deepgram.com/reference/management-api/projects/list) + +[See The Example for more info](./examples/manage/projects/main.py) ### Get Project +Retrieves a specific project based on the provided project_id. + ```python -@TODO +response = deepgram.manage.rest.v("1").get_project(myId) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/projects-api) +[See our API reference for more info](https://developers.deepgram.com/reference/management-api/projects/get) + +[See The Example for more info](./examples/manage/projects/main.py) ### Update Project ```python -@TODO +response = deepgram.manage.rest.v("1").update_project(myId, options) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/projects-api) +[See our API reference for more info](https://developers.deepgram.com/reference/management-api/projects/update) + +[See The Example for more info](./examples/manage/projects/main.py) ### Delete Project ```python -@TODO +response = deepgram.manage.rest.v("1").delete_project(myId) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/projects-api) +[See our API reference for more info](https://developers.deepgram.com/reference/management-api/projects/delete) + +[See The Example for more info](./examples/manage/projects/main.py) ## Keys From e0469a6132c55d2d904d0eb24c9d0346a451ecd5 Mon Sep 17 00:00:00 2001 From: John Vajda Date: Wed, 21 May 2025 15:38:49 -0600 Subject: [PATCH 6/9] additional updates --- README.md | 131 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 86 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 15996a4f..8e14a0ba 100644 --- a/README.md +++ b/README.md @@ -343,7 +343,6 @@ response = deepgram.read.rest.v("1").process( [See our API reference for more info](https://developers.deepgram.com/reference/text-intelligence-api/text-read). - ## Authentication ### Get Token Details @@ -376,140 +375,182 @@ response = deepgram.auth.v("1").grant_token() Returns all projects accessible by the API key. ```python -response = deepgram.manage.rest.v("1").get_projects() +response = deepgram.manage.v("1").get_projects() ``` -[See our API reference for more info](https://developers.deepgram.com/reference/management-api/projects/list) +[See our API reference for more info](https://developers.deepgram.com/reference/management-api/projects/list). -[See The Example for more info](./examples/manage/projects/main.py) +[See The Example for more info](./examples/manage/projects/main.py). ### Get Project Retrieves a specific project based on the provided project_id. ```python -response = deepgram.manage.rest.v("1").get_project(myId) +response = deepgram.manage.v("1").get_project(myProjectId) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/management-api/projects/get) +[See our API reference for more info](https://developers.deepgram.com/reference/management-api/projects/get). -[See The Example for more info](./examples/manage/projects/main.py) +[See The Example for more info](./examples/manage/projects/main.py). ### Update Project +Update a project. + ```python -response = deepgram.manage.rest.v("1").update_project(myId, options) +response = deepgram.manage.v("1").update_project(myProjectId, options) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/management-api/projects/update) +[See our API reference for more info](https://developers.deepgram.com/reference/management-api/projects/update). -[See The Example for more info](./examples/manage/projects/main.py) +[See The Example for more info](./examples/manage/projects/main.py). ### Delete Project +Delete a project. + ```python -response = deepgram.manage.rest.v("1").delete_project(myId) +response = deepgram.manage.v("1").delete_project(myProjectId) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/management-api/projects/delete) +[See our API reference for more info](https://developers.deepgram.com/reference/management-api/projects/delete). -[See The Example for more info](./examples/manage/projects/main.py) +[See The Example for more info](./examples/manage/projects/main.py). ## Keys ### List Keys +Retrieves all keys associated with the provided project_id. + ```python -@TODO +response = deepgram.manage.v("1").get_keys(myProjectId) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/keys-api) +[See our API reference for more info](https://developers.deepgram.com/reference/management-api/keys/list) + +[See The Example for more info](./examples/manage/keys/main.py). ### Get Key +Retrieves a specific key associated with the provided project_id. + ```python -@TODO +response = deepgram.manage.v("1").get_key(myProjectId, myKeyId) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/keys-api) +[See our API reference for more info](https://developers.deepgram.com/reference/management-api/keys/get) + +[See The Example for more info](./examples/manage/keys/main.py). ### Create Key +Creates an API key with the provided scopes. + ```python -@TODO + response = deepgram.manage.v("1").create_key(myProjectId, options) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/keys-api) +[See our API reference for more info](https://developers.deepgram.com/reference/management-api/keys/create) + +[See The Example for more info](./examples/manage/keys/main.py). ### Delete Key +Deletes a specific key associated with the provided project_id. + ```python -@TODO +response = deepgram.manage.v("1").delete_key(myProjectId, myKeyId) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/keys-api) +[See our API reference for more info](https://developers.deepgram.com/reference/management-api/keys/delete) + +[See The Example for more info](./examples/manage/keys/main.py). ## Members ### Get Members +Retrieves account objects for all of the accounts in the specified project_id. + ```python -@TODO +response = deepgram.manage.v("1").get_members(myProjectId) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/members-api) +[See our API reference for more info](https://developers.deepgram.com/reference/management-api/members/list). + +[See The Example for more info](./examples/manage/members/main.py). ### Remove Member +Removes member account for specified member_id. + ```python -@TODO +response = deepgram.manage.v("1").remove_member(myProjectId, MemberId) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/members-api) +[See our API reference for more info](https://developers.deepgram.com/reference/management-api/members/delete). + +[See The Example for more info](./examples/manage/members/main.py). ## Scopes ### Get Member Scopes +Retrieves scopes of the specified member in the specified project. + ```python -@TODO +response = deepgram.manage.v("1").get_member_scopes(myProjectId, memberId) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/scopes-api) +[See our API reference for more info](https://developers.deepgram.com/reference/management-api/scopes/list). + +[See The Example for more info](./examples/manage/scopes/main.py). ### Update Scope +Updates the scope for the specified member in the specified project. + ```python -@TODO +response = deepgram.manage.v("1").update_member_scope(myProjectId, memberId, options) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/scopes-api) +[See our API reference for more info](https://developers.deepgram.com/reference/management-api/scopes/update). + +[See The Example for more info](./examples/manage/scopes/main.py). ## Invitations ### List Invites +Retrieves all invitations associated with the provided project_id. + ```python @TODO ``` -[See our API reference for more info](https://developers.deepgram.com/reference/invites-api) +[See our API reference for more info](https://developers.deepgram.com/reference/invites-api). ### Send Invite +Sends an invitation to the provided email address. + ```python @TODO ``` -[See our API reference for more info](https://developers.deepgram.com/reference/invites-api) +[See our API reference for more info](https://developers.deepgram.com/reference/invites-api). ### Delete Invite +Removes the specified invitation from the project. + ```python @TODO ``` -[See our API reference for more info](https://developers.deepgram.com/reference/invites-api) +[See our API reference for more info](https://developers.deepgram.com/reference/invites-api). ### Leave Project @@ -517,7 +558,7 @@ response = deepgram.manage.rest.v("1").delete_project(myId) @TODO ``` -[See our API reference for more info](https://developers.deepgram.com/reference/projects-api) +[See our API reference for more info](https://developers.deepgram.com/reference/projects-api). ## Usage @@ -527,7 +568,7 @@ response = deepgram.manage.rest.v("1").delete_project(myId) @TODO ``` -[See our API reference for more info](https://developers.deepgram.com/reference/requests-api) +[See our API reference for more info](https://developers.deepgram.com/reference/requests-api). ### Get Request @@ -535,7 +576,7 @@ response = deepgram.manage.rest.v("1").delete_project(myId) @TODO ``` -[See our API reference for more info](https://developers.deepgram.com/reference/requests-api) +[See our API reference for more info](https://developers.deepgram.com/reference/requests-api). ### Summarize Usage @@ -543,7 +584,7 @@ response = deepgram.manage.rest.v("1").delete_project(myId) @TODO ``` -[See our API reference for more info](https://developers.deepgram.com/reference/usage-api) +[See our API reference for more info](https://developers.deepgram.com/reference/usage-api). ### Get Fields @@ -551,7 +592,7 @@ response = deepgram.manage.rest.v("1").delete_project(myId) @TODO ``` -[See our API reference for more info](https://developers.deepgram.com/reference/usage-api) +[See our API reference for more info](https://developers.deepgram.com/reference/usage-api). ## Billing @@ -561,7 +602,7 @@ response = deepgram.manage.rest.v("1").delete_project(myId) @TODO ``` -[See our API reference for more info](https://developers.deepgram.com/reference/balances-api) +[See our API reference for more info](https://developers.deepgram.com/reference/balances-api). ### Get Balance @@ -569,7 +610,7 @@ response = deepgram.manage.rest.v("1").delete_project(myId) @TODO ``` -[See our API reference for more info](https://developers.deepgram.com/reference/balances-api) +[See our API reference for more info](https://developers.deepgram.com/reference/balances-api). ## Models @@ -579,7 +620,7 @@ response = deepgram.manage.rest.v("1").delete_project(myId) @TODO ``` -[See our API reference for more info](https://developers.deepgram.com/reference/models-api) +[See our API reference for more info](https://developers.deepgram.com/reference/models-api). ### Get Model @@ -587,7 +628,7 @@ response = deepgram.manage.rest.v("1").delete_project(myId) @TODO ``` -[See our API reference for more info](https://developers.deepgram.com/reference/models-api) +[See our API reference for more info](https://developers.deepgram.com/reference/models-api). ## On-Prem APIs @@ -597,7 +638,7 @@ response = deepgram.manage.rest.v("1").delete_project(myId) @TODO ``` -[See our API reference for more info](https://developers.deepgram.com/reference/on-prem-api) +[See our API reference for more info](https://developers.deepgram.com/reference/on-prem-api). ### Get On-Prem credentials @@ -605,7 +646,7 @@ response = deepgram.manage.rest.v("1").delete_project(myId) @TODO ``` -[See our API reference for more info](https://developers.deepgram.com/reference/on-prem-api) +[See our API reference for more info](https://developers.deepgram.com/reference/on-prem-api). ### Create On-Prem credentials @@ -613,7 +654,7 @@ response = deepgram.manage.rest.v("1").delete_project(myId) @TODO ``` -[See our API reference for more info](https://developers.deepgram.com/reference/on-prem-api) +[See our API reference for more info](https://developers.deepgram.com/reference/on-prem-api). ### Delete On-Prem credentials @@ -621,7 +662,7 @@ response = deepgram.manage.rest.v("1").delete_project(myId) @TODO ``` -[See our API reference for more info](https://developers.deepgram.com/reference/on-prem-api) +[See our API reference for more info](https://developers.deepgram.com/reference/on-prem-api). ## Pinning Versions From 616c4c2e46871c133eeaa095b4a40f14a608e25c Mon Sep 17 00:00:00 2001 From: John Vajda Date: Wed, 21 May 2025 15:40:47 -0600 Subject: [PATCH 7/9] simplifies example --- examples/speech-to-text/rest/sync/url/main.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/examples/speech-to-text/rest/sync/url/main.py b/examples/speech-to-text/rest/sync/url/main.py index 51873b5e..03d22420 100644 --- a/examples/speech-to-text/rest/sync/url/main.py +++ b/examples/speech-to-text/rest/sync/url/main.py @@ -40,9 +40,6 @@ def main(): options: PrerecordedOptions = PrerecordedOptions( model="nova-3", smart_format=True, - utterances=True, - punctuate=True, - diarize=True, ) before = datetime.now() From 342f99df44ee955e18b281cd0440e6c9aee27d5d Mon Sep 17 00:00:00 2001 From: John Vajda Date: Thu, 22 May 2025 15:14:15 -0600 Subject: [PATCH 8/9] final updates --- README.md | 107 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 67 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index 8e14a0ba..9a6fa345 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Official Python SDK for [Deepgram](https://www.deepgram.com/). Power your apps w - [Get All Balances](#get-all-balances) - [Get Balance](#get-balance) - [Models](#models) - - [Get All Models](#get-all-models) + - [Get All Project Models](#get-all-project-models) - [Get Model](#get-model) - [On-Prem APIs](#on-prem-apis) - [List On-Prem credentials](#list-on-prem-credentials) @@ -100,8 +100,11 @@ deepgram = DeepgramClient("YOUR_API_KEY") # Replace with your API key Transcribe audio from a URL. ```python + +from deepgram import PrerecordedOptions + response = deepgram.listen.rest.v("1").transcribe_url( - source={"url": "https://dpgr.am/spacewalk.wav"} + source={"url": "https://dpgr.am/spacewalk.wav"}, options=PrerecordedOptions(model="nova-3") # Apply other options ) ``` @@ -115,8 +118,10 @@ response = deepgram.listen.rest.v("1").transcribe_url( Transcribe audio from a file. ```python +from deepgram import PrerecordedOptions + response = deepgram.listen.rest.v("1").transcribe_file( - source=open("path/to/your/audio.wav", "rb") + source=open("path/to/your/audio.wav", "rb"), options=PrerecordedOptions(model="nova-3") # Apply other options ) ``` @@ -132,9 +137,11 @@ response = deepgram.listen.rest.v("1").transcribe_file( Transcribe audio from a URL. ```python +from deepgram import PrerecordedOptions + response = deepgram.listen.rest.v("1").transcribe_url_async( source={"url": "https://dpgr.am/spacewalk.wav"}, - callback_url="https://your-callback-url.com/webhook" + callback_url="https://your-callback-url.com/webhook", options=PrerecordedOptions(model="nova-3") # Apply other options ) ``` @@ -148,9 +155,11 @@ response = deepgram.listen.rest.v("1").transcribe_url_async( Transcribe audio from a file. ```python +from deepgram import PrerecordedOptions + response = deepgram.listen.rest.v("1").transcribe_file_async( source=open("path/to/your/audio.wav", "rb"), - callback_url="https://your-callback-url.com/webhook" + callback_url="https://your-callback-url.com/webhook", options=PrerecordedOptions(model="nova-3") # Apply other options ) ``` @@ -527,142 +536,160 @@ response = deepgram.manage.v("1").update_member_scope(myProjectId, memberId, opt Retrieves all invitations associated with the provided project_id. ```python -@TODO +response = deepgram.manage.v("1").get_invites(myProjectId) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/invites-api). +[See our API reference for more info](https://developers.deepgram.com/reference/management-api/invitations/list). ### Send Invite Sends an invitation to the provided email address. ```python -@TODO +response = deepgram.manage.v("1").send_invite(myProjectId, options) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/invites-api). +[See our API reference for more info](https://developers.deepgram.com/reference/management-api/invitations/create). ### Delete Invite Removes the specified invitation from the project. ```python -@TODO +response = deepgram.manage.v("1").delete_invite(myProjectId, email) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/invites-api). +[See our API reference for more info](https://developers.deepgram.com/reference/management-api/invitations/delete). ### Leave Project ```python -@TODO +response = deepgram.manage.v("1").leave_project(myProjectId) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/projects-api). +[See our API reference for more info](https://developers.deepgram.com/reference/management-api/invitations/leave). ## Usage ### Get All Requests +Retrieves all requests associated with the provided project_id based on the provided options. + ```python -@TODO +response = deepgram.manage.v("1").get_usage_requests(myProjectId) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/requests-api). +[See our API reference for more info](https://developers.deepgram.com/reference/management-api/usage/list-requests). ### Get Request +Retrieves a specific request associated with the provided project_id + ```python -@TODO +response = deepgram.manage.v("1").get_usage_request(myProjectId, RequestId) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/requests-api). +[See our API reference for more info](https://developers.deepgram.com/reference/management-api/usage/get-request). -### Summarize Usage +### Get Fields + +Lists the features, models, tags, languages, and processing method used for requests in the specified project. ```python -@TODO +response = deepgram.manage.v("1").get_usage_fields(myProjectId) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/usage-api). +[See our API reference for more info](https://developers.deepgram.com/reference/management-api/usage/list-fields). -### Get Fields +### Summarize Usage + +`Deprecated` Retrieves the usage for a specific project. Use Get Project Usage Breakdown for a more comprehensive usage summary. ```python -@TODO +response = deepgram.manage.v("1").get_usage_summary(myProjectId) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/usage-api). +[See our API reference for more info](https://developers.deepgram.com/reference/management-api/usage/get). ## Billing ### Get All Balances +Retrieves the list of balance info for the specified project. + ```python -@TODO +response = deepgram.manage.v("1").get_balances(myProjectId) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/balances-api). +[See our API reference for more info](https://developers.deepgram.com/reference/management-api/balances/list). ### Get Balance +Retrieves the balance info for the specified project and balance_id. + ```python -@TODO +response = deepgram.manage.v("1").get_balance(myProjectId) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/balances-api). +[See our API reference for more info](https://developers.deepgram.com/reference/management-api/balances/get). ## Models -### Get All Models +### Get All Project Models + +Retrieves all models available for a given project. ```python -@TODO +response = deepgram.manage.v("1").get_project_models(myProjectId) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/models-api). +[See our API reference for more info](https://developers.deepgram.com/reference/management-api/projects/list-models). ### Get Model +Retrieves details of a specific model. + ```python -@TODO +response = deepgram.manage.v("1").get_project_model(myProjectId, ModelId) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/models-api). +[See our API reference for more info](https://developers.deepgram.com/reference/management-api/projects/get-model). ## On-Prem APIs ### List On-Prem credentials +Lists sets of distribution credentials for the specified project. + ```python -@TODO +response = deepgram.selfhosted.v("1").list_selfhosted_credentials(projectId) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/on-prem-api). +[See our API reference for more info](https://developers.deepgram.com/reference/self-hosted-api/list-credentials). ### Get On-Prem credentials ```python -@TODO +response = deepgram.selfhosted.v("1").get_selfhosted_credentials(projectId, distributionCredentialsId) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/on-prem-api). +[See our API reference for more info](https://developers.deepgram.com/reference/self-hosted-api/get-credentials). ### Create On-Prem credentials ```python -@TODO +response = deepgram.selfhosted.v("1").create_selfhosted_credentials(project_id, options) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/on-prem-api). +[See our API reference for more info](https://developers.deepgram.com/reference/self-hosted-api/create-credentials). ### Delete On-Prem credentials ```python -@TODO +response = deepgram.selfhosted.v("1").delete_selfhosted_credentials(projectId, distributionCredentialId) ``` -[See our API reference for more info](https://developers.deepgram.com/reference/on-prem-api). +[See our API reference for more info](https://developers.deepgram.com/reference/self-hosted-api/delete-credentials). ## Pinning Versions From 6ef34b7d66451cfe0222a4359daadef4069366a8 Mon Sep 17 00:00:00 2001 From: John Vajda Date: Thu, 22 May 2025 17:33:52 -0600 Subject: [PATCH 9/9] Update README.md Co-authored-by: Naomi --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9a6fa345..aa8313a5 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ pip install deepgram-sdk ## Initialization -All the examples below will require `DeepgramClient`. +All of the examples below will require `DeepgramClient`. ```python from deepgram import DeepgramClient