Skip to content

Commit

Permalink
chore: throw if no api key
Browse files Browse the repository at this point in the history
  • Loading branch information
NagariaHussain committed Dec 6, 2024
1 parent 2f20f32 commit 5b0dec6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions listen_to_blog/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
def get_elevenlabs_client():
api_key = frappe.get_cached_doc("ElevenLabs Settings").get_password("api_key")

if not api_key:
frappe.throw("Please set your API Key in ElevenLabs Settings before generating audio!")

return ElevenLabs(api_key=api_key)

0 comments on commit 5b0dec6

Please sign in to comment.