mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 01:35:00 +00:00
Updated patch to avoid KeyError on malformed dict
This commit is contained in:
parent
421bc93765
commit
92f6d31f33
1 changed files with 1 additions and 1 deletions
|
@ -60,7 +60,7 @@ def ensure_alternating_roles(messages):
|
|||
prev_role = None
|
||||
|
||||
for msg in messages:
|
||||
current_role = msg['role']
|
||||
current_role = msg.get('role') # Get 'role', None if missing
|
||||
|
||||
# If the current role is the same as the previous, insert an empty message of the opposite role
|
||||
if current_role == prev_role:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue