Himel09 commited on
Commit
b196f1b
·
verified ·
1 Parent(s): 4fdb203

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -31,7 +31,7 @@ def translation_to_French(api_key, text):
31
  if not response_translation or not response_translation.candidates:
32
  return "Error: No translation returned from Gemini API.", None
33
 
34
- translated = response_translation.candidates[0].content.strip()
35
 
36
  # Pronunciation prompt
37
  pronunciation_prompt = (
@@ -51,7 +51,7 @@ def translation_to_French(api_key, text):
51
  if not response_pronunciation or not response_pronunciation.candidates:
52
  return translated, "Error: No pronunciation returned from Gemini API."
53
 
54
- pronunciation = response_pronunciation.candidates[0].content.strip()
55
 
56
  return translated, pronunciation
57
 
 
31
  if not response_translation or not response_translation.candidates:
32
  return "Error: No translation returned from Gemini API.", None
33
 
34
+ translated = response_translation.text.strip()
35
 
36
  # Pronunciation prompt
37
  pronunciation_prompt = (
 
51
  if not response_pronunciation or not response_pronunciation.candidates:
52
  return translated, "Error: No pronunciation returned from Gemini API."
53
 
54
+ pronunciation = response_pronunciation.text.strip()
55
 
56
  return translated, pronunciation
57