multiwoven-integrations 0.43.4 → 0.43.6
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 +2 -1
- data/lib/multiwoven/integrations/rollout.rb +1 -1
- data/lib/multiwoven/integrations/source/aisquared/client.rb +14 -7
- data/lib/multiwoven/integrations/source/aisquared/config/models.json +2 -2
- data/lib/multiwoven/integrations/source/postgresql/client.rb +4 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d254a8a952d1a94a315e5456a9f0e2d5e8b9599c32e7dada1adbb7e4f7f165cd
|
|
4
|
+
data.tar.gz: 18c66ab6d1c33d5bb0c6ff06da6e4fd0586a902ce2c96644c6b13578234d8e8c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 221d297aa3e23f54b11c262c63c645119a6faddd157cd3524857ec4b2e13a199501fcbbebcdce1bd573826fcee14fc4d115857e1d3df3de1d6d73bafe1e13e4b
|
|
7
|
+
data.tar.gz: 5bb37b559c91fb0402c83048f676a9c1c918b8be6401a99176db3f07147bb11660dba473f572a86229cf1328ad84091c2e8b56cc0f3401819e6ed79d11c18780
|
|
@@ -124,7 +124,8 @@ module Multiwoven
|
|
|
124
124
|
}.freeze
|
|
125
125
|
|
|
126
126
|
# Aisquared Bolt
|
|
127
|
-
|
|
127
|
+
AISQUARED_CHAT_ENDPOINT_URL = ENV["AISQUARED_CHAT_ENDPOINT_URL"]
|
|
128
|
+
AISQUARED_BOLT_API_KEY = ENV["AISQUARED_BOLT_API_KEY"]
|
|
128
129
|
|
|
129
130
|
# Microsoft Graph
|
|
130
131
|
MICROSOFT_GRAPH_BASE = "https://graph.microsoft.com/v1.0"
|
|
@@ -7,7 +7,7 @@ module Multiwoven::Integrations::Source
|
|
|
7
7
|
class AisquaredError < StandardError; end
|
|
8
8
|
|
|
9
9
|
def check_connection(connection_config)
|
|
10
|
-
response = make_request(
|
|
10
|
+
response = make_request(chat_endpoint_url, HTTP_POST, connection_config[:request_format], connection_config)
|
|
11
11
|
success?(response) ? success_status : failure_status_from_response(response)
|
|
12
12
|
rescue StandardError => e
|
|
13
13
|
handle_exception(e, { context: "AISQUARED_BOLT:CHECK_CONNECTION:EXCEPTION", type: "error" })
|
|
@@ -40,11 +40,18 @@ module Multiwoven::Integrations::Source
|
|
|
40
40
|
super && !embedding_model?(model)
|
|
41
41
|
end
|
|
42
42
|
|
|
43
|
-
def
|
|
44
|
-
host =
|
|
45
|
-
raise AisquaredError, "
|
|
43
|
+
def chat_endpoint_url
|
|
44
|
+
host = AISQUARED_CHAT_ENDPOINT_URL.to_s.strip
|
|
45
|
+
raise AisquaredError, "AISQUARED_CHAT_ENDPOINT_URL is not configured" if host.empty?
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
host
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def api_key
|
|
51
|
+
key = AISQUARED_BOLT_API_KEY.to_s.strip
|
|
52
|
+
raise AisquaredError, "AISQUARED_BOLT_API_KEY is not configured" if key.empty?
|
|
53
|
+
|
|
54
|
+
key
|
|
48
55
|
end
|
|
49
56
|
|
|
50
57
|
def parse_json(json_string)
|
|
@@ -60,13 +67,13 @@ module Multiwoven::Integrations::Source
|
|
|
60
67
|
url: url,
|
|
61
68
|
http_method: http_method,
|
|
62
69
|
payload: JSON.parse(payload),
|
|
63
|
-
headers: { "Content-Type" => "application/json" }
|
|
70
|
+
headers: { "Content-Type" => "application/json", "Authorization" => "Bearer #{api_key}" }
|
|
64
71
|
)
|
|
65
72
|
end
|
|
66
73
|
|
|
67
74
|
# TODO: Add support for streaming when Lightning Endpoint supports it.
|
|
68
75
|
def run_model(connection_config, payload)
|
|
69
|
-
response = make_request(
|
|
76
|
+
response = make_request(chat_endpoint_url, HTTP_POST, payload, connection_config)
|
|
70
77
|
process_response(response)
|
|
71
78
|
rescue StandardError => e
|
|
72
79
|
handle_exception(e, { context: "AISQUARED_BOLT:RUN_MODEL:EXCEPTION", type: "error" })
|
|
@@ -6,6 +6,8 @@ module Multiwoven::Integrations::Source
|
|
|
6
6
|
module Postgresql
|
|
7
7
|
include Multiwoven::Integrations::Core
|
|
8
8
|
class Client < SourceConnector
|
|
9
|
+
CONNECT_TIMEOUT = 10
|
|
10
|
+
|
|
9
11
|
def check_connection(connection_config)
|
|
10
12
|
connection_config = connection_config.with_indifferent_access
|
|
11
13
|
create_connection(connection_config)
|
|
@@ -99,7 +101,8 @@ module Multiwoven::Integrations::Source
|
|
|
99
101
|
dbname: connection_config[:database],
|
|
100
102
|
user: connection_config[:credentials][:username],
|
|
101
103
|
password: connection_config[:credentials][:password],
|
|
102
|
-
port: connection_config[:port]
|
|
104
|
+
port: connection_config[:port],
|
|
105
|
+
connect_timeout: CONNECT_TIMEOUT
|
|
103
106
|
)
|
|
104
107
|
end
|
|
105
108
|
|