AIdeaText commited on
Commit
19b5d98
verified
1 Parent(s): b520edc

Update modules/studentact/student_activities_v2.py

Browse files
modules/studentact/student_activities_v2.py CHANGED
@@ -146,7 +146,13 @@ def display_discourse_activities(username: str, t: dict):
146
  def display_chat_activities(username: str, t: dict):
147
  """Muestra historial de conversaciones del chat"""
148
  try:
149
- chat_history = get_chat_history(username, limit=50)
 
 
 
 
 
 
150
  if not chat_history:
151
  st.info(t.get('no_chat_history', 'No hay conversaciones registradas'))
152
  return
@@ -156,9 +162,12 @@ def display_chat_activities(username: str, t: dict):
156
  f"{t.get('chat_date', 'Fecha de conversaci贸n')}: {chat['timestamp']}",
157
  expanded=False
158
  ):
159
- for message in chat['messages']:
160
- with st.chat_message(message["role"]):
161
- st.markdown(message["content"])
 
 
 
162
 
163
  except Exception as e:
164
  logger.error(f"Error mostrando historial del chat: {str(e)}")
 
146
  def display_chat_activities(username: str, t: dict):
147
  """Muestra historial de conversaciones del chat"""
148
  try:
149
+ # Obtener historial con tipo por defecto 'sidebar'
150
+ chat_history = get_chat_history(
151
+ username=username,
152
+ analysis_type='sidebar',
153
+ limit=50
154
+ )
155
+
156
  if not chat_history:
157
  st.info(t.get('no_chat_history', 'No hay conversaciones registradas'))
158
  return
 
162
  f"{t.get('chat_date', 'Fecha de conversaci贸n')}: {chat['timestamp']}",
163
  expanded=False
164
  ):
165
+ if 'messages' in chat:
166
+ for message in chat['messages']:
167
+ with st.chat_message(message["role"]):
168
+ st.markdown(message["content"])
169
+ else:
170
+ st.warning(t.get('invalid_chat_format', 'Formato de chat no v谩lido'))
171
 
172
  except Exception as e:
173
  logger.error(f"Error mostrando historial del chat: {str(e)}")