Class BedrockSystemMessage.Builder
java.lang.Object
dev.langchain4j.model.bedrock.BedrockSystemMessage.Builder
- Enclosing class:
BedrockSystemMessage
Builder for
BedrockSystemMessage.- Since:
- 1.11.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddContent(BedrockSystemContent content) Adds a content block.Adds text content WITHOUT cache point.addTextWithCachePoint(String text) Adds text content WITH cache point marker.build()Builds the message.contents(List<BedrockSystemContent> contents) Sets all content blocks (replaces any existing).
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
contents
Sets all content blocks (replaces any existing).- Parameters:
contents- the content blocks (1-10 blocks, no nulls)- Returns:
- this builder
- Throws:
IllegalArgumentException- if contents is null, empty, has nulls, or exceeds max
-
addContent
Adds a content block.- Parameters:
content- the content block- Returns:
- this builder
- Throws:
IllegalArgumentException- if content is null or max blocks exceeded
-
addText
Adds text content WITHOUT cache point.- Parameters:
text- the text content- Returns:
- this builder
- Throws:
IllegalArgumentException- if text is null or blank
-
addTextWithCachePoint
Adds text content WITH cache point marker. A cache point will be inserted after this content in the Bedrock request.Note: For caching to activate, content should be at least ~1,024 tokens.
- Parameters:
text- the text content- Returns:
- this builder
- Throws:
IllegalArgumentException- if text is null or blank
-
build
-