yangdx
commited on
Commit
·
ba53a0e
1
Parent(s):
bf73d58
Fix loop step from 1 to 2 in get_conversation_turns, ensure user-assistant pairing
Browse files- lightrag/utils.py +1 -1
lightrag/utils.py
CHANGED
|
@@ -655,7 +655,7 @@ def get_conversation_turns(conversation_history: list[dict], num_turns: int) ->
|
|
| 655 |
else:
|
| 656 |
turn = [msg1, msg2] # user, assistant
|
| 657 |
turns.append(turn)
|
| 658 |
-
i +=
|
| 659 |
|
| 660 |
# Keep only the most recent num_turns
|
| 661 |
if len(turns) > num_turns:
|
|
|
|
| 655 |
else:
|
| 656 |
turn = [msg1, msg2] # user, assistant
|
| 657 |
turns.append(turn)
|
| 658 |
+
i += 2
|
| 659 |
|
| 660 |
# Keep only the most recent num_turns
|
| 661 |
if len(turns) > num_turns:
|