class_docstr: Base data class representing a binary object in the Haystack API.
docstr: Create a ByteStream from the contents read from a file.
  
  :param filepath: A valid path to a file.
docstr_tok: ["Create","a","ByteStream","from","the","contents","read","from","a","file",".",":","param","filepath",":","A","valid","path","to","a","file","."]
code: def from_file_path(
      cls, filepath: Path, mime_type: Optional[str] = None
  ) -> "ByteStream":
      """
      Create a ByteStream from the contents read from a file.
  
      :param filepath: A valid path to a file.
      """
      with open(filepath, "rb") as fd:
          return cls(data=fd.read(), mime_type=mime_type)
  
imports: from dataclasses import dataclass, field
  from pathlib import Path
  from typing import Optional, Dict, Any
label_desc: Use image node_id 2 for calling the ByteStream obj's underlying member method code with example usage: obj.from_file_path(cls, filepath, mime_type) and returns: cls