gagannarula commited on
Commit
93182a6
·
verified ·
1 Parent(s): 5c74a59

Dont clip conversation to max turns, just warn the user

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -204,10 +204,11 @@ def get_response(chatbot_history: list[dict], audio_input: str) -> list[dict]:
204
  # Format the full prompt with conversation history
205
  if len(conversation_context) > 2: # More than just the current query
206
  # Include previous turns (limit to last MAX_HISTORY_TURNS exchanges)
207
- recent_context = conversation_context[
208
- -(MAX_HISTORY_TURNS + 1) : -1
209
- ] # Exclude current message
210
-
 
211
  full_prompt = (
212
  "Previous conversation:\n"
213
  + "\n".join(recent_context)
 
204
  # Format the full prompt with conversation history
205
  if len(conversation_context) > 2: # More than just the current query
206
  # Include previous turns (limit to last MAX_HISTORY_TURNS exchanges)
207
+ # recent_context = conversation_context[
208
+ # -(MAX_HISTORY_TURNS + 1) : -1
209
+ # ] # Exclude current message
210
+ recent_context = conversation_context
211
+
212
  full_prompt = (
213
  "Previous conversation:\n"
214
  + "\n".join(recent_context)