Class ConverseApiUtils

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

public final class ConverseApiUtils extends Object
Amazon Bedrock Converse API utils.
Since:
1.0.0
Author:
Wei Jiang, Christian Tzolov, Alexandros Pappas
  • Method Details

    • convertObjectToDocument

      public static software.amazon.awssdk.core.document.Document convertObjectToDocument(Object value)
    • getRequestMetadata

      public static Map<String,String> getRequestMetadata(Map<String,Object> metadata)
    • convertDocumentToObject

      public static @Nullable Object convertDocumentToObject(@Nullable software.amazon.awssdk.core.document.Document document)
      Converts an AWS SDK Document into a plain Java object (Map, List, String, Boolean, BigDecimal or null).

      This is the inverse of convertObjectToDocument(Object). It lets callers serialize a document to JSON with a real JSON writer instead of relying on Document#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 be null
      Returns:
      the equivalent plain Java object, or null for a null document