Merge pull request #675 from danielaskdd/Fix-get_conversation_turns

Fix get conversation turns
This commit is contained in:
zrguo
2025-01-30 20:36:59 +08:00
committed by GitHub
2 changed files with 28 additions and 50 deletions

View File

@@ -655,7 +655,7 @@ def get_conversation_turns(conversation_history: list[dict], num_turns: int) ->
else:
turn = [msg1, msg2] # user, assistant
turns.append(turn)
i += 1
i += 2
# Keep only the most recent num_turns
if len(turns) > num_turns: