Spaces:
Sleeping
Sleeping
Update modules/studentact/claude_recommendations.py
Browse files
modules/studentact/claude_recommendations.py
CHANGED
|
@@ -185,26 +185,35 @@ def get_fallback_recommendations(lang_code):
|
|
| 185 |
We suggest using Morphosyntactic Analysis to identify patterns in your sentence structure.
|
| 186 |
"""
|
| 187 |
|
|
|
|
|
|
|
|
|
|
| 188 |
def store_recommendations(username, text, metrics, text_type, recommendations):
|
| 189 |
"""
|
| 190 |
Store the recommendations in the database
|
| 191 |
"""
|
| 192 |
try:
|
| 193 |
-
#
|
| 194 |
-
|
| 195 |
-
|
|
|
|
|
|
|
| 196 |
username=username,
|
| 197 |
text=text,
|
| 198 |
metrics=metrics,
|
| 199 |
-
|
|
|
|
| 200 |
)
|
| 201 |
|
| 202 |
-
logger.info(f"Recommendations stored
|
| 203 |
-
return
|
| 204 |
except Exception as e:
|
| 205 |
logger.error(f"Error storing recommendations: {str(e)}")
|
| 206 |
return False
|
| 207 |
|
|
|
|
|
|
|
|
|
|
| 208 |
def display_personalized_recommendations(text, metrics, text_type, lang_code, t):
|
| 209 |
"""
|
| 210 |
Display personalized recommendations based on text analysis
|
|
|
|
| 185 |
We suggest using Morphosyntactic Analysis to identify patterns in your sentence structure.
|
| 186 |
"""
|
| 187 |
|
| 188 |
+
|
| 189 |
+
#######################################
|
| 190 |
+
|
| 191 |
def store_recommendations(username, text, metrics, text_type, recommendations):
|
| 192 |
"""
|
| 193 |
Store the recommendations in the database
|
| 194 |
"""
|
| 195 |
try:
|
| 196 |
+
# Importar la funci贸n de almacenamiento de recomendaciones
|
| 197 |
+
from ..database.claude_recommendations_mongo_db import store_claude_recommendation
|
| 198 |
+
|
| 199 |
+
# Guardar usando la nueva funci贸n especializada
|
| 200 |
+
result = store_claude_recommendation(
|
| 201 |
username=username,
|
| 202 |
text=text,
|
| 203 |
metrics=metrics,
|
| 204 |
+
text_type=text_type,
|
| 205 |
+
recommendations=recommendations
|
| 206 |
)
|
| 207 |
|
| 208 |
+
logger.info(f"Recommendations stored successfully: {result}")
|
| 209 |
+
return result
|
| 210 |
except Exception as e:
|
| 211 |
logger.error(f"Error storing recommendations: {str(e)}")
|
| 212 |
return False
|
| 213 |
|
| 214 |
+
|
| 215 |
+
##########################################
|
| 216 |
+
##########################################
|
| 217 |
def display_personalized_recommendations(text, metrics, text_type, lang_code, t):
|
| 218 |
"""
|
| 219 |
Display personalized recommendations based on text analysis
|