adikwok commited on
Commit
d6cad0d
·
verified ·
1 Parent(s): 663780e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -40,8 +40,8 @@ def groq_with_memory(message: str, topic: str = "general", summarize: bool = Fal
40
  # Limit history to max_history messages to avoid token overflow
41
  recent_history = chat_history[-max_history:]
42
 
43
- # Prepare messages for API call
44
- messages = recent_history.copy()
45
 
46
  if summarize:
47
  # Create a prompt to summarize the conversation
 
40
  # Limit history to max_history messages to avoid token overflow
41
  recent_history = chat_history[-max_history:]
42
 
43
+ # Prepare messages for API call, excluding timestamp and topic
44
+ messages = [{"role": msg["role"], "content": msg["content"]} for msg in recent_history]
45
 
46
  if summarize:
47
  # Create a prompt to summarize the conversation