Skip to content

feat: add to_dict/from_dict to ByteStream #9543

@Amnah199

Description

@Amnah199

Is your feature request related to a problem? Please describe.
Currently, ByteStream and StreamingChunk are the only dataclasses that do not support serialization and deserialization. This creates inconsistencies and potential failures when these classes are used as inputs to breakpoints, which rely on schema utility functions to serialize and deserialize component inputs.
Without proper support, passing instances of these classes through breakpoint logic can lead to unexpected errors.

Note: StreamingChunk has lower priority for this task since it's never returned by any of our components as output so will probably not need to be serialized/deserialized.

Relevant discussion: Comment by @sjrl on PR #9526

Solution you'd like
Add proper to_dict and from_dict methods to both ByteStream and StreamingChunk, ensuring all dataclasses follow a consistent serialization interface.

Metadata

Metadata

Assignees

Labels

P1High priority, add to the next sprint

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions