mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 16:25:00 +00:00
style: Remove trailing whitespace in sendchat.py
This commit is contained in:
parent
7e5e180000
commit
73bc0f6258
1 changed files with 4 additions and 4 deletions
|
@ -23,18 +23,18 @@ def sanity_check_messages(messages):
|
|||
Returns True if valid, False otherwise."""
|
||||
last_role = None
|
||||
last_non_system_role = None
|
||||
|
||||
|
||||
for msg in messages:
|
||||
role = msg.get("role")
|
||||
if role == "system":
|
||||
continue
|
||||
|
||||
|
||||
if last_role and role == last_role:
|
||||
return False
|
||||
|
||||
|
||||
last_role = role
|
||||
last_non_system_role = role
|
||||
|
||||
|
||||
# Ensure last non-system message is from user
|
||||
return last_non_system_role == "user"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue