Class BedrockMediaFormat
java.lang.Object
org.springframework.ai.bedrock.converse.api.BedrockMediaFormat
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
Modifier and TypeFieldDescriptionstatic 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
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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)
-
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
-
isSupportedDocumentFormat
-
getDocumentFormat
public static software.amazon.awssdk.services.bedrockruntime.model.DocumentFormat getDocumentFormat(org.springframework.util.MimeType mimeType) -
isSupportedImageFormat
-
getImageFormat
public static software.amazon.awssdk.services.bedrockruntime.model.ImageFormat getImageFormat(org.springframework.util.MimeType mimeType) -
isSupportedVideoFormat
-
getVideoFormat
public static software.amazon.awssdk.services.bedrockruntime.model.VideoFormat getVideoFormat(org.springframework.util.MimeType mimeType)
-