Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Rithvik Nishad <[email protected]>
  • Loading branch information
Ashesh3 and rithviknishad authored Feb 11, 2024
1 parent ecb6272 commit 4c07449
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ayushma/models/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class STTEngine(IntegerChoices):


class TTSEngine(IntegerChoices):
OPENAI = 1
GOOGLE = 2
OPENAI = (1, "openai")
GOOGLE = (2, "google")


class FeedBackRating(IntegerChoices):
Expand Down
4 changes: 2 additions & 2 deletions ayushma/utils/language_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def text_to_speech(text, language_code, service):

text = sanitize_text(text)

if service == "google":
if service == TTSEngine.GOOGLE:
client = texttospeech.TextToSpeechClient()

synthesis_input = texttospeech.SynthesisInput(text=text)
Expand All @@ -66,7 +66,7 @@ def text_to_speech(text, language_code, service):
)

return response.audio_content
elif service == "openai":
elif service == TTSEngine.OPENAI:
client = OpenAI(api_key=settings.OPENAI_API_KEY)
response = client.audio.speech.create(
model="tts-1-hd",
Expand Down

0 comments on commit 4c07449

Please sign in to comment.