class_docstr: Image type returned by the agent. Behaves as a PIL.Image.
class_docstr_tok: ["Image","type","returned","by","the","agent",".","Behaves","as","a","PIL.Image","."]
code: def __init__(self, value):
      super().__init__(value)
  
      if not is_vision_available():
          raise ImportError(
              "PIL must be installed in order to handle images."
          )
  
      self._path = None
      self._raw = None
      self._tensor = None
  
      if isinstance(value, ImageType):
          self._raw = value
      elif isinstance(value, (str, pathlib.Path)):
          self._path = value
      elif isinstance(value, torch.Tensor):
          self._tensor = value
      else:
          raise ValueError(
              f"Unsupported type for {self.__class__.__name__}: {type(value)}"
          )
  
imports: import os
  import pathlib
  import tempfile
  import uuid
  import numpy
  from ..utils import is_soundfile_availble, is_torch_available, is_vision_available, logging
label_desc: Use image node_id 1 to create a new AgentImage object from inherited base classes: AgentType, ImageType with example: obj = AgentImage(value)