Skip to content

Commit

Permalink
Update the eviction policy for chat history.
Browse files Browse the repository at this point in the history
  • Loading branch information
530051970 committed Feb 13, 2025
1 parent b1533a5 commit b4f5ad9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ def common_entry(event_body):
use_history = chatbot_config["use_history"]
max_rounds_in_memory = event_body["chatbot_config"]["max_rounds_in_memory"]
# if(len(event_body["chat_history"])<=2*max_rounds_in_memory)
chat_history = event_body["chat_history"] if len(event_body["chat_history"])<=2*max_rounds_in_memory else event_body["chat_history"][-2*max_rounds_in_memory:] if use_history else []
chat_history = event_body["chat_history"][-2*max_rounds_in_memory:] if use_history else []
stream = event_body["stream"]
message_id = event_body["custom_message_id"]
ws_connection_id = event_body["ws_connection_id"]
Expand Down

0 comments on commit b4f5ad9

Please sign in to comment.