Futuresony commited on
Commit
91cd908
·
verified ·
1 Parent(s): 11f5a85

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -633,12 +633,12 @@ Available: {match.get('Available', 'N/A')}"""
633
 
634
  # --- Update Chat History for Gradio ---
635
  # Append the user's original message and the final bot response to the history state
636
- chat_history = chat_history + [(original_user_input, final_response)]
637
 
638
  # Optional: Manage history length
639
- max_history_pairs = 10 # Keep last 10 turns (20 messages total)
640
- if len(chat_history) > max_history_pairs:
641
- chat_history = chat_history[-max_history_pairs:]
642
  # print(f"History truncated. Keeping last {len(chat_history)} turns.") # Debug print
643
 
644
  # Return the updated history state
 
633
 
634
  # --- Update Chat History for Gradio ---
635
  # Append the user's original message and the final bot response to the history state
636
+ chat_history = chat_history + [(original_user_input, final_response)]
637
 
638
  # Optional: Manage history length
639
+ max_history_pairs = 10 # Keep last 10 turns (20 messages total)
640
+ if len(chat_history) > max_history_pairs:
641
+ chat_history = chat_history[-max_history_pairs:]
642
  # print(f"History truncated. Keeping last {len(chat_history)} turns.") # Debug print
643
 
644
  # Return the updated history state