Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,7 +17,18 @@ def send_email(api_key, inbox_id, subject, content, from_email, to_email):
|
|
| 17 |
"text": content
|
| 18 |
}
|
| 19 |
response = requests.post(url, headers=headers, json=data)
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
# Fonction pour générer du texte avec Gemini
|
| 23 |
def generate_text_with_gemini(api_key, prompt):
|
|
|
|
| 17 |
"text": content
|
| 18 |
}
|
| 19 |
response = requests.post(url, headers=headers, json=data)
|
| 20 |
+
|
| 21 |
+
# Debug: Print the raw response
|
| 22 |
+
print(f"Response content: {response.text}")
|
| 23 |
+
|
| 24 |
+
# Check if response is empty or not JSON
|
| 25 |
+
try:
|
| 26 |
+
response_json = response.json()
|
| 27 |
+
except ValueError:
|
| 28 |
+
response_json = {}
|
| 29 |
+
|
| 30 |
+
return response.status_code, response_json
|
| 31 |
+
|
| 32 |
|
| 33 |
# Fonction pour générer du texte avec Gemini
|
| 34 |
def generate_text_with_gemini(api_key, prompt):
|