mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-26 01:12:21 +00:00
fix: reset _repeated_messages_count on empty-choices early return
Address Greptile review: the adjacent null-content guard resets _repeated_messages_count = 1 before returning, but the new empty-choices guard did not. Add the reset for consistency so metadata chunks don't leave a stale counter that could affect repetition detection on the next real content chunk.
This commit is contained in:
parent
edf4b885ba
commit
a552da9ad2
1 changed files with 1 additions and 0 deletions
|
|
@ -270,6 +270,7 @@ class CustomStreamWrapper:
|
|||
return
|
||||
|
||||
if not self.chunks[-1].choices or not self.chunks[-2].choices:
|
||||
self._repeated_messages_count = 1
|
||||
return
|
||||
|
||||
last_content = self.chunks[-1].choices[0].delta.content
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue