multiwoven-integrations 0.22.6 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/multiwoven/integrations/core/constants.rb +8 -0
- data/lib/multiwoven/integrations/rollout.rb +2 -1
- data/lib/multiwoven/integrations/source/aws_bedrock_model/client.rb +92 -0
- data/lib/multiwoven/integrations/source/aws_bedrock_model/config/catalog.json +6 -0
- data/lib/multiwoven/integrations/source/aws_bedrock_model/config/meta.json +15 -0
- data/lib/multiwoven/integrations/source/aws_bedrock_model/config/spec.json +58 -0
- data/lib/multiwoven/integrations/source/aws_bedrock_model/icon.svg +1 -0
- data/lib/multiwoven/integrations.rb +2 -0
- metadata +7 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e98711e5541a7b51611bbf512f564615feae6270adf9c012efa5a27728311e15
|
|
4
|
+
data.tar.gz: bf73432b3da9db1c3f713c24c99aafb1db7c22811269f55fae5d65e5235c748d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ba6f9aaa123967c1759ec3c6b583fccc256b01ff8c2b67bd80df9a92eb84e0a69ce9d2193416a3d8ef8e4390a386478f50acf62ee603477ea1dc8227b65dcb49
|
|
7
|
+
data.tar.gz: 3a95750285de2d26d95d5edbd18053ed8453205bb11333b35d2825270839c1d471f38155518659c6f5479fb1d474c95907e100893eefe89d50b62dc325ab0d37
|
|
@@ -75,6 +75,14 @@ module Multiwoven
|
|
|
75
75
|
|
|
76
76
|
OPEN_AI_URL = "https://api.openai.com/v1/chat/completions"
|
|
77
77
|
ANTHROPIC_URL = "https://api.anthropic.com/v1/messages"
|
|
78
|
+
|
|
79
|
+
# Bedrock Models
|
|
80
|
+
MISTRAL_AI_MODEL = %w[
|
|
81
|
+
mistral.mistral-large-2402-v1:0
|
|
82
|
+
mistral.mistral-7b-instruct-v0:2
|
|
83
|
+
mistral.mixtral-8x7b-instruct-v0:1
|
|
84
|
+
mistral.mistral-small-2402-v1:0
|
|
85
|
+
].freeze
|
|
78
86
|
end
|
|
79
87
|
end
|
|
80
88
|
end
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module Multiwoven
|
|
4
4
|
module Integrations
|
|
5
|
-
VERSION = "0.
|
|
5
|
+
VERSION = "0.23.0"
|
|
6
6
|
|
|
7
7
|
ENABLED_SOURCES = %w[
|
|
8
8
|
Snowflake
|
|
@@ -25,6 +25,7 @@ module Multiwoven
|
|
|
25
25
|
WatsonxAi
|
|
26
26
|
WatsonxData
|
|
27
27
|
Anthropic
|
|
28
|
+
AwsBedrockModel
|
|
28
29
|
].freeze
|
|
29
30
|
|
|
30
31
|
ENABLED_DESTINATIONS = %w[
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Multiwoven::Integrations::Source
|
|
4
|
+
module AwsBedrockModel
|
|
5
|
+
include Multiwoven::Integrations::Core
|
|
6
|
+
class Client < SourceConnector
|
|
7
|
+
def check_connection(connection_config)
|
|
8
|
+
connection_config = connection_config.with_indifferent_access
|
|
9
|
+
create_connection(connection_config)
|
|
10
|
+
model = connection_config[:inference_profile] || connection_config[:model_id]
|
|
11
|
+
payload = format_request(model, connection_config[:request_format])
|
|
12
|
+
@client_runtime.invoke_model(
|
|
13
|
+
model_id: model,
|
|
14
|
+
content_type: "application/json",
|
|
15
|
+
accept: "application/json",
|
|
16
|
+
body: payload
|
|
17
|
+
)
|
|
18
|
+
success_status
|
|
19
|
+
rescue StandardError => e
|
|
20
|
+
ConnectionStatus.new(status: ConnectionStatusType["failed"], message: e.message).to_multiwoven_message
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def discover(_connection_config)
|
|
24
|
+
catalog_json = read_json(CATALOG_SPEC_PATH)
|
|
25
|
+
catalog = build_catalog(catalog_json)
|
|
26
|
+
catalog.to_multiwoven_message
|
|
27
|
+
rescue StandardError => e
|
|
28
|
+
handle_exception(e, {
|
|
29
|
+
context: "AWS:BEDROCK MODEL:DISCOVER:EXCEPTION",
|
|
30
|
+
type: "error"
|
|
31
|
+
})
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def read(sync_config)
|
|
35
|
+
connection_config = sync_config.source.connection_specification
|
|
36
|
+
connection_config = connection_config.with_indifferent_access
|
|
37
|
+
payload = sync_config.model.query
|
|
38
|
+
create_connection(connection_config)
|
|
39
|
+
run_model(connection_config, payload)
|
|
40
|
+
rescue StandardError => e
|
|
41
|
+
handle_exception(e, {
|
|
42
|
+
context: "AWS:BEDROCK MODEL:READ:EXCEPTION",
|
|
43
|
+
type: "error",
|
|
44
|
+
sync_id: sync_config.sync_id,
|
|
45
|
+
sync_run_id: sync_config.sync_run_id
|
|
46
|
+
})
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
private
|
|
50
|
+
|
|
51
|
+
def create_connection(connection_config)
|
|
52
|
+
@client_runtime = Aws::BedrockRuntime::Client.new(
|
|
53
|
+
region: connection_config[:region],
|
|
54
|
+
access_key_id: connection_config[:access_key],
|
|
55
|
+
secret_access_key: connection_config[:secret_access_key]
|
|
56
|
+
)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def run_model(connection_config, payload)
|
|
60
|
+
model = connection_config[:inference_profile] || connection_config[:model_id]
|
|
61
|
+
payload = format_request(model, payload)
|
|
62
|
+
response = @client_runtime.invoke_model(
|
|
63
|
+
model_id: model,
|
|
64
|
+
content_type: "application/json",
|
|
65
|
+
accept: "application/json",
|
|
66
|
+
body: payload,
|
|
67
|
+
inference_profile: connection_config[:inference_profile]
|
|
68
|
+
)
|
|
69
|
+
process_response(response)
|
|
70
|
+
rescue StandardError => e
|
|
71
|
+
handle_exception(e, context: "AWS:BEDROCK MODEL:RUN_MODEL:EXCEPTION", type: "error")
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def process_response(response)
|
|
75
|
+
data = JSON.parse(response.body.read)
|
|
76
|
+
[RecordMessage.new(data: data, emitted_at: Time.now.to_i).to_multiwoven_message]
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def format_request(model, payload)
|
|
80
|
+
case model
|
|
81
|
+
when *MISTRAL_AI_MODEL
|
|
82
|
+
payload_request = JSON.parse(payload)
|
|
83
|
+
prompt = payload_request["prompt"]
|
|
84
|
+
payload_request["prompt"] = "<s>[INST] #{prompt} [/INST]" unless prompt.start_with?("<s>[INST]") && prompt.end_with?("[/INST]")
|
|
85
|
+
payload_request.to_json
|
|
86
|
+
else
|
|
87
|
+
payload
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": {
|
|
3
|
+
"name": "AwsBedrockModel",
|
|
4
|
+
"title": "AWS Bedrock Model",
|
|
5
|
+
"connector_type": "source",
|
|
6
|
+
"category": "AI Model",
|
|
7
|
+
"documentation_url": "https://docs.mutliwoven.com",
|
|
8
|
+
"github_issue_label": "source-aws-bedrock-model",
|
|
9
|
+
"icon": "icon.svg",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"release_stage": "alpha",
|
|
12
|
+
"support_level": "community",
|
|
13
|
+
"tags": ["language:ruby", "multiwoven"]
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"documentation_url": "https://docs.multiwoven.com/activation/ai-ml-sources/aws_bedrock-model",
|
|
3
|
+
"stream_type": "user_defined",
|
|
4
|
+
"connector_query_type": "ai_ml",
|
|
5
|
+
"connection_specification": {
|
|
6
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
7
|
+
"title": "AWS Bedrock Model",
|
|
8
|
+
"type": "object",
|
|
9
|
+
"required": ["access_key", "secret_access_key", "region", "model_id", "request_format", "response_format"],
|
|
10
|
+
"properties": {
|
|
11
|
+
"access_key": {
|
|
12
|
+
"description": "The AWS Access Key ID to use for authentication",
|
|
13
|
+
"type": "string",
|
|
14
|
+
"title": "Personal Access Key",
|
|
15
|
+
"order": 0
|
|
16
|
+
},
|
|
17
|
+
"secret_access_key": {
|
|
18
|
+
"description": "The AWS Secret Access Key to use for authentication",
|
|
19
|
+
"type": "string",
|
|
20
|
+
"multiwoven_secret": true,
|
|
21
|
+
"title": "Secret Access Key",
|
|
22
|
+
"order": 1
|
|
23
|
+
},
|
|
24
|
+
"region": {
|
|
25
|
+
"description": "AWS region",
|
|
26
|
+
"type": "string",
|
|
27
|
+
"title": "Region",
|
|
28
|
+
"order": 2
|
|
29
|
+
},
|
|
30
|
+
"model_id": {
|
|
31
|
+
"description": "Your select Model ID from AWS Bedrock",
|
|
32
|
+
"type": "string",
|
|
33
|
+
"title": "Model ID",
|
|
34
|
+
"order": 3
|
|
35
|
+
},
|
|
36
|
+
"inference_profile": {
|
|
37
|
+
"description": "Inference Profile ARN for Model in AWS Bedrock (ignore if model does not have one)",
|
|
38
|
+
"type": "string",
|
|
39
|
+
"title": "Inference Profile ARN",
|
|
40
|
+
"order": 4
|
|
41
|
+
},
|
|
42
|
+
"request_format": {
|
|
43
|
+
"description": "Sample Request Format",
|
|
44
|
+
"type": "string",
|
|
45
|
+
"title": "Request Format",
|
|
46
|
+
"x-request-format": true,
|
|
47
|
+
"order": 5
|
|
48
|
+
},
|
|
49
|
+
"response_format": {
|
|
50
|
+
"description": "Sample Response Format",
|
|
51
|
+
"type": "string",
|
|
52
|
+
"title": "Response Format",
|
|
53
|
+
"x-response-format": true,
|
|
54
|
+
"order": 6
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Bedrock</title><defs><linearGradient id="lobe-icons-bedrock-fill" x1="80%" x2="20%" y1="20%" y2="80%"><stop offset="0%" stop-color="#6350FB"></stop><stop offset="50%" stop-color="#3D8FFF"></stop><stop offset="100%" stop-color="#9AD8F8"></stop></linearGradient></defs><path d="M13.05 15.513h3.08c.214 0 .389.177.389.394v1.82a1.704 1.704 0 011.296 1.661c0 .943-.755 1.708-1.685 1.708-.931 0-1.686-.765-1.686-1.708 0-.807.554-1.484 1.297-1.662v-1.425h-2.69v4.663a.395.395 0 01-.188.338l-2.69 1.641a.385.385 0 01-.405-.002l-4.926-3.086a.395.395 0 01-.185-.336V16.3L2.196 14.87A.395.395 0 012 14.555L2 14.528V9.406c0-.14.073-.27.192-.34l2.465-1.462V4.448c0-.129.062-.249.165-.322l.021-.014L9.77 1.058a.385.385 0 01.407 0l2.69 1.675a.395.395 0 01.185.336V7.6h3.856V5.683a1.704 1.704 0 01-1.296-1.662c0-.943.755-1.708 1.685-1.708.931 0 1.685.765 1.685 1.708 0 .807-.553 1.484-1.296 1.662v2.311a.391.391 0 01-.389.394h-4.245v1.806h6.624a1.69 1.69 0 011.64-1.313c.93 0 1.685.764 1.685 1.707 0 .943-.754 1.708-1.685 1.708a1.69 1.69 0 01-1.64-1.314H13.05v1.937h4.953l.915 1.18a1.66 1.66 0 01.84-.227c.931 0 1.685.764 1.685 1.707 0 .943-.754 1.708-1.685 1.708-.93 0-1.685-.765-1.685-1.708 0-.346.102-.668.276-.937l-.724-.935H13.05v1.806zM9.973 1.856L7.93 3.122V6.09h-.778V3.604L5.435 4.669v2.945l2.11 1.36L9.712 7.61V5.334h.778V7.83c0 .136-.07.263-.184.335L7.963 9.638v2.081l1.422 1.009-.446.646-1.406-.998-1.53 1.005-.423-.66 1.605-1.055v-1.99L5.038 8.29l-2.26 1.34v1.676l1.972-1.189.398.677-2.37 1.429V14.3l2.166 1.258 2.27-1.368.397.677-2.176 1.311V19.3l1.876 1.175 2.365-1.426.398.678-2.017 1.216 1.918 1.201 2.298-1.403v-5.78l-4.758 2.893-.4-.675 5.158-3.136V3.289L9.972 1.856zM16.13 18.47a.913.913 0 00-.908.92c0 .507.406.918.908.918a.913.913 0 00.907-.919.913.913 0 00-.907-.92zm3.63-3.81a.913.913 0 00-.908.92c0 .508.406.92.907.92a.913.913 0 00.908-.92.913.913 0 00-.908-.92zm1.555-4.99a.913.913 0 00-.908.92c0 .507.407.918.908.918a.913.913 0 00.907-.919.913.913 0 00-.907-.92zM17.296 3.1a.913.913 0 00-.907.92c0 .508.406.92.907.92a.913.913 0 00.908-.92.913.913 0 00-.908-.92z" fill="url(#lobe-icons-bedrock-fill)" fill-rule="nonzero"></path></svg>
|
|
@@ -37,6 +37,7 @@ require "aws-sdk-sagemakerruntime"
|
|
|
37
37
|
require "google/cloud/ai_platform/v1"
|
|
38
38
|
require "grpc"
|
|
39
39
|
require "MailchimpMarketing"
|
|
40
|
+
require "aws-sdk-bedrockruntime"
|
|
40
41
|
|
|
41
42
|
# Service
|
|
42
43
|
require_relative "integrations/config"
|
|
@@ -79,6 +80,7 @@ require_relative "integrations/source/sftp/client"
|
|
|
79
80
|
require_relative "integrations/source/watsonx_ai/client"
|
|
80
81
|
require_relative "integrations/source/watsonx_data/client"
|
|
81
82
|
require_relative "integrations/source/anthropic/client"
|
|
83
|
+
require_relative "integrations/source/aws_bedrock_model/client"
|
|
82
84
|
|
|
83
85
|
# Destination
|
|
84
86
|
require_relative "integrations/destination/klaviyo/client"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: multiwoven-integrations
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.23.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Subin T P
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-04-
|
|
11
|
+
date: 2025-04-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -715,6 +715,11 @@ files:
|
|
|
715
715
|
- lib/multiwoven/integrations/source/aws_athena/config/meta.json
|
|
716
716
|
- lib/multiwoven/integrations/source/aws_athena/config/spec.json
|
|
717
717
|
- lib/multiwoven/integrations/source/aws_athena/icon.svg
|
|
718
|
+
- lib/multiwoven/integrations/source/aws_bedrock_model/client.rb
|
|
719
|
+
- lib/multiwoven/integrations/source/aws_bedrock_model/config/catalog.json
|
|
720
|
+
- lib/multiwoven/integrations/source/aws_bedrock_model/config/meta.json
|
|
721
|
+
- lib/multiwoven/integrations/source/aws_bedrock_model/config/spec.json
|
|
722
|
+
- lib/multiwoven/integrations/source/aws_bedrock_model/icon.svg
|
|
718
723
|
- lib/multiwoven/integrations/source/aws_sagemaker_model/client.rb
|
|
719
724
|
- lib/multiwoven/integrations/source/aws_sagemaker_model/config/catalog.json
|
|
720
725
|
- lib/multiwoven/integrations/source/aws_sagemaker_model/config/meta.json
|