You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2024/03/14 10:52:52 UTC

(camel) branch main updated (5ffd496ea90 -> 825e9858ef1)

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


    from 5ffd496ea90 Regen (#13483)
     new 6fd7a44720b Camel-AWS-Bedrock: Add documentation for Embeddings Titan G1
     new dc2630e85fe Camel-AWS-Bedrock: Add documentation for Jurassic2-Ultra model
     new 32fc9f09664 Camel-AWS-Bedrock: Add documentation for Jurassic2-Mid model
     new 9f8ab951367 Camel-AWS-Bedrock: Add documentation for Anthropic Claude 1.2
     new cf34bb6c38e Camel-AWS-Bedrock: Add documentation for Anthropic Claude 2
     new b71eca6e0d4 Camel-AWS-Bedrock: Add documentation for Anthropic Claude 2.1
     new e752fa6956a Camel-AWS-Bedrock: Add documentation for Anthropic Claude Sonnet 3
     new 825e9858ef1 Remove not needed import

The 8 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../src/main/docs/aws-bedrock-component.adoc       | 395 +++++++++++++++++++++
 .../runtime/integration/BedrockProducerIT.java     |   2 +-
 2 files changed, 396 insertions(+), 1 deletion(-)


(camel) 07/08: Camel-AWS-Bedrock: Add documentation for Anthropic Claude Sonnet 3

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit e752fa6956a83c3cdd7668c9aacb9d281108e480
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Mar 14 11:12:15 2024 +0100

    Camel-AWS-Bedrock: Add documentation for Anthropic Claude Sonnet 3
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../src/main/docs/aws-bedrock-component.adoc       | 63 ++++++++++++++++++++++
 .../runtime/integration/BedrockProducerIT.java     | 25 +++++----
 2 files changed, 75 insertions(+), 13 deletions(-)

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 2ccd3eb465a..b8d37dcc976 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
@@ -555,6 +555,69 @@ Json schema for request
 }
 --------------------------------------------------------------------------------
 
+- Claude 3 Sonnet with id `anthropic.claude-3-sonnet-20240229-v1:0"`
+Claude 3 Sonnet by Anthropic strikes the ideal balance between intelligence and speed—particularly for enterprise workloads.
+
+Json schema for request
+
+[source,json]
+--------------------------------------------------------------------------------
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "type": "object",
+  "properties": {
+    "messages": {
+      "type": "array",
+      "items": [
+        {
+          "type": "object",
+          "properties": {
+            "role": {
+              "type": "string"
+            },
+            "content": {
+              "type": "array",
+              "items": [
+                {
+                  "type": "object",
+                  "properties": {
+                    "type": {
+                      "type": "string"
+                    },
+                    "text": {
+                      "type": "string"
+                    }
+                  },
+                  "required": [
+                    "type",
+                    "text"
+                  ]
+                }
+              ]
+            }
+          },
+          "required": [
+            "role",
+            "content"
+          ]
+        }
+      ]
+    },
+    "max_tokens": {
+      "type": "integer"
+    },
+    "anthropic_version": {
+      "type": "string"
+    }
+  },
+  "required": [
+    "messages",
+    "max_tokens",
+    "anthropic_version"
+  ]
+}
+--------------------------------------------------------------------------------
+
 === Bedrock Producer operations
 
 Camel-AWS Bedrock component provides the following operation on the producer side:
diff --git a/components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/runtime/integration/BedrockProducerIT.java b/components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/runtime/integration/BedrockProducerIT.java
index 8a2eab71fab..b0a9bb36346 100644
--- a/components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/runtime/integration/BedrockProducerIT.java
+++ b/components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/runtime/integration/BedrockProducerIT.java
@@ -32,10 +32,10 @@ import org.junit.jupiter.api.condition.EnabledIfSystemProperties;
 import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
 
 // Must be manually tested. Provide your own accessKey and secretKey using -Daws.manual.access.key and -Daws.manual.secret.key
-/*@EnabledIfSystemProperties({
+@EnabledIfSystemProperties({
         @EnabledIfSystemProperty(named = "aws.manual.access.key", matches = ".*", disabledReason = "Access key not provided"),
         @EnabledIfSystemProperty(named = "aws.manual.secret.key", matches = ".*", disabledReason = "Secret key not provided")
-})*/
+})
 @TestInstance(TestInstance.Lifecycle.PER_CLASS)
 class BedrockProducerIT extends CamelTestSupport {
 
@@ -263,7 +263,6 @@ class BedrockProducerIT extends CamelTestSupport {
             rootNode.putIfAbsent("top_k", new IntNode(250));
             rootNode.putIfAbsent("anthropic_version", new TextNode("bedrock-2023-05-31"));
 
-            System.err.println(mapper.writer().writeValueAsString(rootNode));
             exchange.getMessage().setBody(mapper.writer().writeValueAsString(rootNode));
             exchange.getMessage().setHeader(BedrockConstants.MODEL_CONTENT_TYPE, "application/json");
             exchange.getMessage().setHeader(BedrockConstants.MODEL_ACCEPT_CONTENT_TYPE, "application/json");
@@ -343,17 +342,17 @@ class BedrockProducerIT extends CamelTestSupport {
             @Override
             public void configure() {
                 from("direct:send_titan_express")
-                        .to("aws-bedrock:label?useDefaultCredentialsProvider=true&region=eu-central-1&operation=invokeTextModel&modelId="
+                        .to("aws-bedrock:label?accessKey=RAW({{aws.manual.access.key}})&secretKey=RAW({{aws.manual.secret.key}}&region=eu-central-1&operation=invokeTextModel&modelId="
                             + BedrockModels.TITAN_TEXT_EXPRESS_V1.model)
                         .to(result);
 
                 from("direct:send_titan_lite")
-                        .to("aws-bedrock:label?useDefaultCredentialsProvider=true&region=us-east-1&operation=invokeTextModel&modelId="
+                        .to("aws-bedrock:label?accessKey=RAW({{aws.manual.access.key}})&secretKey=RAW({{aws.manual.secret.key}}&region=us-east-1&operation=invokeTextModel&modelId="
                             + BedrockModels.TITAN_TEXT_LITE_V1.model)
                         .to(result);
 
                 from("direct:send_titan_image")
-                        .to("aws-bedrock:label?useDefaultCredentialsProvider=true&region=us-east-1&operation=invokeImageModel&modelId="
+                        .to("aws-bedrock:label?accessKey=RAW({{aws.manual.access.key}})&secretKey=RAW({{aws.manual.secret.key}}&region=us-east-1&operation=invokeImageModel&modelId="
                             + BedrockModels.TITAN_IMAGE_GENERATOR_V1.model)
                         .split(body())
                         .unmarshal().base64()
@@ -361,12 +360,12 @@ class BedrockProducerIT extends CamelTestSupport {
                         .to(result);
 
                 from("direct:send_titan_embeddings")
-                        .to("aws-bedrock:label?useDefaultCredentialsProvider=true&region=us-east-1&operation=invokeEmbeddingsModel&modelId="
+                        .to("aws-bedrock:label?accessKey=RAW({{aws.manual.access.key}})&secretKey=RAW({{aws.manual.secret.key}}&region=us-east-1&operation=invokeEmbeddingsModel&modelId="
                             + BedrockModels.TITAN_EMBEDDINGS_G1.model)
                         .to(result);
 
                 from("direct:send_jurassic2_model")
-                        .to("aws-bedrock:label?useDefaultCredentialsProvider=true&region=us-east-1&operation=invokeTextModel&modelId="
+                        .to("aws-bedrock:label?accessKey=RAW({{aws.manual.access.key}})&secretKey=RAW({{aws.manual.secret.key}}&region=us-east-1&operation=invokeTextModel&modelId="
                             + BedrockModels.JURASSIC2_ULTRA.model)
                         .split(body())
                         .transform().jq(".data.text")
@@ -374,7 +373,7 @@ class BedrockProducerIT extends CamelTestSupport {
                         .to(result);
 
                 from("direct:send_jurassic2_mid_model")
-                        .to("aws-bedrock:label?useDefaultCredentialsProvider=true&region=us-east-1&operation=invokeTextModel&modelId="
+                        .to("aws-bedrock:label?accessKey=RAW({{aws.manual.access.key}})&secretKey=RAW({{aws.manual.secret.key}}&region=us-east-1&operation=invokeTextModel&modelId="
                             + BedrockModels.JURASSIC2_MID.model)
                         .split(body())
                         .transform().jq(".data.text")
@@ -382,25 +381,25 @@ class BedrockProducerIT extends CamelTestSupport {
                         .to(result);
 
                 from("direct:send_anthropic_v1_model")
-                        .to("aws-bedrock:label?useDefaultCredentialsProvider=true&region=us-east-1&operation=invokeTextModel&modelId="
+                        .to("aws-bedrock:label?accessKey=RAW({{aws.manual.access.key}})&secretKey=RAW({{aws.manual.secret.key}}&region=us-east-1&operation=invokeTextModel&modelId="
                             + BedrockModels.ANTROPHIC_CLAUDE_INSTANT_V1.model)
                         .log("${body}")
                         .to(result);
 
                 from("direct:send_anthropic_v2_model")
-                        .to("aws-bedrock:label?useDefaultCredentialsProvider=true&region=us-east-1&operation=invokeTextModel&modelId="
+                        .to("aws-bedrock:label?accessKey=RAW({{aws.manual.access.key}})&secretKey=RAW({{aws.manual.secret.key}}&region=us-east-1&operation=invokeTextModel&modelId="
                             + BedrockModels.ANTROPHIC_CLAUDE_V2.model)
                         .log("${body}")
                         .to(result);
 
                 from("direct:send_anthropic_v21_model")
-                        .to("aws-bedrock:label?useDefaultCredentialsProvider=true&region=us-east-1&operation=invokeTextModel&modelId="
+                        .to("aws-bedrock:label?accessKey=RAW({{aws.manual.access.key}})&secretKey=RAW({{aws.manual.secret.key}}&region=us-east-1&operation=invokeTextModel&modelId="
                             + BedrockModels.ANTROPHIC_CLAUDE_V2_1.model)
                         .log("${body}")
                         .to(result);
 
                 from("direct:send_anthropic_v3_model")
-                        .to("aws-bedrock:label?useDefaultCredentialsProvider=true&region=us-east-1&operation=invokeTextModel&modelId="
+                        .to("aws-bedrock:label?accessKey=RAW({{aws.manual.access.key}})&secretKey=RAW({{aws.manual.secret.key}}&region=us-east-1&operation=invokeTextModel&modelId="
                             + BedrockModels.ANTROPHIC_CLAUDE_V3.model)
                         .log("Completions: ${body}")
                         .to(result);


(camel) 06/08: Camel-AWS-Bedrock: Add documentation for Anthropic Claude 2.1

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit b71eca6e0d4c480d45c46f5605d104f4e3650391
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Mar 14 11:00:19 2024 +0100

    Camel-AWS-Bedrock: Add documentation for Anthropic Claude 2.1
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../src/main/docs/aws-bedrock-component.adoc       | 48 ++++++++++++++++++++++
 1 file changed, 48 insertions(+)

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 077509317af..2ccd3eb465a 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
@@ -505,7 +505,55 @@ Json schema for request
 }
 --------------------------------------------------------------------------------
 
+- Claude 2.1 with id `anthropic.claude-v2:1`
+An update to Claude 2 that features double the context window, plus improvements across reliability, hallucination rates, and evidence-based accuracy in long document and RAG contexts.
 
+Json schema for request
+
+[source,json]
+--------------------------------------------------------------------------------
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "type": "object",
+  "properties": {
+    "prompt": {
+      "type": "string"
+    },
+    "max_tokens_to_sample": {
+      "type": "integer"
+    },
+    "stop_sequences": {
+      "type": "array",
+      "items": [
+        {
+          "type": "string"
+        }
+      ]
+    },
+    "temperature": {
+      "type": "number"
+    },
+    "top_p": {
+      "type": "integer"
+    },
+    "top_k": {
+      "type": "integer"
+    },
+    "anthropic_version": {
+      "type": "string"
+    }
+  },
+  "required": [
+    "prompt",
+    "max_tokens_to_sample",
+    "stop_sequences",
+    "temperature",
+    "top_p",
+    "top_k",
+    "anthropic_version"
+  ]
+}
+--------------------------------------------------------------------------------
 
 === Bedrock Producer operations
 


(camel) 05/08: Camel-AWS-Bedrock: Add documentation for Anthropic Claude 2

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit cf34bb6c38e78a96ec3b01b9ccdf4f9908440190
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Mar 14 10:59:09 2024 +0100

    Camel-AWS-Bedrock: Add documentation for Anthropic Claude 2
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../src/main/docs/aws-bedrock-component.adoc       | 52 ++++++++++++++++++++++
 .../runtime/integration/BedrockProducerIT.java     |  3 +-
 2 files changed, 54 insertions(+), 1 deletion(-)

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 d2b5240c1a0..077509317af 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
@@ -455,6 +455,58 @@ Json schema for request
 }
 --------------------------------------------------------------------------------
 
+- Claude 2 with id `anthropic.claude-v2`
+Anthropic's highly capable model across a wide range of tasks from sophisticated dialogue and creative content generation to detailed instruction following.
+
+Json schema for request
+
+[source,json]
+--------------------------------------------------------------------------------
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "type": "object",
+  "properties": {
+    "prompt": {
+      "type": "string"
+    },
+    "max_tokens_to_sample": {
+      "type": "integer"
+    },
+    "stop_sequences": {
+      "type": "array",
+      "items": [
+        {
+          "type": "string"
+        }
+      ]
+    },
+    "temperature": {
+      "type": "number"
+    },
+    "top_p": {
+      "type": "integer"
+    },
+    "top_k": {
+      "type": "integer"
+    },
+    "anthropic_version": {
+      "type": "string"
+    }
+  },
+  "required": [
+    "prompt",
+    "max_tokens_to_sample",
+    "stop_sequences",
+    "temperature",
+    "top_p",
+    "top_k",
+    "anthropic_version"
+  ]
+}
+--------------------------------------------------------------------------------
+
+
+
 === Bedrock Producer operations
 
 Camel-AWS Bedrock component provides the following operation on the producer side:
diff --git a/components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/runtime/integration/BedrockProducerIT.java b/components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/runtime/integration/BedrockProducerIT.java
index 26db6ffbb56..8a2eab71fab 100644
--- a/components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/runtime/integration/BedrockProducerIT.java
+++ b/components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/runtime/integration/BedrockProducerIT.java
@@ -235,7 +235,7 @@ class BedrockProducerIT extends CamelTestSupport {
             rootNode.putIfAbsent("top_p", new IntNode(1));
             rootNode.putIfAbsent("top_k", new IntNode(250));
             rootNode.putIfAbsent("anthropic_version", new TextNode("bedrock-2023-05-31"));
-            
+
             exchange.getMessage().setBody(mapper.writer().writeValueAsString(rootNode));
             exchange.getMessage().setHeader(BedrockConstants.MODEL_CONTENT_TYPE, "application/json");
             exchange.getMessage().setHeader(BedrockConstants.MODEL_ACCEPT_CONTENT_TYPE, "application/json");
@@ -263,6 +263,7 @@ class BedrockProducerIT extends CamelTestSupport {
             rootNode.putIfAbsent("top_k", new IntNode(250));
             rootNode.putIfAbsent("anthropic_version", new TextNode("bedrock-2023-05-31"));
 
+            System.err.println(mapper.writer().writeValueAsString(rootNode));
             exchange.getMessage().setBody(mapper.writer().writeValueAsString(rootNode));
             exchange.getMessage().setHeader(BedrockConstants.MODEL_CONTENT_TYPE, "application/json");
             exchange.getMessage().setHeader(BedrockConstants.MODEL_ACCEPT_CONTENT_TYPE, "application/json");


(camel) 01/08: Camel-AWS-Bedrock: Add documentation for Embeddings Titan G1

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 6fd7a44720b11946da694329edc7b1f3bad4bc5b
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Mar 14 10:34:13 2024 +0100

    Camel-AWS-Bedrock: Add documentation for Embeddings Titan G1
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../src/main/docs/aws-bedrock-component.adoc       | 50 ++++++++++++++++++++++
 .../runtime/integration/BedrockProducerIT.java     | 22 +++++-----
 .../servicebus/client/ServiceBusClientFactory.java |  1 +
 3 files changed, 62 insertions(+), 11 deletions(-)

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 a436bdb88ef..9f0e4223ac2 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
@@ -252,12 +252,34 @@ Json schema for request
 }
 --------------------------------------------------------------------------------
 
+- Titan Embeddings G1 with id `amazon.titan-embed-text-v1`
+The Amazon Titan Embeddings G1 - Text – Text v1.2 can intake up to 8k tokens and outputs a vector of 1,536 dimensions. The model also works in 25+ different language
+
+Json schema for request
+
+[source,json]
+--------------------------------------------------------------------------------
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "type": "object",
+  "properties": {
+    "inputText": {
+      "type": "string"
+    }
+  },
+  "required": [
+    "inputText"
+  ]
+}
+--------------------------------------------------------------------------------
+
 === Bedrock Producer operations
 
 Camel-AWS Bedrock component provides the following operation on the producer side:
 
 - invokeTextModel
 - invokeImageModel
+- invokeEmbeddingsModel
 
 == Producer Examples
 
@@ -338,6 +360,34 @@ and you can the send to the direct endpoint something like
 
 where template is a ProducerTemplate.
 
+- invokeEmbeddingsModel: this operation will invoke an Embeddings model from Bedrock. This is an example for Titan Embeddings G1.
+
+[source,java]
+--------------------------------------------------------------------------------
+from("direct:send_titan_embeddings")
+    .to("aws-bedrock:label?useDefaultCredentialsProvider=true&region=us-east-1&operation=invokeEmbeddingsModel&modelId="
+    + BedrockModels.TITAN_EMBEDDINGS_G1.model)
+    .to(result);
+--------------------------------------------------------------------------------
+
+and you can the send to the direct endpoint something like
+
+[source,java]
+--------------------------------------------------------------------------------
+        final Exchange result = template.send("direct:send_titan_embeddings", exchange -> {
+            ObjectMapper mapper = new ObjectMapper();
+            ObjectNode rootNode = mapper.createObjectNode();
+            rootNode.putIfAbsent("inputText",
+                    new TextNode("A Sci-fi camel running in the desert"));
+
+            exchange.getMessage().setBody(mapper.writer().writeValueAsString(rootNode));
+            exchange.getMessage().setHeader(BedrockConstants.MODEL_CONTENT_TYPE, "application/json");
+            exchange.getMessage().setHeader(BedrockConstants.MODEL_ACCEPT_CONTENT_TYPE, "*/*");
+        });
+--------------------------------------------------------------------------------
+
+where template is a ProducerTemplate.
+
 == Dependencies
 
 Maven users will need to add the following dependency to their pom.xml.
diff --git a/components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/runtime/integration/BedrockProducerIT.java b/components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/runtime/integration/BedrockProducerIT.java
index bfe93173df8..adb4a1a2538 100644
--- a/components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/runtime/integration/BedrockProducerIT.java
+++ b/components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/runtime/integration/BedrockProducerIT.java
@@ -32,10 +32,10 @@ import org.junit.jupiter.api.condition.EnabledIfSystemProperties;
 import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
 
 // Must be manually tested. Provide your own accessKey and secretKey using -Daws.manual.access.key and -Daws.manual.secret.key
-@EnabledIfSystemProperties({
+/*@EnabledIfSystemProperties({
         @EnabledIfSystemProperty(named = "aws.manual.access.key", matches = ".*", disabledReason = "Access key not provided"),
         @EnabledIfSystemProperty(named = "aws.manual.secret.key", matches = ".*", disabledReason = "Secret key not provided")
-})
+})*/
 @TestInstance(TestInstance.Lifecycle.PER_CLASS)
 class BedrockProducerIT extends CamelTestSupport {
 
@@ -342,17 +342,17 @@ class BedrockProducerIT extends CamelTestSupport {
             @Override
             public void configure() {
                 from("direct:send_titan_express")
-                        .to("aws-bedrock:label?accessKey=RAW({{aws.manual.access.key}})&secretKey=RAW({{aws.manual.secret.key}}&region=eu-central-1&operation=invokeTextModel&modelId="
+                        .to("aws-bedrock:label?useDefaultCredentialsProvider=true&region=eu-central-1&operation=invokeTextModel&modelId="
                             + BedrockModels.TITAN_TEXT_EXPRESS_V1.model)
                         .to(result);
 
                 from("direct:send_titan_lite")
-                        .to("aws-bedrock:label?accessKey=RAW({{aws.manual.access.key}})&secretKey=RAW({{aws.manual.secret.key}}&region=us-east-1&operation=invokeTextModel&modelId="
+                        .to("aws-bedrock:label?useDefaultCredentialsProvider=true&region=us-east-1&operation=invokeTextModel&modelId="
                             + BedrockModels.TITAN_TEXT_LITE_V1.model)
                         .to(result);
 
                 from("direct:send_titan_image")
-                        .to("aws-bedrock:label?accessKey=RAW({{aws.manual.access.key}})&secretKey=RAW({{aws.manual.secret.key}}&region=us-east-1&operation=invokeImageModel&modelId="
+                        .to("aws-bedrock:label?useDefaultCredentialsProvider=true&region=us-east-1&operation=invokeImageModel&modelId="
                             + BedrockModels.TITAN_IMAGE_GENERATOR_V1.model)
                         .split(body())
                         .unmarshal().base64()
@@ -360,12 +360,12 @@ class BedrockProducerIT extends CamelTestSupport {
                         .to(result);
 
                 from("direct:send_titan_embeddings")
-                        .to("aws-bedrock:label?accessKey=RAW({{aws.manual.access.key}})&secretKey=RAW({{aws.manual.secret.key}}&region=us-east-1&operation=invokeEmbeddingsModel&modelId="
+                        .to("aws-bedrock:label?useDefaultCredentialsProvider=true&region=us-east-1&operation=invokeEmbeddingsModel&modelId="
                             + BedrockModels.TITAN_EMBEDDINGS_G1.model)
                         .to(result);
 
                 from("direct:send_jurassic2_model")
-                        .to("aws-bedrock:label?accessKey=RAW({{aws.manual.access.key}})&secretKey=RAW({{aws.manual.secret.key}}&region=us-east-1&operation=invokeTextModel&modelId="
+                        .to("aws-bedrock:label?useDefaultCredentialsProvider=true&region=us-east-1&operation=invokeTextModel&modelId="
                             + BedrockModels.JURASSIC2_ULTRA.model)
                         .split(body())
                         .transform().jq(".data.text")
@@ -381,25 +381,25 @@ class BedrockProducerIT extends CamelTestSupport {
                         .to(result);
 
                 from("direct:send_anthropic_v1_model")
-                        .to("aws-bedrock:label?accessKey=RAW({{aws.manual.access.key}})&secretKey=RAW({{aws.manual.secret.key}}&region=us-east-1&operation=invokeTextModel&modelId="
+                        .to("aws-bedrock:label?useDefaultCredentialsProvider=true&region=us-east-1&operation=invokeTextModel&modelId="
                             + BedrockModels.ANTROPHIC_CLAUDE_INSTANT_V1.model)
                         .log("${body}")
                         .to(result);
 
                 from("direct:send_anthropic_v2_model")
-                        .to("aws-bedrock:label?accessKey=RAW({{aws.manual.access.key}})&secretKey=RAW({{aws.manual.secret.key}}&region=us-east-1&operation=invokeTextModel&modelId="
+                        .to("aws-bedrock:label?useDefaultCredentialsProvider=true&region=us-east-1&operation=invokeTextModel&modelId="
                             + BedrockModels.ANTROPHIC_CLAUDE_V2.model)
                         .log("${body}")
                         .to(result);
 
                 from("direct:send_anthropic_v21_model")
-                        .to("aws-bedrock:label?accessKey=RAW({{aws.manual.access.key}})&secretKey=RAW({{aws.manual.secret.key}}&region=us-east-1&operation=invokeTextModel&modelId="
+                        .to("aws-bedrock:label?useDefaultCredentialsProvider=true&region=us-east-1&operation=invokeTextModel&modelId="
                             + BedrockModels.ANTROPHIC_CLAUDE_V2_1.model)
                         .log("${body}")
                         .to(result);
 
                 from("direct:send_anthropic_v3_model")
-                        .to("aws-bedrock:label?accessKey=RAW({{aws.manual.access.key}})&secretKey=RAW({{aws.manual.secret.key}}&region=us-east-1&operation=invokeTextModel&modelId="
+                        .to("aws-bedrock:label?useDefaultCredentialsProvider=true&region=us-east-1&operation=invokeTextModel&modelId="
                             + BedrockModels.ANTROPHIC_CLAUDE_V3.model)
                         .log("Completions: ${body}")
                         .to(result);
diff --git a/components/camel-azure/camel-azure-servicebus/src/main/java/org/apache/camel/component/azure/servicebus/client/ServiceBusClientFactory.java b/components/camel-azure/camel-azure-servicebus/src/main/java/org/apache/camel/component/azure/servicebus/client/ServiceBusClientFactory.java
index 225f61da1c0..90173230eb8 100644
--- a/components/camel-azure/camel-azure-servicebus/src/main/java/org/apache/camel/component/azure/servicebus/client/ServiceBusClientFactory.java
+++ b/components/camel-azure/camel-azure-servicebus/src/main/java/org/apache/camel/component/azure/servicebus/client/ServiceBusClientFactory.java
@@ -21,6 +21,7 @@ import com.azure.identity.DefaultAzureCredentialBuilder;
 import com.azure.messaging.servicebus.ServiceBusClientBuilder;
 import com.azure.messaging.servicebus.ServiceBusReceiverAsyncClient;
 import com.azure.messaging.servicebus.ServiceBusSenderAsyncClient;
+import com.azure.messaging.servicebus.models.SubQueue;
 import org.apache.camel.component.azure.servicebus.CredentialType;
 import org.apache.camel.component.azure.servicebus.ServiceBusConfiguration;
 import org.apache.camel.component.azure.servicebus.ServiceBusType;


(camel) 04/08: Camel-AWS-Bedrock: Add documentation for Anthropic Claude 1.2

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 9f8ab951367b6b818e5339b38a92588f07dcaa21
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Mar 14 10:50:31 2024 +0100

    Camel-AWS-Bedrock: Add documentation for Anthropic Claude 1.2
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../src/main/docs/aws-bedrock-component.adoc       | 50 ++++++++++++++++++++++
 .../runtime/integration/BedrockProducerIT.java     |  2 +-
 2 files changed, 51 insertions(+), 1 deletion(-)

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 23ab976cf9d..d2b5240c1a0 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
@@ -405,6 +405,56 @@ Json schema for request
 }
 --------------------------------------------------------------------------------
 
+- Claude Instant V1.2 with id `anthropic.claude-instant-v1`
+A fast, affordable yet still very capable model, which can handle a range of tasks including casual dialogue, text analysis, summarization, and document question-answering.
+
+Json schema for request
+
+[source,json]
+--------------------------------------------------------------------------------
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "type": "object",
+  "properties": {
+    "prompt": {
+      "type": "string"
+    },
+    "max_tokens_to_sample": {
+      "type": "integer"
+    },
+    "stop_sequences": {
+      "type": "array",
+      "items": [
+        {
+          "type": "string"
+        }
+      ]
+    },
+    "temperature": {
+      "type": "number"
+    },
+    "top_p": {
+      "type": "integer"
+    },
+    "top_k": {
+      "type": "integer"
+    },
+    "anthropic_version": {
+      "type": "string"
+    }
+  },
+  "required": [
+    "prompt",
+    "max_tokens_to_sample",
+    "stop_sequences",
+    "temperature",
+    "top_p",
+    "top_k",
+    "anthropic_version"
+  ]
+}
+--------------------------------------------------------------------------------
+
 === Bedrock Producer operations
 
 Camel-AWS Bedrock component provides the following operation on the producer side:
diff --git a/components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/runtime/integration/BedrockProducerIT.java b/components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/runtime/integration/BedrockProducerIT.java
index adb4a1a2538..26db6ffbb56 100644
--- a/components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/runtime/integration/BedrockProducerIT.java
+++ b/components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/runtime/integration/BedrockProducerIT.java
@@ -235,7 +235,7 @@ class BedrockProducerIT extends CamelTestSupport {
             rootNode.putIfAbsent("top_p", new IntNode(1));
             rootNode.putIfAbsent("top_k", new IntNode(250));
             rootNode.putIfAbsent("anthropic_version", new TextNode("bedrock-2023-05-31"));
-
+            
             exchange.getMessage().setBody(mapper.writer().writeValueAsString(rootNode));
             exchange.getMessage().setHeader(BedrockConstants.MODEL_CONTENT_TYPE, "application/json");
             exchange.getMessage().setHeader(BedrockConstants.MODEL_ACCEPT_CONTENT_TYPE, "application/json");


(camel) 03/08: Camel-AWS-Bedrock: Add documentation for Jurassic2-Mid model

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 32fc9f09664c960b66ebb050a9a7f5c4a9f6cc25
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Mar 14 10:43:39 2024 +0100

    Camel-AWS-Bedrock: Add documentation for Jurassic2-Mid model
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../src/main/docs/aws-bedrock-component.adoc       | 66 ++++++++++++++++++++++
 .../runtime/integration/BedrockProducerIT.java     |  2 -
 2 files changed, 66 insertions(+), 2 deletions(-)

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 8ecc15a9b72..23ab976cf9d 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
@@ -339,6 +339,72 @@ Json schema for request
 }
 --------------------------------------------------------------------------------
 
+- Jurassic2-Mid with id `ai21.j2-mid-v1`
+Jurassic-2 Mid is less powerful than Ultra, yet carefully designed to strike the right balance between exceptional quality and affordability.
+
+Json schema for request
+
+[source,json]
+--------------------------------------------------------------------------------
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "type": "object",
+  "properties": {
+    "prompt": {
+      "type": "string"
+    },
+    "maxTokens": {
+      "type": "integer"
+    },
+    "temperature": {
+      "type": "integer"
+    },
+    "topP": {
+      "type": "integer"
+    },
+    "stopSequences": {
+      "type": "array",
+      "items": [
+        {
+          "type": "string"
+        }
+      ]
+    },
+    "presencePenalty": {
+      "type": "object",
+      "properties": {
+        "scale": {
+          "type": "integer"
+        }
+      },
+      "required": [
+        "scale"
+      ]
+    },
+    "frequencyPenalty": {
+      "type": "object",
+      "properties": {
+        "scale": {
+          "type": "integer"
+        }
+      },
+      "required": [
+        "scale"
+      ]
+    }
+  },
+  "required": [
+    "prompt",
+    "maxTokens",
+    "temperature",
+    "topP",
+    "stopSequences",
+    "presencePenalty",
+    "frequencyPenalty"
+  ]
+}
+--------------------------------------------------------------------------------
+
 === Bedrock Producer operations
 
 Camel-AWS Bedrock component provides the following operation on the producer side:
diff --git a/components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/runtime/integration/BedrockProducerIT.java b/components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/runtime/integration/BedrockProducerIT.java
index 27408832610..adb4a1a2538 100644
--- a/components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/runtime/integration/BedrockProducerIT.java
+++ b/components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/runtime/integration/BedrockProducerIT.java
@@ -175,8 +175,6 @@ class BedrockProducerIT extends CamelTestSupport {
             rootNode.putIfAbsent("presencePenalty", childNode);
             rootNode.putIfAbsent("frequencyPenalty", childNode);
 
-            System.out.println(mapper.writer().writeValueAsString(rootNode));
-
             exchange.getMessage().setBody(mapper.writer().writeValueAsString(rootNode));
             exchange.getMessage().setHeader(BedrockConstants.MODEL_CONTENT_TYPE, "application/json");
             exchange.getMessage().setHeader(BedrockConstants.MODEL_ACCEPT_CONTENT_TYPE, "application/json");


(camel) 08/08: Remove not needed import

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 825e9858ef1dca3e083c046b929bae8cec4b3947
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Mar 14 11:14:07 2024 +0100

    Remove not needed import
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../camel/component/azure/servicebus/client/ServiceBusClientFactory.java | 1 -
 1 file changed, 1 deletion(-)

diff --git a/components/camel-azure/camel-azure-servicebus/src/main/java/org/apache/camel/component/azure/servicebus/client/ServiceBusClientFactory.java b/components/camel-azure/camel-azure-servicebus/src/main/java/org/apache/camel/component/azure/servicebus/client/ServiceBusClientFactory.java
index 90173230eb8..225f61da1c0 100644
--- a/components/camel-azure/camel-azure-servicebus/src/main/java/org/apache/camel/component/azure/servicebus/client/ServiceBusClientFactory.java
+++ b/components/camel-azure/camel-azure-servicebus/src/main/java/org/apache/camel/component/azure/servicebus/client/ServiceBusClientFactory.java
@@ -21,7 +21,6 @@ import com.azure.identity.DefaultAzureCredentialBuilder;
 import com.azure.messaging.servicebus.ServiceBusClientBuilder;
 import com.azure.messaging.servicebus.ServiceBusReceiverAsyncClient;
 import com.azure.messaging.servicebus.ServiceBusSenderAsyncClient;
-import com.azure.messaging.servicebus.models.SubQueue;
 import org.apache.camel.component.azure.servicebus.CredentialType;
 import org.apache.camel.component.azure.servicebus.ServiceBusConfiguration;
 import org.apache.camel.component.azure.servicebus.ServiceBusType;


(camel) 02/08: Camel-AWS-Bedrock: Add documentation for Jurassic2-Ultra model

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit dc2630e85febabfe4198399a20e2e41a85b07c36
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Mar 14 10:38:31 2024 +0100

    Camel-AWS-Bedrock: Add documentation for Jurassic2-Ultra model
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../src/main/docs/aws-bedrock-component.adoc       | 66 ++++++++++++++++++++++
 .../runtime/integration/BedrockProducerIT.java     |  2 +
 2 files changed, 68 insertions(+)

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 9f0e4223ac2..8ecc15a9b72 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
@@ -273,6 +273,72 @@ Json schema for request
 }
 --------------------------------------------------------------------------------
 
+- Jurassic2-Ultra with id `ai21.j2-ultra-v1`
+Jurassic-2 Ultra is AI21’s most powerful model for complex tasks that require advanced text generation and comprehension.
+
+Json schema for request
+
+[source,json]
+--------------------------------------------------------------------------------
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "type": "object",
+  "properties": {
+    "prompt": {
+      "type": "string"
+    },
+    "maxTokens": {
+      "type": "integer"
+    },
+    "temperature": {
+      "type": "integer"
+    },
+    "topP": {
+      "type": "integer"
+    },
+    "stopSequences": {
+      "type": "array",
+      "items": [
+        {
+          "type": "string"
+        }
+      ]
+    },
+    "presencePenalty": {
+      "type": "object",
+      "properties": {
+        "scale": {
+          "type": "integer"
+        }
+      },
+      "required": [
+        "scale"
+      ]
+    },
+    "frequencyPenalty": {
+      "type": "object",
+      "properties": {
+        "scale": {
+          "type": "integer"
+        }
+      },
+      "required": [
+        "scale"
+      ]
+    }
+  },
+  "required": [
+    "prompt",
+    "maxTokens",
+    "temperature",
+    "topP",
+    "stopSequences",
+    "presencePenalty",
+    "frequencyPenalty"
+  ]
+}
+--------------------------------------------------------------------------------
+
 === Bedrock Producer operations
 
 Camel-AWS Bedrock component provides the following operation on the producer side:
diff --git a/components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/runtime/integration/BedrockProducerIT.java b/components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/runtime/integration/BedrockProducerIT.java
index adb4a1a2538..27408832610 100644
--- a/components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/runtime/integration/BedrockProducerIT.java
+++ b/components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/runtime/integration/BedrockProducerIT.java
@@ -175,6 +175,8 @@ class BedrockProducerIT extends CamelTestSupport {
             rootNode.putIfAbsent("presencePenalty", childNode);
             rootNode.putIfAbsent("frequencyPenalty", childNode);
 
+            System.out.println(mapper.writer().writeValueAsString(rootNode));
+
             exchange.getMessage().setBody(mapper.writer().writeValueAsString(rootNode));
             exchange.getMessage().setHeader(BedrockConstants.MODEL_CONTENT_TYPE, "application/json");
             exchange.getMessage().setHeader(BedrockConstants.MODEL_ACCEPT_CONTENT_TYPE, "application/json");