This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch CAMEL-27694-bedrock-guardrail-stream-mode in repository https://gitbox.apache.org/repos/asf/camel.git
commit e2156b394f09e3e160be187a7237eed9c0e76d0d Author: Claus Ibsen <[email protected]> AuthorDate: Fri Nov 27 17:11:40 2026 +0100 CAMEL-27694: camel-aws-bedrock - guardrailTrace no longer switches the converseStream guardrail to async For the guardrail of the guardrailIdentifier option, converseStream set the streamProcessingMode of the GuardrailStreamConfiguration to async when guardrailTrace was true. In async mode Bedrock sends the response chunks before the guardrail has checked them, and does not mask sensitive information. guardrailTrace now only asks for the trace, and the new guardrailStreamProcessingMode option (sync or async, default sync) chooses the processing mode. An unknown value fails at producer startup. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Claus Ibsen <[email protected]> --- .../camel/catalog/components/aws-bedrock.json | 104 +++++++++++---------- .../camel/catalog/docs/aws-bedrock-component.adoc | 23 +++++ .../runtime/BedrockComponentConfigurer.java | 6 ++ .../bedrock/runtime/BedrockEndpointConfigurer.java | 6 ++ .../bedrock/runtime/BedrockEndpointUriFactory.java | 3 +- .../aws2/bedrock/runtime/aws-bedrock.json | 104 +++++++++++---------- .../src/main/docs/aws-bedrock-component.adoc | 23 +++++ .../aws2/bedrock/runtime/BedrockConfiguration.java | 16 ++++ .../aws2/bedrock/runtime/BedrockProducer.java | 28 +++++- .../runtime/BedrockProducerRequestTest.java | 67 +++++++++++++ .../ROOT/pages/camel-4x-upgrade-guide-4_24.adoc | 9 ++ .../dsl/AwsBedrockComponentBuilderFactory.java | 25 +++++ .../dsl/BedrockEndpointBuilderFactory.java | 22 +++++ 13 files changed, 330 insertions(+), 106 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws-bedrock.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws-bedrock.json index d51544f8afb8..f40c07ed18f8 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws-bedrock.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws-bedrock.json @@ -26,33 +26,34 @@ "componentProperties": { "configuration": { "index": 0, "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "The configuration that the endpoints of the component start from. Each endpoint uses a copy of it, in which its own URI options replace the values." }, "guardrailIdentifier": { "index": 1, "kind": "property", "displayName": "Guardrail Identifier", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The ID or ARN of the guardrail to apply. converse and converseStream apply it when [...] - "guardrailTrace": { "index": 2, "kind": "property", "displayName": "Guardrail Trace", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether converse and converseStream ask for the trace of the guardrail of the [...] - "guardrailVersion": { "index": 3, "kind": "property", "displayName": "Guardrail Version", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "DRAFT", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The version of the guardrail, a number such as 1, or DRAFT for [...] - "includeStreamingMetadata": { "index": 4, "kind": "property", "displayName": "Include Streaming Metadata", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether the streaming operations and converseStream set h [...] - "lazyStartProducer": { "index": 5, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...] - "modelId": { "index": 6, "kind": "property", "displayName": "Model Id", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "amazon.titan-text-express-v1", "amazon.titan-text-lite-v1", "amazon.titan-image-generator-v1", "amazon.titan-embed-text-v1", "amazon.titan-embed-image-v1", "amazon.titan-text-premier-v1:0", "amazon.titan-embed-text-v2:0", "amazon.titan-image-generator-v2:0", "amazon.nova-canvas-v1:0", "amazon.nova-lite-v [...] - "operation": { "index": 7, "kind": "property", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.aws2.bedrock.runtime.BedrockOperations", "enum": [ "invokeTextModel", "invokeImageModel", "invokeEmbeddingsModel", "invokeTextModelStreaming", "invokeImageModelStreaming", "invokeEmbeddingsModelStreaming", "converse", "converseStream", "applyGuardrail" ], "deprecated": false, "autowired": false, "secret" [...] - "overrideEndpoint": { "index": 8, "kind": "property", "displayName": "Override Endpoint", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to send the requests to the URI of the uriEndpointOverride option [...] - "pojoRequest": { "index": 9, "kind": "property", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether the body is the request object of the AWS SDK for the operation, which the [...] - "profileCredentialsName": { "index": 10, "kind": "property", "displayName": "Profile Credentials Name", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The name of the profile in the AWS shared credent [...] - "region": { "index": 11, "kind": "property", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "us-east-1", "us-east-2", "us-west-2", "us-gov-west-1", "ap-northeast-1", "ap-northeast-2", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ca-central-1", "eu-central-1", "eu-central-2", "eu-west-1", "eu-west-2", "eu-west-3", "sa-east-1" ], "deprecated": false, "autowired": false, "secret": false, "conf [...] - "streamOutputMode": { "index": 12, "kind": "property", "displayName": "Stream Output Mode", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "complete", "chunks" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "complete", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "How the streaming operatio [...] - "uriEndpointOverride": { "index": 13, "kind": "property", "displayName": "Uri Endpoint Override", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The URI of the endpoint to use instead of the endpoint of the region, for exampl [...] - "useDefaultCredentialsProvider": { "index": 14, "kind": "property", "displayName": "Use Default Credentials Provider", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to load the credentials with the def [...] - "useProfileCredentialsProvider": { "index": 15, "kind": "property", "displayName": "Use Profile Credentials Provider", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to load the credentials from a profi [...] - "autowiredEnabled": { "index": 16, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching [...] - "bedrockRuntimeAsyncClient": { "index": 17, "kind": "property", "displayName": "Bedrock Runtime Async Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.bedrockruntime.BedrockRuntimeAsyncClient", "deprecated": false, "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "To u [...] - "bedrockRuntimeClient": { "index": 18, "kind": "property", "displayName": "Bedrock Runtime Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.bedrockruntime.BedrockRuntimeClient", "deprecated": false, "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "To use a custom soft [...] - "healthCheckConsumerEnabled": { "index": 19, "kind": "property", "displayName": "Health Check Consumer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all consumer based health checks from this component" }, - "healthCheckProducerEnabled": { "index": 20, "kind": "property", "displayName": "Health Check Producer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on produce [...] - "proxyHost": { "index": 21, "kind": "property", "displayName": "Proxy Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The host name of the proxy that the HTTP clients of Bedrock Runtime connect through. The proxy is u [...] - "proxyPort": { "index": 22, "kind": "property", "displayName": "Proxy Port", "group": "proxy", "label": "proxy", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The port of the proxy that the HTTP clients of Bedrock Runtime connect through. The proxy is used [...] - "proxyProtocol": { "index": 23, "kind": "property", "displayName": "Proxy Protocol", "group": "proxy", "label": "proxy", "required": false, "type": "enum", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The protocol that t [...] - "accessKey": { "index": 24, "kind": "property", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The access key ID of the AWS credentials, used together with the secretK [...] - "secretKey": { "index": 25, "kind": "property", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The secret access key of the AWS credentials, used together with the acc [...] - "sessionToken": { "index": 26, "kind": "property", "displayName": "Session Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The session token of temporary AWS credentials, for example of an [...] - "trustAllCertificates": { "index": 27, "kind": "property", "displayName": "Trust All Certificates", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "security": "insecure:ssl", "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether the HTTP clients of [...] - "useSessionCredentials": { "index": 28, "kind": "property", "displayName": "Use Session Credentials", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to use temporary credentials made of the acce [...] + "guardrailStreamProcessingMode": { "index": 2, "kind": "property", "displayName": "Guardrail Stream Processing Mode", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "sync", "async" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "sync", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "How conve [...] + "guardrailTrace": { "index": 3, "kind": "property", "displayName": "Guardrail Trace", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether converse and converseStream ask for the trace of the guardrail of the [...] + "guardrailVersion": { "index": 4, "kind": "property", "displayName": "Guardrail Version", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "DRAFT", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The version of the guardrail, a number such as 1, or DRAFT for [...] + "includeStreamingMetadata": { "index": 5, "kind": "property", "displayName": "Include Streaming Metadata", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether the streaming operations and converseStream set h [...] + "lazyStartProducer": { "index": 6, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...] + "modelId": { "index": 7, "kind": "property", "displayName": "Model Id", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "amazon.titan-text-express-v1", "amazon.titan-text-lite-v1", "amazon.titan-image-generator-v1", "amazon.titan-embed-text-v1", "amazon.titan-embed-image-v1", "amazon.titan-text-premier-v1:0", "amazon.titan-embed-text-v2:0", "amazon.titan-image-generator-v2:0", "amazon.nova-canvas-v1:0", "amazon.nova-lite-v [...] + "operation": { "index": 8, "kind": "property", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.aws2.bedrock.runtime.BedrockOperations", "enum": [ "invokeTextModel", "invokeImageModel", "invokeEmbeddingsModel", "invokeTextModelStreaming", "invokeImageModelStreaming", "invokeEmbeddingsModelStreaming", "converse", "converseStream", "applyGuardrail" ], "deprecated": false, "autowired": false, "secret" [...] + "overrideEndpoint": { "index": 9, "kind": "property", "displayName": "Override Endpoint", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to send the requests to the URI of the uriEndpointOverride option [...] + "pojoRequest": { "index": 10, "kind": "property", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether the body is the request object of the AWS SDK for the operation, which the [...] + "profileCredentialsName": { "index": 11, "kind": "property", "displayName": "Profile Credentials Name", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The name of the profile in the AWS shared credent [...] + "region": { "index": 12, "kind": "property", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "us-east-1", "us-east-2", "us-west-2", "us-gov-west-1", "ap-northeast-1", "ap-northeast-2", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ca-central-1", "eu-central-1", "eu-central-2", "eu-west-1", "eu-west-2", "eu-west-3", "sa-east-1" ], "deprecated": false, "autowired": false, "secret": false, "conf [...] + "streamOutputMode": { "index": 13, "kind": "property", "displayName": "Stream Output Mode", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "complete", "chunks" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "complete", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "How the streaming operatio [...] + "uriEndpointOverride": { "index": 14, "kind": "property", "displayName": "Uri Endpoint Override", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The URI of the endpoint to use instead of the endpoint of the region, for exampl [...] + "useDefaultCredentialsProvider": { "index": 15, "kind": "property", "displayName": "Use Default Credentials Provider", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to load the credentials with the def [...] + "useProfileCredentialsProvider": { "index": 16, "kind": "property", "displayName": "Use Profile Credentials Provider", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to load the credentials from a profi [...] + "autowiredEnabled": { "index": 17, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching [...] + "bedrockRuntimeAsyncClient": { "index": 18, "kind": "property", "displayName": "Bedrock Runtime Async Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.bedrockruntime.BedrockRuntimeAsyncClient", "deprecated": false, "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "To u [...] + "bedrockRuntimeClient": { "index": 19, "kind": "property", "displayName": "Bedrock Runtime Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.bedrockruntime.BedrockRuntimeClient", "deprecated": false, "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "To use a custom soft [...] + "healthCheckConsumerEnabled": { "index": 20, "kind": "property", "displayName": "Health Check Consumer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all consumer based health checks from this component" }, + "healthCheckProducerEnabled": { "index": 21, "kind": "property", "displayName": "Health Check Producer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on produce [...] + "proxyHost": { "index": 22, "kind": "property", "displayName": "Proxy Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The host name of the proxy that the HTTP clients of Bedrock Runtime connect through. The proxy is u [...] + "proxyPort": { "index": 23, "kind": "property", "displayName": "Proxy Port", "group": "proxy", "label": "proxy", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The port of the proxy that the HTTP clients of Bedrock Runtime connect through. The proxy is used [...] + "proxyProtocol": { "index": 24, "kind": "property", "displayName": "Proxy Protocol", "group": "proxy", "label": "proxy", "required": false, "type": "enum", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The protocol that t [...] + "accessKey": { "index": 25, "kind": "property", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The access key ID of the AWS credentials, used together with the secretK [...] + "secretKey": { "index": 26, "kind": "property", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The secret access key of the AWS credentials, used together with the acc [...] + "sessionToken": { "index": 27, "kind": "property", "displayName": "Session Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The session token of temporary AWS credentials, for example of an [...] + "trustAllCertificates": { "index": 28, "kind": "property", "displayName": "Trust All Certificates", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "security": "insecure:ssl", "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether the HTTP clients of [...] + "useSessionCredentials": { "index": 29, "kind": "property", "displayName": "Use Session Credentials", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to use temporary credentials made of the acce [...] }, "headers": { "CamelAwsBedrockOperation": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The operation that the producer performs. It replaces the operation option.", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#OPERATION" }, @@ -86,29 +87,30 @@ "properties": { "label": { "index": 0, "kind": "path", "displayName": "Label", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "A logical name of the endpoint, which you choose freely. The producer does not use it: the model and the operation a [...] "guardrailIdentifier": { "index": 1, "kind": "parameter", "displayName": "Guardrail Identifier", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The ID or ARN of the guardrail to apply. converse and converseStream apply it whe [...] - "guardrailTrace": { "index": 2, "kind": "parameter", "displayName": "Guardrail Trace", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether converse and converseStream ask for the trace of the guardrail of th [...] - "guardrailVersion": { "index": 3, "kind": "parameter", "displayName": "Guardrail Version", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "DRAFT", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The version of the guardrail, a number such as 1, or DRAFT for [...] - "includeStreamingMetadata": { "index": 4, "kind": "parameter", "displayName": "Include Streaming Metadata", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether the streaming operations and converseStream set [...] - "modelId": { "index": 5, "kind": "parameter", "displayName": "Model Id", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "amazon.titan-text-express-v1", "amazon.titan-text-lite-v1", "amazon.titan-image-generator-v1", "amazon.titan-embed-text-v1", "amazon.titan-embed-image-v1", "amazon.titan-text-premier-v1:0", "amazon.titan-embed-text-v2:0", "amazon.titan-image-generator-v2:0", "amazon.nova-canvas-v1:0", "amazon.nova-lite- [...] - "operation": { "index": 6, "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.aws2.bedrock.runtime.BedrockOperations", "enum": [ "invokeTextModel", "invokeImageModel", "invokeEmbeddingsModel", "invokeTextModelStreaming", "invokeImageModelStreaming", "invokeEmbeddingsModelStreaming", "converse", "converseStream", "applyGuardrail" ], "deprecated": false, "autowired": false, "secret [...] - "overrideEndpoint": { "index": 7, "kind": "parameter", "displayName": "Override Endpoint", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to send the requests to the URI of the uriEndpointOverride optio [...] - "pojoRequest": { "index": 8, "kind": "parameter", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether the body is the request object of the AWS SDK for the operation, which the [...] - "profileCredentialsName": { "index": 9, "kind": "parameter", "displayName": "Profile Credentials Name", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The name of the profile in the AWS shared credent [...] - "region": { "index": 10, "kind": "parameter", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "us-east-1", "us-east-2", "us-west-2", "us-gov-west-1", "ap-northeast-1", "ap-northeast-2", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ca-central-1", "eu-central-1", "eu-central-2", "eu-west-1", "eu-west-2", "eu-west-3", "sa-east-1" ], "deprecated": false, "autowired": false, "secret": false, "con [...] - "streamOutputMode": { "index": 11, "kind": "parameter", "displayName": "Stream Output Mode", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "complete", "chunks" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "complete", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "How the streaming operati [...] - "uriEndpointOverride": { "index": 12, "kind": "parameter", "displayName": "Uri Endpoint Override", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The URI of the endpoint to use instead of the endpoint of the region, for examp [...] - "useDefaultCredentialsProvider": { "index": 13, "kind": "parameter", "displayName": "Use Default Credentials Provider", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to load the credentials with the de [...] - "useProfileCredentialsProvider": { "index": 14, "kind": "parameter", "displayName": "Use Profile Credentials Provider", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to load the credentials from a prof [...] - "lazyStartProducer": { "index": 15, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produ [...] - "bedrockRuntimeAsyncClient": { "index": 16, "kind": "parameter", "displayName": "Bedrock Runtime Async Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.bedrockruntime.BedrockRuntimeAsyncClient", "deprecated": false, "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "To [...] - "bedrockRuntimeClient": { "index": 17, "kind": "parameter", "displayName": "Bedrock Runtime Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.bedrockruntime.BedrockRuntimeClient", "deprecated": false, "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "To use a custom sof [...] - "proxyHost": { "index": 18, "kind": "parameter", "displayName": "Proxy Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The host name of the proxy that the HTTP clients of Bedrock Runtime connect through. The proxy is [...] - "proxyPort": { "index": 19, "kind": "parameter", "displayName": "Proxy Port", "group": "proxy", "label": "proxy", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The port of the proxy that the HTTP clients of Bedrock Runtime connect through. The proxy is use [...] - "proxyProtocol": { "index": 20, "kind": "parameter", "displayName": "Proxy Protocol", "group": "proxy", "label": "proxy", "required": false, "type": "enum", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The protocol that [...] - "accessKey": { "index": 21, "kind": "parameter", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The access key ID of the AWS credentials, used together with the secret [...] - "secretKey": { "index": 22, "kind": "parameter", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The secret access key of the AWS credentials, used together with the ac [...] - "sessionToken": { "index": 23, "kind": "parameter", "displayName": "Session Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The session token of temporary AWS credentials, for example of an [...] - "trustAllCertificates": { "index": 24, "kind": "parameter", "displayName": "Trust All Certificates", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "security": "insecure:ssl", "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether the HTTP clients o [...] - "useSessionCredentials": { "index": 25, "kind": "parameter", "displayName": "Use Session Credentials", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to use temporary credentials made of the acc [...] + "guardrailStreamProcessingMode": { "index": 2, "kind": "parameter", "displayName": "Guardrail Stream Processing Mode", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "sync", "async" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "sync", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "How conv [...] + "guardrailTrace": { "index": 3, "kind": "parameter", "displayName": "Guardrail Trace", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether converse and converseStream ask for the trace of the guardrail of th [...] + "guardrailVersion": { "index": 4, "kind": "parameter", "displayName": "Guardrail Version", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "DRAFT", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The version of the guardrail, a number such as 1, or DRAFT for [...] + "includeStreamingMetadata": { "index": 5, "kind": "parameter", "displayName": "Include Streaming Metadata", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether the streaming operations and converseStream set [...] + "modelId": { "index": 6, "kind": "parameter", "displayName": "Model Id", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "amazon.titan-text-express-v1", "amazon.titan-text-lite-v1", "amazon.titan-image-generator-v1", "amazon.titan-embed-text-v1", "amazon.titan-embed-image-v1", "amazon.titan-text-premier-v1:0", "amazon.titan-embed-text-v2:0", "amazon.titan-image-generator-v2:0", "amazon.nova-canvas-v1:0", "amazon.nova-lite- [...] + "operation": { "index": 7, "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.aws2.bedrock.runtime.BedrockOperations", "enum": [ "invokeTextModel", "invokeImageModel", "invokeEmbeddingsModel", "invokeTextModelStreaming", "invokeImageModelStreaming", "invokeEmbeddingsModelStreaming", "converse", "converseStream", "applyGuardrail" ], "deprecated": false, "autowired": false, "secret [...] + "overrideEndpoint": { "index": 8, "kind": "parameter", "displayName": "Override Endpoint", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to send the requests to the URI of the uriEndpointOverride optio [...] + "pojoRequest": { "index": 9, "kind": "parameter", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether the body is the request object of the AWS SDK for the operation, which the [...] + "profileCredentialsName": { "index": 10, "kind": "parameter", "displayName": "Profile Credentials Name", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The name of the profile in the AWS shared creden [...] + "region": { "index": 11, "kind": "parameter", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "us-east-1", "us-east-2", "us-west-2", "us-gov-west-1", "ap-northeast-1", "ap-northeast-2", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ca-central-1", "eu-central-1", "eu-central-2", "eu-west-1", "eu-west-2", "eu-west-3", "sa-east-1" ], "deprecated": false, "autowired": false, "secret": false, "con [...] + "streamOutputMode": { "index": 12, "kind": "parameter", "displayName": "Stream Output Mode", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "complete", "chunks" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "complete", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "How the streaming operati [...] + "uriEndpointOverride": { "index": 13, "kind": "parameter", "displayName": "Uri Endpoint Override", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The URI of the endpoint to use instead of the endpoint of the region, for examp [...] + "useDefaultCredentialsProvider": { "index": 14, "kind": "parameter", "displayName": "Use Default Credentials Provider", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to load the credentials with the de [...] + "useProfileCredentialsProvider": { "index": 15, "kind": "parameter", "displayName": "Use Profile Credentials Provider", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to load the credentials from a prof [...] + "lazyStartProducer": { "index": 16, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produ [...] + "bedrockRuntimeAsyncClient": { "index": 17, "kind": "parameter", "displayName": "Bedrock Runtime Async Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.bedrockruntime.BedrockRuntimeAsyncClient", "deprecated": false, "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "To [...] + "bedrockRuntimeClient": { "index": 18, "kind": "parameter", "displayName": "Bedrock Runtime Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.bedrockruntime.BedrockRuntimeClient", "deprecated": false, "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "To use a custom sof [...] + "proxyHost": { "index": 19, "kind": "parameter", "displayName": "Proxy Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The host name of the proxy that the HTTP clients of Bedrock Runtime connect through. The proxy is [...] + "proxyPort": { "index": 20, "kind": "parameter", "displayName": "Proxy Port", "group": "proxy", "label": "proxy", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The port of the proxy that the HTTP clients of Bedrock Runtime connect through. The proxy is use [...] + "proxyProtocol": { "index": 21, "kind": "parameter", "displayName": "Proxy Protocol", "group": "proxy", "label": "proxy", "required": false, "type": "enum", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The protocol that [...] + "accessKey": { "index": 22, "kind": "parameter", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The access key ID of the AWS credentials, used together with the secret [...] + "secretKey": { "index": 23, "kind": "parameter", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The secret access key of the AWS credentials, used together with the ac [...] + "sessionToken": { "index": 24, "kind": "parameter", "displayName": "Session Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The session token of temporary AWS credentials, for example of an [...] + "trustAllCertificates": { "index": 25, "kind": "parameter", "displayName": "Trust All Certificates", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "security": "insecure:ssl", "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether the HTTP clients o [...] + "useSessionCredentials": { "index": 26, "kind": "parameter", "displayName": "Use Session Credentials", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to use temporary credentials made of the acc [...] } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws-bedrock-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws-bedrock-component.adoc index 4a013e47efef..df2aed3c60b9 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws-bedrock-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws-bedrock-component.adoc @@ -244,6 +244,8 @@ The Camel AWS Bedrock component provides comprehensive support for guardrails th - `guardrailIdentifier`: The ID or ARN of the guardrail to apply - `guardrailVersion`: The version of the guardrail (default: "DRAFT") - `guardrailTrace`: Whether to return trace information (default: false) +- `guardrailStreamProcessingMode`: How converseStream applies the guardrail to the streamed response, `sync` or `async` + (default: `sync`). See Guardrails with converseStream below. *Message-level Configuration* (per-message override via headers): @@ -270,6 +272,27 @@ aws-bedrock://label?operation=converseStream&modelId=anthropic.claude-3-sonnet-2 &guardrailIdentifier=abc123xyz&guardrailVersion=DRAFT ---- +==== Guardrails with converseStream + +Bedrock applies a guardrail to a streamed response in one of two processing modes, which the +`guardrailStreamProcessingMode` option chooses for the guardrail of the `guardrailIdentifier` option: + +- `sync` (default): Bedrock buffers the response chunks and checks them with the guardrail before it sends them. This + adds some latency, but every chunk the producer receives has been checked. +- `async`: Bedrock sends the chunks as soon as the model produces them and checks them in the background. Chunks that + the guardrail would block can reach the producer before Bedrock blocks the rest of the stream, and the guardrail + cannot mask sensitive information. + +The `guardrailTrace` option does not change the processing mode. When the `CamelAwsBedrockGuardrailConfig` header is a +`GuardrailStreamConfiguration`, its `streamProcessingMode` is used; a `GuardrailConfiguration` has none, so Bedrock +uses `sync`. + +[source] +---- +aws-bedrock://label?operation=converseStream&modelId=anthropic.claude-3-sonnet-20240229-v1:0 + &guardrailIdentifier=abc123xyz&guardrailTrace=true&guardrailStreamProcessingMode=async +---- + *applyGuardrail*: Standalone operation to validate content against a guardrail without invoking a model. The content is the `CamelAwsBedrockGuardrailContent` header, or else the message body as text. diff --git a/components/camel-aws/camel-aws-bedrock/src/generated/java/org/apache/camel/component/aws2/bedrock/runtime/BedrockComponentConfigurer.java b/components/camel-aws/camel-aws-bedrock/src/generated/java/org/apache/camel/component/aws2/bedrock/runtime/BedrockComponentConfigurer.java index c3e1a27d7ea6..25ada0cb71b2 100644 --- a/components/camel-aws/camel-aws-bedrock/src/generated/java/org/apache/camel/component/aws2/bedrock/runtime/BedrockComponentConfigurer.java +++ b/components/camel-aws/camel-aws-bedrock/src/generated/java/org/apache/camel/component/aws2/bedrock/runtime/BedrockComponentConfigurer.java @@ -42,6 +42,8 @@ public class BedrockComponentConfigurer extends PropertyConfigurerSupport implem case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration.class, value)); return true; case "guardrailidentifier": case "guardrailIdentifier": getOrCreateConfiguration(target).setGuardrailIdentifier(property(camelContext, java.lang.String.class, value)); return true; + case "guardrailstreamprocessingmode": + case "guardrailStreamProcessingMode": getOrCreateConfiguration(target).setGuardrailStreamProcessingMode(property(camelContext, java.lang.String.class, value)); return true; case "guardrailtrace": case "guardrailTrace": getOrCreateConfiguration(target).setGuardrailTrace(property(camelContext, boolean.class, value)); return true; case "guardrailversion": @@ -109,6 +111,8 @@ public class BedrockComponentConfigurer extends PropertyConfigurerSupport implem case "configuration": return org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration.class; case "guardrailidentifier": case "guardrailIdentifier": return java.lang.String.class; + case "guardrailstreamprocessingmode": + case "guardrailStreamProcessingMode": return java.lang.String.class; case "guardrailtrace": case "guardrailTrace": return boolean.class; case "guardrailversion": @@ -172,6 +176,8 @@ public class BedrockComponentConfigurer extends PropertyConfigurerSupport implem case "configuration": return target.getConfiguration(); case "guardrailidentifier": case "guardrailIdentifier": return getOrCreateConfiguration(target).getGuardrailIdentifier(); + case "guardrailstreamprocessingmode": + case "guardrailStreamProcessingMode": return getOrCreateConfiguration(target).getGuardrailStreamProcessingMode(); case "guardrailtrace": case "guardrailTrace": return getOrCreateConfiguration(target).isGuardrailTrace(); case "guardrailversion": diff --git a/components/camel-aws/camel-aws-bedrock/src/generated/java/org/apache/camel/component/aws2/bedrock/runtime/BedrockEndpointConfigurer.java b/components/camel-aws/camel-aws-bedrock/src/generated/java/org/apache/camel/component/aws2/bedrock/runtime/BedrockEndpointConfigurer.java index d3b011c2d046..6881aeb0ed22 100644 --- a/components/camel-aws/camel-aws-bedrock/src/generated/java/org/apache/camel/component/aws2/bedrock/runtime/BedrockEndpointConfigurer.java +++ b/components/camel-aws/camel-aws-bedrock/src/generated/java/org/apache/camel/component/aws2/bedrock/runtime/BedrockEndpointConfigurer.java @@ -32,6 +32,8 @@ public class BedrockEndpointConfigurer extends PropertyConfigurerSupport impleme case "bedrockRuntimeClient": target.getConfiguration().setBedrockRuntimeClient(property(camelContext, software.amazon.awssdk.services.bedrockruntime.BedrockRuntimeClient.class, value)); return true; case "guardrailidentifier": case "guardrailIdentifier": target.getConfiguration().setGuardrailIdentifier(property(camelContext, java.lang.String.class, value)); return true; + case "guardrailstreamprocessingmode": + case "guardrailStreamProcessingMode": target.getConfiguration().setGuardrailStreamProcessingMode(property(camelContext, java.lang.String.class, value)); return true; case "guardrailtrace": case "guardrailTrace": target.getConfiguration().setGuardrailTrace(property(camelContext, boolean.class, value)); return true; case "guardrailversion": @@ -92,6 +94,8 @@ public class BedrockEndpointConfigurer extends PropertyConfigurerSupport impleme case "bedrockRuntimeClient": return software.amazon.awssdk.services.bedrockruntime.BedrockRuntimeClient.class; case "guardrailidentifier": case "guardrailIdentifier": return java.lang.String.class; + case "guardrailstreamprocessingmode": + case "guardrailStreamProcessingMode": return java.lang.String.class; case "guardrailtrace": case "guardrailTrace": return boolean.class; case "guardrailversion": @@ -148,6 +152,8 @@ public class BedrockEndpointConfigurer extends PropertyConfigurerSupport impleme case "bedrockRuntimeClient": return target.getConfiguration().getBedrockRuntimeClient(); case "guardrailidentifier": case "guardrailIdentifier": return target.getConfiguration().getGuardrailIdentifier(); + case "guardrailstreamprocessingmode": + case "guardrailStreamProcessingMode": return target.getConfiguration().getGuardrailStreamProcessingMode(); case "guardrailtrace": case "guardrailTrace": return target.getConfiguration().isGuardrailTrace(); case "guardrailversion": diff --git a/components/camel-aws/camel-aws-bedrock/src/generated/java/org/apache/camel/component/aws2/bedrock/runtime/BedrockEndpointUriFactory.java b/components/camel-aws/camel-aws-bedrock/src/generated/java/org/apache/camel/component/aws2/bedrock/runtime/BedrockEndpointUriFactory.java index 7e8ad42a4539..ae62339e7c8e 100644 --- a/components/camel-aws/camel-aws-bedrock/src/generated/java/org/apache/camel/component/aws2/bedrock/runtime/BedrockEndpointUriFactory.java +++ b/components/camel-aws/camel-aws-bedrock/src/generated/java/org/apache/camel/component/aws2/bedrock/runtime/BedrockEndpointUriFactory.java @@ -24,11 +24,12 @@ public class BedrockEndpointUriFactory extends org.apache.camel.support.componen private static final Set<String> ENDPOINT_IDENTITY_PROPERTY_NAMES; private static final Map<String, String> MULTI_VALUE_PREFIXES; static { - Set<String> props = new HashSet<>(26); + Set<String> props = new HashSet<>(27); props.add("accessKey"); props.add("bedrockRuntimeAsyncClient"); props.add("bedrockRuntimeClient"); props.add("guardrailIdentifier"); + props.add("guardrailStreamProcessingMode"); props.add("guardrailTrace"); props.add("guardrailVersion"); props.add("includeStreamingMetadata"); diff --git a/components/camel-aws/camel-aws-bedrock/src/generated/resources/META-INF/org/apache/camel/component/aws2/bedrock/runtime/aws-bedrock.json b/components/camel-aws/camel-aws-bedrock/src/generated/resources/META-INF/org/apache/camel/component/aws2/bedrock/runtime/aws-bedrock.json index d51544f8afb8..f40c07ed18f8 100644 --- a/components/camel-aws/camel-aws-bedrock/src/generated/resources/META-INF/org/apache/camel/component/aws2/bedrock/runtime/aws-bedrock.json +++ b/components/camel-aws/camel-aws-bedrock/src/generated/resources/META-INF/org/apache/camel/component/aws2/bedrock/runtime/aws-bedrock.json @@ -26,33 +26,34 @@ "componentProperties": { "configuration": { "index": 0, "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "The configuration that the endpoints of the component start from. Each endpoint uses a copy of it, in which its own URI options replace the values." }, "guardrailIdentifier": { "index": 1, "kind": "property", "displayName": "Guardrail Identifier", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The ID or ARN of the guardrail to apply. converse and converseStream apply it when [...] - "guardrailTrace": { "index": 2, "kind": "property", "displayName": "Guardrail Trace", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether converse and converseStream ask for the trace of the guardrail of the [...] - "guardrailVersion": { "index": 3, "kind": "property", "displayName": "Guardrail Version", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "DRAFT", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The version of the guardrail, a number such as 1, or DRAFT for [...] - "includeStreamingMetadata": { "index": 4, "kind": "property", "displayName": "Include Streaming Metadata", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether the streaming operations and converseStream set h [...] - "lazyStartProducer": { "index": 5, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...] - "modelId": { "index": 6, "kind": "property", "displayName": "Model Id", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "amazon.titan-text-express-v1", "amazon.titan-text-lite-v1", "amazon.titan-image-generator-v1", "amazon.titan-embed-text-v1", "amazon.titan-embed-image-v1", "amazon.titan-text-premier-v1:0", "amazon.titan-embed-text-v2:0", "amazon.titan-image-generator-v2:0", "amazon.nova-canvas-v1:0", "amazon.nova-lite-v [...] - "operation": { "index": 7, "kind": "property", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.aws2.bedrock.runtime.BedrockOperations", "enum": [ "invokeTextModel", "invokeImageModel", "invokeEmbeddingsModel", "invokeTextModelStreaming", "invokeImageModelStreaming", "invokeEmbeddingsModelStreaming", "converse", "converseStream", "applyGuardrail" ], "deprecated": false, "autowired": false, "secret" [...] - "overrideEndpoint": { "index": 8, "kind": "property", "displayName": "Override Endpoint", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to send the requests to the URI of the uriEndpointOverride option [...] - "pojoRequest": { "index": 9, "kind": "property", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether the body is the request object of the AWS SDK for the operation, which the [...] - "profileCredentialsName": { "index": 10, "kind": "property", "displayName": "Profile Credentials Name", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The name of the profile in the AWS shared credent [...] - "region": { "index": 11, "kind": "property", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "us-east-1", "us-east-2", "us-west-2", "us-gov-west-1", "ap-northeast-1", "ap-northeast-2", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ca-central-1", "eu-central-1", "eu-central-2", "eu-west-1", "eu-west-2", "eu-west-3", "sa-east-1" ], "deprecated": false, "autowired": false, "secret": false, "conf [...] - "streamOutputMode": { "index": 12, "kind": "property", "displayName": "Stream Output Mode", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "complete", "chunks" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "complete", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "How the streaming operatio [...] - "uriEndpointOverride": { "index": 13, "kind": "property", "displayName": "Uri Endpoint Override", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The URI of the endpoint to use instead of the endpoint of the region, for exampl [...] - "useDefaultCredentialsProvider": { "index": 14, "kind": "property", "displayName": "Use Default Credentials Provider", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to load the credentials with the def [...] - "useProfileCredentialsProvider": { "index": 15, "kind": "property", "displayName": "Use Profile Credentials Provider", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to load the credentials from a profi [...] - "autowiredEnabled": { "index": 16, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching [...] - "bedrockRuntimeAsyncClient": { "index": 17, "kind": "property", "displayName": "Bedrock Runtime Async Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.bedrockruntime.BedrockRuntimeAsyncClient", "deprecated": false, "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "To u [...] - "bedrockRuntimeClient": { "index": 18, "kind": "property", "displayName": "Bedrock Runtime Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.bedrockruntime.BedrockRuntimeClient", "deprecated": false, "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "To use a custom soft [...] - "healthCheckConsumerEnabled": { "index": 19, "kind": "property", "displayName": "Health Check Consumer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all consumer based health checks from this component" }, - "healthCheckProducerEnabled": { "index": 20, "kind": "property", "displayName": "Health Check Producer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on produce [...] - "proxyHost": { "index": 21, "kind": "property", "displayName": "Proxy Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The host name of the proxy that the HTTP clients of Bedrock Runtime connect through. The proxy is u [...] - "proxyPort": { "index": 22, "kind": "property", "displayName": "Proxy Port", "group": "proxy", "label": "proxy", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The port of the proxy that the HTTP clients of Bedrock Runtime connect through. The proxy is used [...] - "proxyProtocol": { "index": 23, "kind": "property", "displayName": "Proxy Protocol", "group": "proxy", "label": "proxy", "required": false, "type": "enum", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The protocol that t [...] - "accessKey": { "index": 24, "kind": "property", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The access key ID of the AWS credentials, used together with the secretK [...] - "secretKey": { "index": 25, "kind": "property", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The secret access key of the AWS credentials, used together with the acc [...] - "sessionToken": { "index": 26, "kind": "property", "displayName": "Session Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The session token of temporary AWS credentials, for example of an [...] - "trustAllCertificates": { "index": 27, "kind": "property", "displayName": "Trust All Certificates", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "security": "insecure:ssl", "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether the HTTP clients of [...] - "useSessionCredentials": { "index": 28, "kind": "property", "displayName": "Use Session Credentials", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to use temporary credentials made of the acce [...] + "guardrailStreamProcessingMode": { "index": 2, "kind": "property", "displayName": "Guardrail Stream Processing Mode", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "sync", "async" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "sync", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "How conve [...] + "guardrailTrace": { "index": 3, "kind": "property", "displayName": "Guardrail Trace", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether converse and converseStream ask for the trace of the guardrail of the [...] + "guardrailVersion": { "index": 4, "kind": "property", "displayName": "Guardrail Version", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "DRAFT", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The version of the guardrail, a number such as 1, or DRAFT for [...] + "includeStreamingMetadata": { "index": 5, "kind": "property", "displayName": "Include Streaming Metadata", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether the streaming operations and converseStream set h [...] + "lazyStartProducer": { "index": 6, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...] + "modelId": { "index": 7, "kind": "property", "displayName": "Model Id", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "amazon.titan-text-express-v1", "amazon.titan-text-lite-v1", "amazon.titan-image-generator-v1", "amazon.titan-embed-text-v1", "amazon.titan-embed-image-v1", "amazon.titan-text-premier-v1:0", "amazon.titan-embed-text-v2:0", "amazon.titan-image-generator-v2:0", "amazon.nova-canvas-v1:0", "amazon.nova-lite-v [...] + "operation": { "index": 8, "kind": "property", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.aws2.bedrock.runtime.BedrockOperations", "enum": [ "invokeTextModel", "invokeImageModel", "invokeEmbeddingsModel", "invokeTextModelStreaming", "invokeImageModelStreaming", "invokeEmbeddingsModelStreaming", "converse", "converseStream", "applyGuardrail" ], "deprecated": false, "autowired": false, "secret" [...] + "overrideEndpoint": { "index": 9, "kind": "property", "displayName": "Override Endpoint", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to send the requests to the URI of the uriEndpointOverride option [...] + "pojoRequest": { "index": 10, "kind": "property", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether the body is the request object of the AWS SDK for the operation, which the [...] + "profileCredentialsName": { "index": 11, "kind": "property", "displayName": "Profile Credentials Name", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The name of the profile in the AWS shared credent [...] + "region": { "index": 12, "kind": "property", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "us-east-1", "us-east-2", "us-west-2", "us-gov-west-1", "ap-northeast-1", "ap-northeast-2", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ca-central-1", "eu-central-1", "eu-central-2", "eu-west-1", "eu-west-2", "eu-west-3", "sa-east-1" ], "deprecated": false, "autowired": false, "secret": false, "conf [...] + "streamOutputMode": { "index": 13, "kind": "property", "displayName": "Stream Output Mode", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "complete", "chunks" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "complete", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "How the streaming operatio [...] + "uriEndpointOverride": { "index": 14, "kind": "property", "displayName": "Uri Endpoint Override", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The URI of the endpoint to use instead of the endpoint of the region, for exampl [...] + "useDefaultCredentialsProvider": { "index": 15, "kind": "property", "displayName": "Use Default Credentials Provider", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to load the credentials with the def [...] + "useProfileCredentialsProvider": { "index": 16, "kind": "property", "displayName": "Use Profile Credentials Provider", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to load the credentials from a profi [...] + "autowiredEnabled": { "index": 17, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching [...] + "bedrockRuntimeAsyncClient": { "index": 18, "kind": "property", "displayName": "Bedrock Runtime Async Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.bedrockruntime.BedrockRuntimeAsyncClient", "deprecated": false, "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "To u [...] + "bedrockRuntimeClient": { "index": 19, "kind": "property", "displayName": "Bedrock Runtime Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.bedrockruntime.BedrockRuntimeClient", "deprecated": false, "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "To use a custom soft [...] + "healthCheckConsumerEnabled": { "index": 20, "kind": "property", "displayName": "Health Check Consumer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all consumer based health checks from this component" }, + "healthCheckProducerEnabled": { "index": 21, "kind": "property", "displayName": "Health Check Producer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on produce [...] + "proxyHost": { "index": 22, "kind": "property", "displayName": "Proxy Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The host name of the proxy that the HTTP clients of Bedrock Runtime connect through. The proxy is u [...] + "proxyPort": { "index": 23, "kind": "property", "displayName": "Proxy Port", "group": "proxy", "label": "proxy", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The port of the proxy that the HTTP clients of Bedrock Runtime connect through. The proxy is used [...] + "proxyProtocol": { "index": 24, "kind": "property", "displayName": "Proxy Protocol", "group": "proxy", "label": "proxy", "required": false, "type": "enum", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The protocol that t [...] + "accessKey": { "index": 25, "kind": "property", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The access key ID of the AWS credentials, used together with the secretK [...] + "secretKey": { "index": 26, "kind": "property", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The secret access key of the AWS credentials, used together with the acc [...] + "sessionToken": { "index": 27, "kind": "property", "displayName": "Session Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The session token of temporary AWS credentials, for example of an [...] + "trustAllCertificates": { "index": 28, "kind": "property", "displayName": "Trust All Certificates", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "security": "insecure:ssl", "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether the HTTP clients of [...] + "useSessionCredentials": { "index": 29, "kind": "property", "displayName": "Use Session Credentials", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to use temporary credentials made of the acce [...] }, "headers": { "CamelAwsBedrockOperation": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The operation that the producer performs. It replaces the operation option.", "constantName": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConstants#OPERATION" }, @@ -86,29 +87,30 @@ "properties": { "label": { "index": 0, "kind": "path", "displayName": "Label", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "A logical name of the endpoint, which you choose freely. The producer does not use it: the model and the operation a [...] "guardrailIdentifier": { "index": 1, "kind": "parameter", "displayName": "Guardrail Identifier", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The ID or ARN of the guardrail to apply. converse and converseStream apply it whe [...] - "guardrailTrace": { "index": 2, "kind": "parameter", "displayName": "Guardrail Trace", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether converse and converseStream ask for the trace of the guardrail of th [...] - "guardrailVersion": { "index": 3, "kind": "parameter", "displayName": "Guardrail Version", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "DRAFT", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The version of the guardrail, a number such as 1, or DRAFT for [...] - "includeStreamingMetadata": { "index": 4, "kind": "parameter", "displayName": "Include Streaming Metadata", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether the streaming operations and converseStream set [...] - "modelId": { "index": 5, "kind": "parameter", "displayName": "Model Id", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "amazon.titan-text-express-v1", "amazon.titan-text-lite-v1", "amazon.titan-image-generator-v1", "amazon.titan-embed-text-v1", "amazon.titan-embed-image-v1", "amazon.titan-text-premier-v1:0", "amazon.titan-embed-text-v2:0", "amazon.titan-image-generator-v2:0", "amazon.nova-canvas-v1:0", "amazon.nova-lite- [...] - "operation": { "index": 6, "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.aws2.bedrock.runtime.BedrockOperations", "enum": [ "invokeTextModel", "invokeImageModel", "invokeEmbeddingsModel", "invokeTextModelStreaming", "invokeImageModelStreaming", "invokeEmbeddingsModelStreaming", "converse", "converseStream", "applyGuardrail" ], "deprecated": false, "autowired": false, "secret [...] - "overrideEndpoint": { "index": 7, "kind": "parameter", "displayName": "Override Endpoint", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to send the requests to the URI of the uriEndpointOverride optio [...] - "pojoRequest": { "index": 8, "kind": "parameter", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether the body is the request object of the AWS SDK for the operation, which the [...] - "profileCredentialsName": { "index": 9, "kind": "parameter", "displayName": "Profile Credentials Name", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The name of the profile in the AWS shared credent [...] - "region": { "index": 10, "kind": "parameter", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "us-east-1", "us-east-2", "us-west-2", "us-gov-west-1", "ap-northeast-1", "ap-northeast-2", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ca-central-1", "eu-central-1", "eu-central-2", "eu-west-1", "eu-west-2", "eu-west-3", "sa-east-1" ], "deprecated": false, "autowired": false, "secret": false, "con [...] - "streamOutputMode": { "index": 11, "kind": "parameter", "displayName": "Stream Output Mode", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "complete", "chunks" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "complete", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "How the streaming operati [...] - "uriEndpointOverride": { "index": 12, "kind": "parameter", "displayName": "Uri Endpoint Override", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The URI of the endpoint to use instead of the endpoint of the region, for examp [...] - "useDefaultCredentialsProvider": { "index": 13, "kind": "parameter", "displayName": "Use Default Credentials Provider", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to load the credentials with the de [...] - "useProfileCredentialsProvider": { "index": 14, "kind": "parameter", "displayName": "Use Profile Credentials Provider", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to load the credentials from a prof [...] - "lazyStartProducer": { "index": 15, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produ [...] - "bedrockRuntimeAsyncClient": { "index": 16, "kind": "parameter", "displayName": "Bedrock Runtime Async Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.bedrockruntime.BedrockRuntimeAsyncClient", "deprecated": false, "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "To [...] - "bedrockRuntimeClient": { "index": 17, "kind": "parameter", "displayName": "Bedrock Runtime Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.bedrockruntime.BedrockRuntimeClient", "deprecated": false, "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "To use a custom sof [...] - "proxyHost": { "index": 18, "kind": "parameter", "displayName": "Proxy Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The host name of the proxy that the HTTP clients of Bedrock Runtime connect through. The proxy is [...] - "proxyPort": { "index": 19, "kind": "parameter", "displayName": "Proxy Port", "group": "proxy", "label": "proxy", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The port of the proxy that the HTTP clients of Bedrock Runtime connect through. The proxy is use [...] - "proxyProtocol": { "index": 20, "kind": "parameter", "displayName": "Proxy Protocol", "group": "proxy", "label": "proxy", "required": false, "type": "enum", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The protocol that [...] - "accessKey": { "index": 21, "kind": "parameter", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The access key ID of the AWS credentials, used together with the secret [...] - "secretKey": { "index": 22, "kind": "parameter", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The secret access key of the AWS credentials, used together with the ac [...] - "sessionToken": { "index": 23, "kind": "parameter", "displayName": "Session Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The session token of temporary AWS credentials, for example of an [...] - "trustAllCertificates": { "index": 24, "kind": "parameter", "displayName": "Trust All Certificates", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "security": "insecure:ssl", "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether the HTTP clients o [...] - "useSessionCredentials": { "index": 25, "kind": "parameter", "displayName": "Use Session Credentials", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to use temporary credentials made of the acc [...] + "guardrailStreamProcessingMode": { "index": 2, "kind": "parameter", "displayName": "Guardrail Stream Processing Mode", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "sync", "async" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "sync", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "How conv [...] + "guardrailTrace": { "index": 3, "kind": "parameter", "displayName": "Guardrail Trace", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether converse and converseStream ask for the trace of the guardrail of th [...] + "guardrailVersion": { "index": 4, "kind": "parameter", "displayName": "Guardrail Version", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "DRAFT", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The version of the guardrail, a number such as 1, or DRAFT for [...] + "includeStreamingMetadata": { "index": 5, "kind": "parameter", "displayName": "Include Streaming Metadata", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether the streaming operations and converseStream set [...] + "modelId": { "index": 6, "kind": "parameter", "displayName": "Model Id", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "amazon.titan-text-express-v1", "amazon.titan-text-lite-v1", "amazon.titan-image-generator-v1", "amazon.titan-embed-text-v1", "amazon.titan-embed-image-v1", "amazon.titan-text-premier-v1:0", "amazon.titan-embed-text-v2:0", "amazon.titan-image-generator-v2:0", "amazon.nova-canvas-v1:0", "amazon.nova-lite- [...] + "operation": { "index": 7, "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.aws2.bedrock.runtime.BedrockOperations", "enum": [ "invokeTextModel", "invokeImageModel", "invokeEmbeddingsModel", "invokeTextModelStreaming", "invokeImageModelStreaming", "invokeEmbeddingsModelStreaming", "converse", "converseStream", "applyGuardrail" ], "deprecated": false, "autowired": false, "secret [...] + "overrideEndpoint": { "index": 8, "kind": "parameter", "displayName": "Override Endpoint", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to send the requests to the URI of the uriEndpointOverride optio [...] + "pojoRequest": { "index": 9, "kind": "parameter", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether the body is the request object of the AWS SDK for the operation, which the [...] + "profileCredentialsName": { "index": 10, "kind": "parameter", "displayName": "Profile Credentials Name", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The name of the profile in the AWS shared creden [...] + "region": { "index": 11, "kind": "parameter", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "us-east-1", "us-east-2", "us-west-2", "us-gov-west-1", "ap-northeast-1", "ap-northeast-2", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ca-central-1", "eu-central-1", "eu-central-2", "eu-west-1", "eu-west-2", "eu-west-3", "sa-east-1" ], "deprecated": false, "autowired": false, "secret": false, "con [...] + "streamOutputMode": { "index": 12, "kind": "parameter", "displayName": "Stream Output Mode", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "complete", "chunks" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "complete", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "How the streaming operati [...] + "uriEndpointOverride": { "index": 13, "kind": "parameter", "displayName": "Uri Endpoint Override", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The URI of the endpoint to use instead of the endpoint of the region, for examp [...] + "useDefaultCredentialsProvider": { "index": 14, "kind": "parameter", "displayName": "Use Default Credentials Provider", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to load the credentials with the de [...] + "useProfileCredentialsProvider": { "index": 15, "kind": "parameter", "displayName": "Use Profile Credentials Provider", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to load the credentials from a prof [...] + "lazyStartProducer": { "index": 16, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produ [...] + "bedrockRuntimeAsyncClient": { "index": 17, "kind": "parameter", "displayName": "Bedrock Runtime Async Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.bedrockruntime.BedrockRuntimeAsyncClient", "deprecated": false, "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "To [...] + "bedrockRuntimeClient": { "index": 18, "kind": "parameter", "displayName": "Bedrock Runtime Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.bedrockruntime.BedrockRuntimeClient", "deprecated": false, "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "To use a custom sof [...] + "proxyHost": { "index": 19, "kind": "parameter", "displayName": "Proxy Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The host name of the proxy that the HTTP clients of Bedrock Runtime connect through. The proxy is [...] + "proxyPort": { "index": 20, "kind": "parameter", "displayName": "Proxy Port", "group": "proxy", "label": "proxy", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The port of the proxy that the HTTP clients of Bedrock Runtime connect through. The proxy is use [...] + "proxyProtocol": { "index": 21, "kind": "parameter", "displayName": "Proxy Protocol", "group": "proxy", "label": "proxy", "required": false, "type": "enum", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The protocol that [...] + "accessKey": { "index": 22, "kind": "parameter", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The access key ID of the AWS credentials, used together with the secret [...] + "secretKey": { "index": 23, "kind": "parameter", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The secret access key of the AWS credentials, used together with the ac [...] + "sessionToken": { "index": 24, "kind": "parameter", "displayName": "Session Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "The session token of temporary AWS credentials, for example of an [...] + "trustAllCertificates": { "index": 25, "kind": "parameter", "displayName": "Trust All Certificates", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "security": "insecure:ssl", "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether the HTTP clients o [...] + "useSessionCredentials": { "index": 26, "kind": "parameter", "displayName": "Use Session Credentials", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration", "configurationField": "configuration", "description": "Whether to use temporary credentials made of the acc [...] } } diff --git a/components/camel-aws/camel-aws-bedrock/src/main/docs/aws-bedrock-component.adoc b/components/camel-aws/camel-aws-bedrock/src/main/docs/aws-bedrock-component.adoc index 4a013e47efef..df2aed3c60b9 100644 --- a/components/camel-aws/camel-aws-bedrock/src/main/docs/aws-bedrock-component.adoc +++ b/components/camel-aws/camel-aws-bedrock/src/main/docs/aws-bedrock-component.adoc @@ -244,6 +244,8 @@ The Camel AWS Bedrock component provides comprehensive support for guardrails th - `guardrailIdentifier`: The ID or ARN of the guardrail to apply - `guardrailVersion`: The version of the guardrail (default: "DRAFT") - `guardrailTrace`: Whether to return trace information (default: false) +- `guardrailStreamProcessingMode`: How converseStream applies the guardrail to the streamed response, `sync` or `async` + (default: `sync`). See Guardrails with converseStream below. *Message-level Configuration* (per-message override via headers): @@ -270,6 +272,27 @@ aws-bedrock://label?operation=converseStream&modelId=anthropic.claude-3-sonnet-2 &guardrailIdentifier=abc123xyz&guardrailVersion=DRAFT ---- +==== Guardrails with converseStream + +Bedrock applies a guardrail to a streamed response in one of two processing modes, which the +`guardrailStreamProcessingMode` option chooses for the guardrail of the `guardrailIdentifier` option: + +- `sync` (default): Bedrock buffers the response chunks and checks them with the guardrail before it sends them. This + adds some latency, but every chunk the producer receives has been checked. +- `async`: Bedrock sends the chunks as soon as the model produces them and checks them in the background. Chunks that + the guardrail would block can reach the producer before Bedrock blocks the rest of the stream, and the guardrail + cannot mask sensitive information. + +The `guardrailTrace` option does not change the processing mode. When the `CamelAwsBedrockGuardrailConfig` header is a +`GuardrailStreamConfiguration`, its `streamProcessingMode` is used; a `GuardrailConfiguration` has none, so Bedrock +uses `sync`. + +[source] +---- +aws-bedrock://label?operation=converseStream&modelId=anthropic.claude-3-sonnet-20240229-v1:0 + &guardrailIdentifier=abc123xyz&guardrailTrace=true&guardrailStreamProcessingMode=async +---- + *applyGuardrail*: Standalone operation to validate content against a guardrail without invoking a model. The content is the `CamelAwsBedrockGuardrailContent` header, or else the message body as text. diff --git a/components/camel-aws/camel-aws-bedrock/src/main/java/org/apache/camel/component/aws2/bedrock/runtime/BedrockConfiguration.java b/components/camel-aws/camel-aws-bedrock/src/main/java/org/apache/camel/component/aws2/bedrock/runtime/BedrockConfiguration.java index d5157eae72c0..c62da3f03d31 100644 --- a/components/camel-aws/camel-aws-bedrock/src/main/java/org/apache/camel/component/aws2/bedrock/runtime/BedrockConfiguration.java +++ b/components/camel-aws/camel-aws-bedrock/src/main/java/org/apache/camel/component/aws2/bedrock/runtime/BedrockConfiguration.java @@ -157,6 +157,14 @@ public class BedrockConfiguration implements Cloneable, AwsCommonConfiguration { + " applyGuardrail.", defaultValue = "false") private boolean guardrailTrace; + @UriParam(description = "How converseStream applies the guardrail of the guardrailIdentifier option to the streamed" + + " response. With sync, Bedrock buffers the chunks and checks them with the guardrail before it" + + " sends them. With async, Bedrock sends the chunks at once and checks them in the background, so" + + " chunks that the guardrail would block can be sent before it blocks the rest, and masking of" + + " sensitive information is not supported. Not used when the CamelAwsBedrockGuardrailConfig" + + " header is set.", + defaultValue = "sync", enums = "sync,async") + private String guardrailStreamProcessingMode = "sync"; public BedrockRuntimeClient getBedrockRuntimeClient() { return bedrockRuntimeClient; @@ -351,6 +359,14 @@ public class BedrockConfiguration implements Cloneable, AwsCommonConfiguration { this.guardrailTrace = guardrailTrace; } + public String getGuardrailStreamProcessingMode() { + return guardrailStreamProcessingMode; + } + + public void setGuardrailStreamProcessingMode(String guardrailStreamProcessingMode) { + this.guardrailStreamProcessingMode = guardrailStreamProcessingMode; + } + // ************************************************* // // ************************************************* diff --git a/components/camel-aws/camel-aws-bedrock/src/main/java/org/apache/camel/component/aws2/bedrock/runtime/BedrockProducer.java b/components/camel-aws/camel-aws-bedrock/src/main/java/org/apache/camel/component/aws2/bedrock/runtime/BedrockProducer.java index 6d93c4bb342d..dff12b639b8d 100644 --- a/components/camel-aws/camel-aws-bedrock/src/main/java/org/apache/camel/component/aws2/bedrock/runtime/BedrockProducer.java +++ b/components/camel-aws/camel-aws-bedrock/src/main/java/org/apache/camel/component/aws2/bedrock/runtime/BedrockProducer.java @@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.bedrock.runtime; import java.util.ArrayList; import java.util.List; +import java.util.Locale; import org.apache.camel.Endpoint; import org.apache.camel.Exchange; @@ -75,11 +76,34 @@ public class BedrockProducer extends DefaultProducer { private static final List<String> INFERENCE_PROFILE_REGION_PREFIXES = List.of("us.", "eu.", "apac.", "us-gov."); private static final ObjectMapper MAPPER = JsonMapper.builderWithJackson2Defaults().build(); private transient String bedrockProducerToString; + private GuardrailStreamProcessingMode guardrailStreamProcessingMode; public BedrockProducer(Endpoint endpoint) { super(endpoint); } + @Override + protected void doStart() throws Exception { + super.doStart(); + guardrailStreamProcessingMode = toStreamProcessingMode(getConfiguration().getGuardrailStreamProcessingMode()); + } + + /** + * The processing mode of the guardrail of the endpoint for converseStream: sync when not set, and fails on a value + * that Bedrock does not know. + */ + private static GuardrailStreamProcessingMode toStreamProcessingMode(String value) { + if (ObjectHelper.isEmpty(value)) { + return GuardrailStreamProcessingMode.SYNC; + } + GuardrailStreamProcessingMode mode = GuardrailStreamProcessingMode.fromValue(value.toLowerCase(Locale.ROOT)); + if (mode == null || mode == GuardrailStreamProcessingMode.UNKNOWN_TO_SDK_VERSION) { + throw new IllegalArgumentException( + "Unknown guardrailStreamProcessingMode: " + value + ". Use sync or async."); + } + return mode; + } + @Override @SuppressWarnings("deprecation") public void process(Exchange exchange) throws Exception { @@ -930,9 +954,7 @@ public class BedrockProducer extends DefaultProducer { .trace(getConfiguration().isGuardrailTrace() ? GuardrailTrace.ENABLED : GuardrailTrace.DISABLED) - .streamProcessingMode(getConfiguration().isGuardrailTrace() - ? GuardrailStreamProcessingMode.ASYNC - : GuardrailStreamProcessingMode.SYNC) + .streamProcessingMode(guardrailStreamProcessingMode) .build()); } diff --git a/components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/runtime/BedrockProducerRequestTest.java b/components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/runtime/BedrockProducerRequestTest.java index 9e49ade36c88..8033844bb730 100644 --- a/components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/runtime/BedrockProducerRequestTest.java +++ b/components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/runtime/BedrockProducerRequestTest.java @@ -28,10 +28,12 @@ import java.util.concurrent.CompletableFuture; import org.apache.camel.CamelContext; import org.apache.camel.Exchange; import org.apache.camel.InvalidPayloadException; +import org.apache.camel.Producer; import org.apache.camel.ProducerTemplate; import org.apache.camel.component.aws2.bedrock.BedrockModels; import org.apache.camel.impl.DefaultCamelContext; import org.apache.camel.support.SimpleRegistry; +import org.apache.camel.support.service.ServiceHelper; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -51,6 +53,7 @@ import software.amazon.awssdk.services.bedrockruntime.model.ConversationRole; import software.amazon.awssdk.services.bedrockruntime.model.ConverseStreamRequest; import software.amazon.awssdk.services.bedrockruntime.model.ConverseStreamResponseHandler; import software.amazon.awssdk.services.bedrockruntime.model.GuardrailConfiguration; +import software.amazon.awssdk.services.bedrockruntime.model.GuardrailStreamProcessingMode; import software.amazon.awssdk.services.bedrockruntime.model.GuardrailTrace; import software.amazon.awssdk.services.bedrockruntime.model.InvokeModelRequest; import software.amazon.awssdk.services.bedrockruntime.model.InvokeModelResponse; @@ -66,6 +69,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.lenient; @@ -338,6 +342,8 @@ public class BedrockProducerRequestTest { assertEquals("my-guardrail", request.getValue().guardrailConfig().guardrailIdentifier()); assertEquals("1", request.getValue().guardrailConfig().guardrailVersion()); assertEquals(GuardrailTrace.ENABLED, request.getValue().guardrailConfig().trace()); + // no processing mode, so Bedrock uses its default (sync) + assertNull(request.getValue().guardrailConfig().streamProcessingMode()); } @Test @@ -356,6 +362,67 @@ public class BedrockProducerRequestTest { assertEquals(GuardrailTrace.ENABLED, request.getValue().guardrailConfig().trace()); } + @Test + public void converseStreamGuardrailTraceKeepsTheSyncProcessingMode() { + ConverseStreamRequest request = converseStreamRequest("&guardrailTrace=true"); + + assertEquals(GuardrailTrace.ENABLED, request.guardrailConfig().trace()); + assertEquals(GuardrailStreamProcessingMode.SYNC, request.guardrailConfig().streamProcessingMode()); + } + + @Test + public void converseStreamUsesTheSyncProcessingModeByDefault() { + ConverseStreamRequest request = converseStreamRequest(""); + + assertEquals(GuardrailTrace.DISABLED, request.guardrailConfig().trace()); + assertEquals(GuardrailStreamProcessingMode.SYNC, request.guardrailConfig().streamProcessingMode()); + } + + @Test + public void converseStreamUsesTheAsyncProcessingModeWhenSet() { + ConverseStreamRequest request = converseStreamRequest("&guardrailStreamProcessingMode=async"); + + assertEquals(GuardrailTrace.DISABLED, request.guardrailConfig().trace()); + assertEquals(GuardrailStreamProcessingMode.ASYNC, request.guardrailConfig().streamProcessingMode()); + } + + @Test + public void converseStreamUsesTheAsyncProcessingModeWithTheTrace() { + ConverseStreamRequest request = converseStreamRequest("&guardrailTrace=true&guardrailStreamProcessingMode=async"); + + assertEquals(GuardrailTrace.ENABLED, request.guardrailConfig().trace()); + assertEquals(GuardrailStreamProcessingMode.ASYNC, request.guardrailConfig().streamProcessingMode()); + } + + @Test + public void unknownGuardrailStreamProcessingModeFailsAtStartup() throws Exception { + Producer producer = camelContext.getEndpoint(converseStreamUri("&guardrailStreamProcessingMode=asynchronous")) + .createProducer(); + + IllegalArgumentException e = assertThrows(IllegalArgumentException.class, () -> ServiceHelper.startService(producer)); + assertEquals("Unknown guardrailStreamProcessingMode: asynchronous. Use sync or async.", e.getMessage()); + } + + private ConverseStreamRequest converseStreamRequest(String options) { + ArgumentCaptor<ConverseStreamRequest> request = ArgumentCaptor.forClass(ConverseStreamRequest.class); + when(asyncClient.converseStream(request.capture(), any(ConverseStreamResponseHandler.class))) + .thenReturn(CompletableFuture.completedFuture(null)); + + Exchange exchange = template.send(converseStreamUri(options), + ex -> ex.getMessage().setHeader(BedrockConstants.CONVERSE_MESSAGES, List.of(userMessage()))); + + assertNull(exchange.getException()); + assertEquals("my-guardrail", request.getValue().guardrailConfig().guardrailIdentifier()); + return request.getValue(); + } + + private static String converseStreamUri(String options) { + return "aws-bedrock://label?bedrockRuntimeAsyncClient=#bedrockAsyncClient" + + "&operation=converseStream&modelId=" + CLAUDE + + "&guardrailIdentifier=my-guardrail" + options + + "®ion=us-east-1&accessKey=unused&secretKey=unused"; + } + private static Message userMessage() { return Message.builder().role(ConversationRole.USER).content(ContentBlock.fromText("Hello")).build(); } diff --git a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc index 25708c2cd51b..46f40bdb20ae 100644 --- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc +++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc @@ -12297,6 +12297,15 @@ With `allowUrlBody=true`, a body that does not start with `version: 1` and is no with a space or a relative name, now fails with an `InvalidPayloadException`, as a URL with an unknown scheme already did. Before, it failed with an `IllegalArgumentException`. A URL that cannot be fetched keeps its own exception. +=== camel-aws-bedrock - guardrailTrace no longer switches converseStream to asynchronous guardrail processing + +For the `converseStream` operation with the guardrail of the `guardrailIdentifier` option, `guardrailTrace=true` used +to also set the processing mode of the guardrail on the stream to `async`, so Bedrock sent the response chunks before +the guardrail had checked them. Now `guardrailTrace` only asks for the trace, and the processing mode is the new +`guardrailStreamProcessingMode` option, with default `sync`: Bedrock checks the chunks with the guardrail before it +sends them. Set `guardrailStreamProcessingMode=async` to keep the old behavior. A +`CamelAwsBedrockGuardrailConfig` header is used as before. + === Kamelets - removed Kamelets The Kamelet catalog (camel-kamelets 4.24) removes Kamelets that could not work on Camel 4.23 or 4.24: diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AwsBedrockComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AwsBedrockComponentBuilderFactory.java index 28d1152c2d31..0f0ce69e0fe3 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AwsBedrockComponentBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AwsBedrockComponentBuilderFactory.java @@ -90,6 +90,30 @@ public interface AwsBedrockComponentBuilderFactory { } + /** + * How converseStream applies the guardrail of the guardrailIdentifier + * option to the streamed response. With sync, Bedrock buffers the + * chunks and checks them with the guardrail before it sends them. With + * async, Bedrock sends the chunks at once and checks them in the + * background, so chunks that the guardrail would block can be sent + * before it blocks the rest, and masking of sensitive information is + * not supported. Not used when the CamelAwsBedrockGuardrailConfig + * header is set. + * + * The option is a: <code>java.lang.String</code> type. + * + * Default: sync + * Group: producer + * + * @param guardrailStreamProcessingMode the value to set + * @return the dsl builder + */ + default AwsBedrockComponentBuilder guardrailStreamProcessingMode(java.lang.String guardrailStreamProcessingMode) { + doSetProperty("guardrailStreamProcessingMode", guardrailStreamProcessingMode); + return this; + } + + /** * Whether converse and converseStream ask for the trace of the * guardrail of the guardrailIdentifier option, which the producer gives @@ -649,6 +673,7 @@ public interface AwsBedrockComponentBuilderFactory { switch (name) { case "configuration": ((BedrockComponent) component).setConfiguration((org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration) value); return true; case "guardrailIdentifier": getOrCreateConfiguration((BedrockComponent) component).setGuardrailIdentifier((java.lang.String) value); return true; + case "guardrailStreamProcessingMode": getOrCreateConfiguration((BedrockComponent) component).setGuardrailStreamProcessingMode((java.lang.String) value); return true; case "guardrailTrace": getOrCreateConfiguration((BedrockComponent) component).setGuardrailTrace((boolean) value); return true; case "guardrailVersion": getOrCreateConfiguration((BedrockComponent) component).setGuardrailVersion((java.lang.String) value); return true; case "includeStreamingMetadata": getOrCreateConfiguration((BedrockComponent) component).setIncludeStreamingMetadata((boolean) value); return true; diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/BedrockEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/BedrockEndpointBuilderFactory.java index b48e4dbe4d0e..fa631e3ed164 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/BedrockEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/BedrockEndpointBuilderFactory.java @@ -63,6 +63,28 @@ public interface BedrockEndpointBuilderFactory { doSetProperty("guardrailIdentifier", guardrailIdentifier); return this; } + /** + * How converseStream applies the guardrail of the guardrailIdentifier + * option to the streamed response. With sync, Bedrock buffers the + * chunks and checks them with the guardrail before it sends them. With + * async, Bedrock sends the chunks at once and checks them in the + * background, so chunks that the guardrail would block can be sent + * before it blocks the rest, and masking of sensitive information is + * not supported. Not used when the CamelAwsBedrockGuardrailConfig + * header is set. + * + * The option is a: <code>java.lang.String</code> type. + * + * Default: sync + * Group: producer + * + * @param guardrailStreamProcessingMode the value to set + * @return the dsl builder + */ + default BedrockEndpointBuilder guardrailStreamProcessingMode(String guardrailStreamProcessingMode) { + doSetProperty("guardrailStreamProcessingMode", guardrailStreamProcessingMode); + return this; + } /** * Whether converse and converseStream ask for the trace of the * guardrail of the guardrailIdentifier option, which the producer gives
