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/06 14:25:09 UTC

(camel-kamelets) branch main updated (d77bd266 -> 6c1e9ac2)

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-kamelets.git


    from d77bd266 Regen for commit f02ea7091d98ff1b06c83be8d4619edd5815bb49 (#1929)
     new d53603c8 Added AWS Bedrock Text Sink Kamelet
     new 5d025c01 Added AWS Bedrock Text Sink Kamelet
     new 6c1e9ac2 Added AWS Bedrock Text Sink Kamelet

The 3 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:
 docs/modules/ROOT/nav.adoc                         |   1 +
 kamelets/aws-bedrock-text-sink.kamelet.yaml        | 107 +++++++++++++++++++++
 .../kamelets/catalog/KameletsCatalogTest.java      |   2 +-
 .../kamelets/aws-bedrock-text-sink.kamelet.yaml    | 107 +++++++++++++++++++++
 4 files changed, 216 insertions(+), 1 deletion(-)
 create mode 100644 kamelets/aws-bedrock-text-sink.kamelet.yaml
 create mode 100644 library/camel-kamelets/src/main/resources/kamelets/aws-bedrock-text-sink.kamelet.yaml


(camel-kamelets) 01/03: Added AWS Bedrock Text Sink Kamelet

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-kamelets.git

commit d53603c8c91a9ee3dfe048a818be2fa2d7308696
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Mar 6 15:15:48 2024 +0100

    Added AWS Bedrock Text Sink Kamelet
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 kamelets/aws-bedrock-text-sink.kamelet.yaml | 107 ++++++++++++++++++++++++++++
 1 file changed, 107 insertions(+)

diff --git a/kamelets/aws-bedrock-text-sink.kamelet.yaml b/kamelets/aws-bedrock-text-sink.kamelet.yaml
new file mode 100644
index 00000000..dfedb4fe
--- /dev/null
+++ b/kamelets/aws-bedrock-text-sink.kamelet.yaml
@@ -0,0 +1,107 @@
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+apiVersion: camel.apache.org/v1
+kind: Kamelet
+metadata:
+  name: aws-bedrock-text-sink
+  annotations:
+    camel.apache.org/kamelet.support.level: "Stable"
+    camel.apache.org/catalog.version: "4.5.0-SNAPSHOT"
+    camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgZGF0YS1uYW1lPSJMYXllciAxIiBpZD0iTGF5ZXJfMSIgdmlld0JveD0iMCAwIDUxMiA1MTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQzMC40MiwxOTYuMzJjOC0xMS4zOSwyMS4xNS0zOC4zMywwLTcyLjEzYTUyLjc5LDUyLjc5LDAsMCwwLTE3LjA2LTE3LjMxYy0xLjUzLTgtNy41NC0yNy4yNi0zMS40Mi00My45MUMzNTksNDcsMzI1LjUyLDQ5LjUzLDMxOS40NCw1MC4xNmE2NC4yNyw2NC4yNywwLDAsMC0xNi4wNy0yLjk0Yy0xNy4xNy0uODEtMzAuMzcsMy44OS0zOS43OCwxNC [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "AWS Bedrock"
+    camel.apache.org/kamelet.namespace: "AWS"
+  labels:
+    camel.apache.org/kamelet.type: "sink"
+spec:
+  definition:
+    title: "AWS Bedrock Text Sink"
+    description: |-
+      Send data for invoking a text model of Amazon Bedrock.
+
+      The basic authentication method for the Bedrock service is to specify an access key and a secret key. These parameters are optional because the Kamelet provides a default credentials provider.
+
+      If you use the default credentials provider, the Bedrock client loads the credentials through this provider and doesn't use the basic authentication method.
+    required:
+      - modelId
+      - region
+    type: object
+    properties:
+      modelId:
+        title: Model Id
+        description: The model Id to be used.
+        type: string
+        enum: ["amazon.titan-text-express-v1", "amazon.titan-text-lite-v1", "ai21.j2-ultra-v1", "ai21.j2-mid-v1"]
+      accessKey:
+        title: Access Key
+        description: The access key obtained from AWS.
+        type: string
+        format: password
+        x-descriptors:
+        - urn:camel:group:credentials
+      secretKey:
+        title: Secret Key
+        description: The secret key obtained from AWS.
+        type: string
+        format: password
+        x-descriptors:
+        - urn:camel:group:credentials
+      region:
+        title: AWS Region
+        description: The AWS region to access.
+        type: string
+        enum: ["us-east-1", "us-west-1", "ap-southeast-1", "ap-northeast-1", "eu-central-1"]
+      useDefaultCredentialsProvider:
+        title: Default Credentials Provider
+        description: If true, the Bedrock client loads credentials through a default credentials provider. If false, it uses the basic authentication method (access key and secret key).
+        type: boolean
+        default: false
+      uriEndpointOverride:
+        title: Overwrite Endpoint URI
+        description: The overriding endpoint URI. To use this option, you must also select the `overrideEndpoint` option.
+        type: string
+      overrideEndpoint:
+        title: Endpoint Overwrite
+        description: Select this option to override the endpoint URI. To use this option, you must also provide a URI for the `uriEndpointOverride` option.
+        type: boolean
+        default: false
+  dependencies:
+    - "camel:core"
+    - "camel:aws-bedrock"
+    - "camel:kamelet"
+  template:
+    from:
+      uri: "kamelet:source"
+      steps:
+      - setHeader:
+          name: "CamelAwsBedrockContentType"
+          constant: "application/json"
+      - setHeader:
+          name: "CamelAwsBedrockAcceptContentType"
+          constant: "application/json"       
+      - to:
+          uri: "aws-bedrock:bedrock-text"
+          parameters:
+            secretKey: "{{?secretKey}}"
+            accessKey: "{{?accessKey}}"
+            region: "{{region}}"
+            modelId: "{{modelId}}"
+            operation: invokeTextModel
+            useDefaultCredentialsProvider: "{{useDefaultCredentialsProvider}}"
+            uriEndpointOverride: "{{?uriEndpointOverride}}"
+            overrideEndpoint: "{{overrideEndpoint}}"


(camel-kamelets) 02/03: Added AWS Bedrock Text Sink Kamelet

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-kamelets.git

commit 5d025c0139829949165f0686dbff4d1cd4e3a2ed
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Mar 6 15:16:46 2024 +0100

    Added AWS Bedrock Text Sink Kamelet
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../kamelets/aws-bedrock-text-sink.kamelet.yaml    | 107 +++++++++++++++++++++
 1 file changed, 107 insertions(+)

diff --git a/library/camel-kamelets/src/main/resources/kamelets/aws-bedrock-text-sink.kamelet.yaml b/library/camel-kamelets/src/main/resources/kamelets/aws-bedrock-text-sink.kamelet.yaml
new file mode 100644
index 00000000..dfedb4fe
--- /dev/null
+++ b/library/camel-kamelets/src/main/resources/kamelets/aws-bedrock-text-sink.kamelet.yaml
@@ -0,0 +1,107 @@
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+apiVersion: camel.apache.org/v1
+kind: Kamelet
+metadata:
+  name: aws-bedrock-text-sink
+  annotations:
+    camel.apache.org/kamelet.support.level: "Stable"
+    camel.apache.org/catalog.version: "4.5.0-SNAPSHOT"
+    camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgZGF0YS1uYW1lPSJMYXllciAxIiBpZD0iTGF5ZXJfMSIgdmlld0JveD0iMCAwIDUxMiA1MTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQzMC40MiwxOTYuMzJjOC0xMS4zOSwyMS4xNS0zOC4zMywwLTcyLjEzYTUyLjc5LDUyLjc5LDAsMCwwLTE3LjA2LTE3LjMxYy0xLjUzLTgtNy41NC0yNy4yNi0zMS40Mi00My45MUMzNTksNDcsMzI1LjUyLDQ5LjUzLDMxOS40NCw1MC4xNmE2NC4yNyw2NC4yNywwLDAsMC0xNi4wNy0yLjk0Yy0xNy4xNy0uODEtMzAuMzcsMy44OS0zOS43OCwxNC [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "AWS Bedrock"
+    camel.apache.org/kamelet.namespace: "AWS"
+  labels:
+    camel.apache.org/kamelet.type: "sink"
+spec:
+  definition:
+    title: "AWS Bedrock Text Sink"
+    description: |-
+      Send data for invoking a text model of Amazon Bedrock.
+
+      The basic authentication method for the Bedrock service is to specify an access key and a secret key. These parameters are optional because the Kamelet provides a default credentials provider.
+
+      If you use the default credentials provider, the Bedrock client loads the credentials through this provider and doesn't use the basic authentication method.
+    required:
+      - modelId
+      - region
+    type: object
+    properties:
+      modelId:
+        title: Model Id
+        description: The model Id to be used.
+        type: string
+        enum: ["amazon.titan-text-express-v1", "amazon.titan-text-lite-v1", "ai21.j2-ultra-v1", "ai21.j2-mid-v1"]
+      accessKey:
+        title: Access Key
+        description: The access key obtained from AWS.
+        type: string
+        format: password
+        x-descriptors:
+        - urn:camel:group:credentials
+      secretKey:
+        title: Secret Key
+        description: The secret key obtained from AWS.
+        type: string
+        format: password
+        x-descriptors:
+        - urn:camel:group:credentials
+      region:
+        title: AWS Region
+        description: The AWS region to access.
+        type: string
+        enum: ["us-east-1", "us-west-1", "ap-southeast-1", "ap-northeast-1", "eu-central-1"]
+      useDefaultCredentialsProvider:
+        title: Default Credentials Provider
+        description: If true, the Bedrock client loads credentials through a default credentials provider. If false, it uses the basic authentication method (access key and secret key).
+        type: boolean
+        default: false
+      uriEndpointOverride:
+        title: Overwrite Endpoint URI
+        description: The overriding endpoint URI. To use this option, you must also select the `overrideEndpoint` option.
+        type: string
+      overrideEndpoint:
+        title: Endpoint Overwrite
+        description: Select this option to override the endpoint URI. To use this option, you must also provide a URI for the `uriEndpointOverride` option.
+        type: boolean
+        default: false
+  dependencies:
+    - "camel:core"
+    - "camel:aws-bedrock"
+    - "camel:kamelet"
+  template:
+    from:
+      uri: "kamelet:source"
+      steps:
+      - setHeader:
+          name: "CamelAwsBedrockContentType"
+          constant: "application/json"
+      - setHeader:
+          name: "CamelAwsBedrockAcceptContentType"
+          constant: "application/json"       
+      - to:
+          uri: "aws-bedrock:bedrock-text"
+          parameters:
+            secretKey: "{{?secretKey}}"
+            accessKey: "{{?accessKey}}"
+            region: "{{region}}"
+            modelId: "{{modelId}}"
+            operation: invokeTextModel
+            useDefaultCredentialsProvider: "{{useDefaultCredentialsProvider}}"
+            uriEndpointOverride: "{{?uriEndpointOverride}}"
+            overrideEndpoint: "{{overrideEndpoint}}"


(camel-kamelets) 03/03: Added AWS Bedrock Text Sink Kamelet

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-kamelets.git

commit 6c1e9ac2a0d5d4949a17a2e9b57b1aac4f29b5e5
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Mar 6 15:21:02 2024 +0100

    Added AWS Bedrock Text Sink Kamelet
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 docs/modules/ROOT/nav.adoc                                              | 1 +
 .../java/org/apache/camel/kamelets/catalog/KameletsCatalogTest.java     | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
index 9ef5e6db..aab32f35 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -1,6 +1,7 @@
 // THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
 * xref:avro-deserialize-action.adoc[]
 * xref:avro-serialize-action.adoc[]
+* xref:aws-bedrock-text-sink.adoc[]
 * xref:aws-cloudtrail-source.adoc[]
 * xref:aws-cloudwatch-sink.adoc[]
 * xref:aws-ddb-sink.adoc[]
diff --git a/library/camel-kamelets-catalog/src/test/java/org/apache/camel/kamelets/catalog/KameletsCatalogTest.java b/library/camel-kamelets-catalog/src/test/java/org/apache/camel/kamelets/catalog/KameletsCatalogTest.java
index fc2d4fd3..381a7857 100644
--- a/library/camel-kamelets-catalog/src/test/java/org/apache/camel/kamelets/catalog/KameletsCatalogTest.java
+++ b/library/camel-kamelets-catalog/src/test/java/org/apache/camel/kamelets/catalog/KameletsCatalogTest.java
@@ -103,7 +103,7 @@ public class KameletsCatalogTest {
     void testGetKameletsByNamespace() throws Exception {
         List<Kamelet> c = catalog.getKameletsByNamespace("AWS");
         assertFalse(c.isEmpty());
-        assertEquals(27, c.size());
+        assertEquals(28, c.size());
         c = catalog.getKameletsByGroups("Not-existing-group");
         assertTrue(c.isEmpty());
     }