Class ConverseApiUtils
java.lang.Object
org.springframework.ai.bedrock.converse.api.ConverseApiUtils
Amazon Bedrock Converse API utils.
- Since:
- 1.0.0
- Author:
- Wei Jiang, Christian Tzolov, Alexandros Pappas
-
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable ObjectconvertDocumentToObject(@Nullable software.amazon.awssdk.core.document.Document document) Converts an AWS SDKDocumentinto a plain Java object (Map,List,String,Boolean,BigDecimalornull).static software.amazon.awssdk.core.document.DocumentconvertObjectToDocument(Object value) getRequestMetadata(Map<String, Object> metadata)
-
Method Details
-
convertObjectToDocument
-
getRequestMetadata
-
convertDocumentToObject
public static @Nullable Object convertDocumentToObject(@Nullable software.amazon.awssdk.core.document.Document document) Converts an AWS SDKDocumentinto a plain Java object (Map,List,String,Boolean,BigDecimalornull).This is the inverse of
convertObjectToDocument(Object). It lets callers serialize a document to JSON with a real JSON writer instead of relying onDocument#toString(), whose output is not valid JSON (for example, it does not escape control characters such as newlines inside string values).- Parameters:
document- the document to convert, may benull- Returns:
- the equivalent plain Java object, or
nullfor a null document
-