mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 16:54:59 +00:00
Expand the tail to ensure head ends with assistant msg
This commit is contained in:
parent
4b41eb7525
commit
f0ec6cb36a
1 changed files with 3 additions and 3 deletions
|
@ -49,8 +49,8 @@ class ChatSummary:
|
|||
break
|
||||
|
||||
# Ensure the head ends with an assistant message
|
||||
while messages[split_index - 1]["role"] != "assistant" and split_index < len(messages):
|
||||
split_index += 1
|
||||
while messages[split_index - 1]["role"] != "assistant" and split_index > 1:
|
||||
split_index -= 1
|
||||
|
||||
head = messages[:split_index]
|
||||
tail = messages[split_index:]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue