Update app.py
Browse files
app.py
CHANGED
|
@@ -150,8 +150,13 @@ SUCCESSFUL EXAMPLES OF THE {selected_angle} ANGLE:
|
|
| 150 |
|
| 151 |
email_instruction += ".\n\n"
|
| 152 |
|
| 153 |
-
# Agregar ejemplos de la fórmula
|
| 154 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 155 |
|
| 156 |
email_instruction += "FORMULA EXAMPLES TO STUDY (ONLY FOR STRUCTURE, NOT CONTENT):\n"
|
| 157 |
for i, example in enumerate(examples_to_use, 1):
|
|
|
|
| 150 |
|
| 151 |
email_instruction += ".\n\n"
|
| 152 |
|
| 153 |
+
# Agregar ejemplos de la fórmula - MODIFIED to select random examples
|
| 154 |
+
if len(selected_formula['examples']) > 2:
|
| 155 |
+
# Select 2 random examples if there are more than 2 available
|
| 156 |
+
examples_to_use = random.sample(selected_formula['examples'], 2)
|
| 157 |
+
else:
|
| 158 |
+
# Use all available examples if there are 2 or fewer
|
| 159 |
+
examples_to_use = selected_formula['examples']
|
| 160 |
|
| 161 |
email_instruction += "FORMULA EXAMPLES TO STUDY (ONLY FOR STRUCTURE, NOT CONTENT):\n"
|
| 162 |
for i, example in enumerate(examples_to_use, 1):
|