mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +00:00
Fix truncation tests to check output chat history for truncation
New truncation logic return a new message list.
It does not update message list by reference/in place since 8a16f5a2a.
So truncation tests should run verification on the truncated chat
history returned by the truncation func instead of the original chat
history passed into the truncation func.
This commit is contained in:
@@ -817,6 +817,8 @@ def truncate_messages(
|
||||
system_message.append(message)
|
||||
else:
|
||||
non_system_messages.append(message)
|
||||
|
||||
# New message list without system messages
|
||||
messages = non_system_messages
|
||||
|
||||
# Drop older messages until under max supported prompt size by model
|
||||
|
||||
Reference in New Issue
Block a user