Class ImageMessage

java.lang.Object
org.springframework.ai.image.ImageMessage
All Implemented Interfaces:
Content, MediaContent

public class ImageMessage extends Object implements MediaContent
  • Constructor Details

    • ImageMessage

      public ImageMessage(String text)
    • ImageMessage

      public ImageMessage(String text, @Nullable Float weight)
    • ImageMessage

      public ImageMessage(String text, @Nullable Float weight, Collection<Media> media, Map<String,Object> metadata)
      Create a new ImageMessage.
      Parameters:
      text - the text of the message
      weight - the weight of the message, or null if not set
      media - the media associated with the message
      metadata - the metadata associated with the message
      Since:
      2.0.1
  • Method Details

    • getText

      public String getText()
      Description copied from interface: Content
      Get the content of the message.
      Specified by:
      getText in interface Content
      Returns:
      the content of the message
    • getWeight

      public @Nullable Float getWeight()
    • getMedia

      public List<Media> getMedia()
      Description copied from interface: MediaContent
      Get the media associated with the content.
      Specified by:
      getMedia in interface MediaContent
    • getMetadata

      public Map<String,Object> getMetadata()
      Description copied from interface: Content
      Get the metadata associated with the content.
      Specified by:
      getMetadata in interface Content
      Returns:
      the metadata associated with the content
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object