Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,13 @@
"CamelAwsBedrockConverseUsage": { "index": 13, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "TokenUsage", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The usage metrics from Converse API response", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#CONVERSE_USAGE" },
"CamelAwsBedrockConverseOutputMessage": { "index": 14, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Message", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The output message from Converse API response", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#CONVERSE_OUTPUT_MESSAGE" },
"CamelAwsBedrockGuardrailConfig": { "index": 15, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "GuardrailConfiguration", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The guardrail configuration to apply to the request", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#GUARDRAIL_CONFIG" },
"CamelAwsBedrockGuardrailContent": { "index": 16, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "List<GuardrailContentBlock>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The content blocks for ApplyGuardrail operation", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#GUARDRAIL_CONTENT" },
"CamelAwsBedrockGuardrailSource": { "index": 17, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The source type for ApplyGuardrail operation (INPUT or OUTPUT)", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#GUARDRAIL_SOURCE" },
"CamelAwsBedrockGuardrailOutput": { "index": 18, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "GuardrailAssessment", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The guardrail assessment output from the response", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#GUARDRAIL_OUTPUT" },
"CamelAwsBedrockGuardrailTrace": { "index": 19, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "GuardrailTrace", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The trace information from guardrail evaluation", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#GUARDRAIL_TRACE" },
"CamelAwsBedrockGuardrailAssessments": { "index": 20, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "List<GuardrailAssessment>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The guardrail assessments from ApplyGuardrail response", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#GUARDRAIL_ASSESSMENTS" },
"CamelAwsBedrockGuardrailUsage": { "index": 21, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "GuardrailUsage", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The guardrail usage metrics from ApplyGuardrail response", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#GUARDRAIL_USAGE" }
"CamelAwsBedrockGuardrailIdentifier": { "index": 16, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The guardrail identifier to use for the ApplyGuardrail operation", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#GUARDRAIL_IDENTIFIER" },
"CamelAwsBedrockGuardrailContent": { "index": 17, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "List<GuardrailContentBlock>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The content blocks for ApplyGuardrail operation", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#GUARDRAIL_CONTENT" },
"CamelAwsBedrockGuardrailSource": { "index": 18, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The source type for ApplyGuardrail operation (INPUT or OUTPUT)", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#GUARDRAIL_SOURCE" },
"CamelAwsBedrockGuardrailOutput": { "index": 19, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "GuardrailAssessment", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The guardrail assessment output from the response", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#GUARDRAIL_OUTPUT" },
"CamelAwsBedrockGuardrailTrace": { "index": 20, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "GuardrailTrace", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The trace information from guardrail evaluation", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#GUARDRAIL_TRACE" },
"CamelAwsBedrockGuardrailAssessments": { "index": 21, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "List<GuardrailAssessment>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The guardrail assessments from ApplyGuardrail response", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#GUARDRAIL_ASSESSMENTS" },
"CamelAwsBedrockGuardrailUsage": { "index": 22, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "GuardrailUsage", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The guardrail usage metrics from ApplyGuardrail response", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#GUARDRAIL_USAGE" }
},
"properties": {
"label": { "index": 0, "kind": "path", "displayName": "Label", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Logical name" },
Expand Down
6 changes: 6 additions & 0 deletions components/camel-aws/camel-aws-bedrock/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,11 @@
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>${mockito-version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,13 @@
"CamelAwsBedrockConverseUsage": { "index": 13, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "TokenUsage", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The usage metrics from Converse API response", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#CONVERSE_USAGE" },
"CamelAwsBedrockConverseOutputMessage": { "index": 14, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Message", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The output message from Converse API response", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#CONVERSE_OUTPUT_MESSAGE" },
"CamelAwsBedrockGuardrailConfig": { "index": 15, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "GuardrailConfiguration", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The guardrail configuration to apply to the request", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#GUARDRAIL_CONFIG" },
"CamelAwsBedrockGuardrailContent": { "index": 16, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "List<GuardrailContentBlock>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The content blocks for ApplyGuardrail operation", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#GUARDRAIL_CONTENT" },
"CamelAwsBedrockGuardrailSource": { "index": 17, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The source type for ApplyGuardrail operation (INPUT or OUTPUT)", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#GUARDRAIL_SOURCE" },
"CamelAwsBedrockGuardrailOutput": { "index": 18, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "GuardrailAssessment", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The guardrail assessment output from the response", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#GUARDRAIL_OUTPUT" },
"CamelAwsBedrockGuardrailTrace": { "index": 19, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "GuardrailTrace", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The trace information from guardrail evaluation", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#GUARDRAIL_TRACE" },
"CamelAwsBedrockGuardrailAssessments": { "index": 20, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "List<GuardrailAssessment>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The guardrail assessments from ApplyGuardrail response", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#GUARDRAIL_ASSESSMENTS" },
"CamelAwsBedrockGuardrailUsage": { "index": 21, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "GuardrailUsage", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The guardrail usage metrics from ApplyGuardrail response", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#GUARDRAIL_USAGE" }
"CamelAwsBedrockGuardrailIdentifier": { "index": 16, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The guardrail identifier to use for the ApplyGuardrail operation", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#GUARDRAIL_IDENTIFIER" },
"CamelAwsBedrockGuardrailContent": { "index": 17, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "List<GuardrailContentBlock>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The content blocks for ApplyGuardrail operation", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#GUARDRAIL_CONTENT" },
"CamelAwsBedrockGuardrailSource": { "index": 18, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The source type for ApplyGuardrail operation (INPUT or OUTPUT)", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#GUARDRAIL_SOURCE" },
"CamelAwsBedrockGuardrailOutput": { "index": 19, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "GuardrailAssessment", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The guardrail assessment output from the response", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#GUARDRAIL_OUTPUT" },
"CamelAwsBedrockGuardrailTrace": { "index": 20, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "GuardrailTrace", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The trace information from guardrail evaluation", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#GUARDRAIL_TRACE" },
"CamelAwsBedrockGuardrailAssessments": { "index": 21, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "List<GuardrailAssessment>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The guardrail assessments from ApplyGuardrail response", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#GUARDRAIL_ASSESSMENTS" },
"CamelAwsBedrockGuardrailUsage": { "index": 22, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "GuardrailUsage", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The guardrail usage metrics from ApplyGuardrail response", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#GUARDRAIL_USAGE" }
},
"properties": {
"label": { "index": 0, "kind": "path", "displayName": "Label", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Logical name" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,7 @@ The Camel AWS Bedrock component provides comprehensive support for guardrails th
*Message-level Configuration* (per-message override via headers):

- `CamelAwsBedrockGuardrailConfig`: GuardrailConfiguration object for converse operations
- `CamelAwsBedrockGuardrailIdentifier`: Guardrail identifier String for the applyGuardrail operation (overrides the endpoint `guardrailIdentifier`)
- `CamelAwsBedrockGuardrailContent`: Content blocks for applyGuardrail operation
- `CamelAwsBedrockGuardrailSource`: Source type - "INPUT" or "OUTPUT" for applyGuardrail

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ public interface BedrockConstants {
String CONVERSE_OUTPUT_MESSAGE = "CamelAwsBedrockConverseOutputMessage";
@Metadata(description = "The guardrail configuration to apply to the request", javaType = "GuardrailConfiguration")
String GUARDRAIL_CONFIG = "CamelAwsBedrockGuardrailConfig";
@Metadata(description = "The guardrail identifier to use for the ApplyGuardrail operation", javaType = "String")
String GUARDRAIL_IDENTIFIER = "CamelAwsBedrockGuardrailIdentifier";
@Metadata(description = "The content blocks for ApplyGuardrail operation", javaType = "List<GuardrailContentBlock>")
String GUARDRAIL_CONTENT = "CamelAwsBedrockGuardrailContent";
@Metadata(description = "The source type for ApplyGuardrail operation (INPUT or OUTPUT)", javaType = "String")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,8 @@ private void applyGuardrail(BedrockRuntimeClient bedrockRuntimeClient, Exchange
= software.amazon.awssdk.services.bedrockruntime.model.ApplyGuardrailRequest.builder();

// Guardrail identifier from header or configuration
String guardrailIdentifier = exchange.getMessage().getHeader(BedrockConstants.GUARDRAIL_CONFIG, String.class);
String guardrailIdentifier
= exchange.getMessage().getHeader(BedrockConstants.GUARDRAIL_IDENTIFIER, String.class);
if (ObjectHelper.isEmpty(guardrailIdentifier)) {
guardrailIdentifier = getConfiguration().getGuardrailIdentifier();
}
Expand Down
Loading
Loading