AIdeaText commited on
Commit
6357450
verified
1 Parent(s): 6696b10

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
- # Llamar a store_current_situation_result con los argumentos posicionales correctos
194
- # La funci贸n espera username, text, metrics y feedback como argumentos posicionales
195
- result = store_current_situation_result(
 
 
196
  username=username,
197
  text=text,
198
  metrics=metrics,
199
- feedback=recommendations # Usamos recommendations como feedback
 
200
  )
201
 
202
- logger.info(f"Recommendations stored with ID: {result}")
203
- return True
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