fix(guardrails): preserve the existing stream sink value types

This commit is contained in:
albertbausili 2026-10-16 09:43:10 +02:00
parent 95348ba610
commit c99cc59dda

View file

@ -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)