mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-29 06:33:28 +00:00
fix(guardrails): preserve the existing stream sink value types
This commit is contained in:
parent
95348ba610
commit
c99cc59dda
1 changed files with 4 additions and 4 deletions
|
|
@ -31,12 +31,12 @@ class StreamTransformSink:
|
|||
single call, not shared state.
|
||||
"""
|
||||
|
||||
mutated_text_per_choice: Mapping[int, str] = field(default_factory=dict)
|
||||
holdback_per_choice: Mapping[int, int] = field(default_factory=dict)
|
||||
mutated_text_per_choice: dict[int, str] = field(default_factory=dict)
|
||||
holdback_per_choice: dict[int, int] = field(default_factory=dict)
|
||||
|
||||
def record(self, texts: Mapping[int, str], holdback: Mapping[int, int]) -> None:
|
||||
self.mutated_text_per_choice = texts
|
||||
self.holdback_per_choice = holdback
|
||||
self.mutated_text_per_choice = dict(texts)
|
||||
self.holdback_per_choice = dict(holdback)
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue