diff --git a/haystack/preview/dataclasses/byte_stream.py b/haystack/preview/dataclasses/byte_stream.py index dd84e1c26b..d3597a5b47 100644 --- a/haystack/preview/dataclasses/byte_stream.py +++ b/haystack/preview/dataclasses/byte_stream.py @@ -1,6 +1,6 @@ from dataclasses import dataclass, field from pathlib import Path -from typing import Optional, Dict, Any +from typing import Dict, Any, Optional, Union @dataclass(frozen=True) @@ -11,6 +11,7 @@ class ByteStream: data: bytes metadata: Dict[str, Any] = field(default_factory=dict, hash=False) + path: Optional[Union[str, Path]] = None mime_type: Optional[str] = field(default=None) def to_file(self, destination_path: Path): diff --git a/releasenotes/notes/path-for-bytestream-7d9b768254707f1f.yaml b/releasenotes/notes/path-for-bytestream-7d9b768254707f1f.yaml new file mode 100644 index 0000000000..542b03f115 --- /dev/null +++ b/releasenotes/notes/path-for-bytestream-7d9b768254707f1f.yaml @@ -0,0 +1,2 @@ +preview: + - Introduces a `path` optional field to ByteStream.