Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion haystack/preview/dataclasses/byte_stream.py
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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)
Comment on lines +14 to 15

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the difference between = None and field(default=None)?

(Excuse my ignorance...)


def to_file(self, destination_path: Path):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
preview:
- Introduces a `path` optional field to ByteStream.