Enum Class BedrockCachePointPlacement

java.lang.Object
java.lang.Enum<BedrockCachePointPlacement>
dev.langchain4j.model.bedrock.BedrockCachePointPlacement
All Implemented Interfaces:
Serializable, Comparable<BedrockCachePointPlacement>, Constable

public enum BedrockCachePointPlacement extends Enum<BedrockCachePointPlacement>
Enum representing where to place cache points in the conversation.

AWS Bedrock Caching Requirements:

  • Minimum tokens: ~1,024 tokens required for caching to activate
  • Cache TTL: 5-minute default, resets on each cache hit
  • Supported models: Only Claude 3.x and Amazon Nova models

Note on BedrockSystemMessage: When using BedrockSystemMessage with granular cache points, the AFTER_SYSTEM placement is ignored for BedrockSystemMessage instances. Granular cache points defined within BedrockSystemMessage take precedence. The AFTER_SYSTEM placement only applies when the LAST system-type message is a core SystemMessage.

See Also:
  • Enum Constant Details

    • AFTER_SYSTEM

      public static final BedrockCachePointPlacement AFTER_SYSTEM
      Cache point after system messages.

      Only applies when the LAST system-type message is a core SystemMessage. Ignored when the last system message is a BedrockSystemMessage (which uses its own granular cache points).

    • AFTER_USER_MESSAGE

      public static final BedrockCachePointPlacement AFTER_USER_MESSAGE
      Cache point after first user message.
    • AFTER_TOOLS

      public static final BedrockCachePointPlacement AFTER_TOOLS
      Cache point after tool definitions.
  • Method Details

    • values

      public static BedrockCachePointPlacement[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static BedrockCachePointPlacement valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null