Skip to content

Commit

Permalink
Deepgram python 402 condition (#410)
Browse files Browse the repository at this point in the history
* docs: updating wording and adding new gif

wording and new gif

* docs: adding extensions image

* docs: updating the wording.

* docs: Fixing the link of FishAudio

Fixing the link of FishAudio

* feat: Adding Deepgram 402 condition
  • Loading branch information
cyfyifanchen authored Nov 15, 2024
1 parent efc2b2f commit 653e9f0
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,12 @@ async def on_error(self, error, **kwargs):
interim_results=self.config.interim_results,
punctuate=self.config.punctuate)
# connect to websocket
if await self.deepgram_client.start(options) is False:
logger.error(f"failed to connect to deepgram")
result = await self.deepgram_client.start(options)
if result is False:
if self.deepgram_client.status_code == 402:
logger.error("Failed to connect to Deepgram - your account has run out of credits.")
else:
logger.error("Failed to connect to Deepgram")
return

logger.info(f"successfully connected to deepgram")
Expand Down

0 comments on commit 653e9f0

Please sign in to comment.