Class BedrockMediaFormat

java.lang.Object
org.springframework.ai.bedrock.converse.api.BedrockMediaFormat

public abstract class BedrockMediaFormat extends Object
The BedrockMediaFormat class provides mappings between MIME types and their corresponding Bedrock media formats for documents, images, and videos. It supports conversion of MIME types to specific formats used by the Bedrock runtime.

Supported document formats include PDF, CSV, DOC, DOCX, XLS, XLSX, HTML, TXT, and MD. Supported image formats include JPEG, PNG, GIF, and WEBP. Supported video formats include MKV, MOV, MP4, WEBM, FLV, MPEG, MPG, WMV, and 3GP.

Usage example:

     String format = BedrockMediaFormat.getFormatAsString(Media.Format.DOC_PDF);
 

Throws IllegalArgumentException if the MIME type is unsupported.

Since:
1.0.0
Author:
Christian Tzolov
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Map<org.springframework.util.MimeType,software.amazon.awssdk.services.bedrockruntime.model.DocumentFormat>
     
    static final Map<org.springframework.util.MimeType,software.amazon.awssdk.services.bedrockruntime.model.ImageFormat>
     
    static final Map<org.springframework.util.MimeType,software.amazon.awssdk.services.bedrockruntime.model.VideoFormat>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static software.amazon.awssdk.services.bedrockruntime.model.DocumentFormat
    getDocumentFormat(org.springframework.util.MimeType mimeType)
     
    static String
    getFormatAsString(org.springframework.util.MimeType mimeType)
     
    static software.amazon.awssdk.services.bedrockruntime.model.ImageFormat
    getImageFormat(org.springframework.util.MimeType mimeType)
     
    static software.amazon.awssdk.services.bedrockruntime.model.VideoFormat
    getVideoFormat(org.springframework.util.MimeType mimeType)
     
    static Boolean
    isSupportedDocumentFormat(org.springframework.util.MimeType mimeType)
     
    static Boolean
    isSupportedImageFormat(org.springframework.util.MimeType mimeType)
     
    static Boolean
    isSupportedVideoFormat(org.springframework.util.MimeType mimeType)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DOCUMENT_MAP

      public static final Map<org.springframework.util.MimeType,software.amazon.awssdk.services.bedrockruntime.model.DocumentFormat> DOCUMENT_MAP
    • IMAGE_MAP

      public static final Map<org.springframework.util.MimeType,software.amazon.awssdk.services.bedrockruntime.model.ImageFormat> IMAGE_MAP
    • VIDEO_MAP

      public static final Map<org.springframework.util.MimeType,software.amazon.awssdk.services.bedrockruntime.model.VideoFormat> VIDEO_MAP
  • Constructor Details

    • BedrockMediaFormat

      public BedrockMediaFormat()
  • Method Details

    • getFormatAsString

      public static String getFormatAsString(org.springframework.util.MimeType mimeType)
    • isSupportedDocumentFormat

      public static Boolean isSupportedDocumentFormat(org.springframework.util.MimeType mimeType)
    • getDocumentFormat

      public static software.amazon.awssdk.services.bedrockruntime.model.DocumentFormat getDocumentFormat(org.springframework.util.MimeType mimeType)
    • isSupportedImageFormat

      public static Boolean isSupportedImageFormat(org.springframework.util.MimeType mimeType)
    • getImageFormat

      public static software.amazon.awssdk.services.bedrockruntime.model.ImageFormat getImageFormat(org.springframework.util.MimeType mimeType)
    • isSupportedVideoFormat

      public static Boolean isSupportedVideoFormat(org.springframework.util.MimeType mimeType)
    • getVideoFormat

      public static software.amazon.awssdk.services.bedrockruntime.model.VideoFormat getVideoFormat(org.springframework.util.MimeType mimeType)