Class BedrockGuardrailConfiguration.Builder
java.lang.Object
dev.langchain4j.model.bedrock.BedrockGuardrailConfiguration.Builder
- Enclosing class:
BedrockGuardrailConfiguration
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()guardContentPlacement(BedrockGuardContentPlacement guardContentPlacement) Sets which user messages the guardrail evaluates as input, by wrapping them in Bedrock ConverseguardContentblocks.guardrailIdentifier(String guardrailIdentifier) Sets the identifier for the guardrail.guardrailVersion(String guardrailVersion) Sets the version of the guardrail.streamProcessingMode(BedrockGuardrailConfiguration.ProcessingMode streamProcessingMode) Sets the processing mode for converse streaming.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
guardrailIdentifier
Sets the identifier for the guardrail.- Parameters:
guardrailIdentifier- The identifier for the guardrail.- Returns:
- this builder
-
guardrailVersion
Sets the version of the guardrail.- Parameters:
guardrailVersion- The version of the guardrail.- Returns:
- this builder
-
streamProcessingMode
public BedrockGuardrailConfiguration.Builder streamProcessingMode(BedrockGuardrailConfiguration.ProcessingMode streamProcessingMode) Sets the processing mode for converse streaming. See Configure streaming response behavior.- Parameters:
streamProcessingMode- The processing mode.- Returns:
- this builder
-
guardContentPlacement
public BedrockGuardrailConfiguration.Builder guardContentPlacement(BedrockGuardContentPlacement guardContentPlacement) Sets which user messages the guardrail evaluates as input, by wrapping them in Bedrock ConverseguardContentblocks.When not set, the guardrail evaluates all user and AI messages. When set, the guardrail evaluates only the selected user messages as input: other user messages and AI messages are not evaluated. The model response is still evaluated. See
BedrockGuardContentPlacementfor details.- Parameters:
guardContentPlacement- the guard content placement;nullmeans all user and AI messages are evaluated- Returns:
- this builder
-
build
-