multiwoven-integrations 0.41.6 → 0.41.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9997be9180829657c2c1961957ac5af3ba80f9085ec53610b2dc9426105c5324
4
- data.tar.gz: 0f92f5434027f6b19e0f83f785f3e791da95b42e22834c66e9fbe9011543d411
3
+ metadata.gz: cc1293c0d20713678c840280bf1cbe9cc1cfa60280897e581ce1230807e8377a
4
+ data.tar.gz: a9b321a3f5eabfab1b5de744aaf2bbb5e949f6244cf757b134626047330af3d2
5
5
  SHA512:
6
- metadata.gz: 1ad58e7cbaefab9d122e5775404b3ac7095e1b6deaaea45093f8c23f46a2d6f2f5c9a98bd73df77b1c5d5e06211ae49bd1e50c114ce322b290e40b5a5995d564
7
- data.tar.gz: c9ae0e891adbb23830fb35342f28f84186e433477e0eb488f49b99c45f5e365b1d3953f66a333b5be24db82f133f216ed1735de1d13696d7c5a227286076c619
6
+ metadata.gz: a78e53ff9f535168b2b42c0d3838b32a38d95dd06fe455c0122273ae8d40b0eea219c50a39674df41b8878b102c7489f63492b87c3d281b25a976212dd57fe41
7
+ data.tar.gz: 3c7a356e35cfa48d3b7e5dacc3fcdc14dc0155a813a473d1ab4688a3524bb78e09d401c213a8a636b9592a86215d56e7b6027855a38101449d2033395bde0f9c
@@ -8,6 +8,14 @@ module Multiwoven
8
8
  include Constants
9
9
 
10
10
  MAX_ERROR_MESSAGE_LENGTH = 500
11
+ ANTHROPIC_DATE_SUFFIX = /-\d{8}\z/.freeze
12
+ ANTHROPIC_VERSION_PATTERN = /
13
+ \A(?:
14
+ claude-(?:opus|sonnet|haiku)-(\d+)(?:[.-](\d+))?
15
+ |
16
+ claude-(\d+)(?:[.-](\d+))?-(?:opus|sonnet|haiku)
17
+ )\z
18
+ /x.freeze
11
19
 
12
20
  def connector_spec
13
21
  @connector_spec ||= ConnectorSpecification.from_json(keys_to_symbols(read_json(CONNECTOR_SPEC_PATH)).to_json)
@@ -78,9 +86,9 @@ module Multiwoven
78
86
  private
79
87
 
80
88
  # Only list what the connector can actually serve. No connector has an
81
- # image-generation payload path, so those are dropped everywhere.
89
+ # image-generation payload path and deprecated models are dropped everywhere.
82
90
  def include_model?(model)
83
- !image_output_model?(model)
91
+ !image_output_model?(model) && !excluded_model?(model)
84
92
  end
85
93
 
86
94
  def image_output_model?(model)
@@ -92,6 +100,42 @@ module Multiwoven
92
100
  .any? { |value| value.to_s == "embedding" }
93
101
  end
94
102
 
103
+ def excluded_model?(model)
104
+ openrouter_id = (model&.dig(:openrouter_id) || model&.dig("openrouter_id")).to_s
105
+ model_id = (model&.dig(:id) || model&.dig("id")).to_s
106
+ return false if openrouter_id.empty?
107
+
108
+ return excluded_openai_model?(model_id) if openrouter_id.start_with?("openai/")
109
+ return excluded_anthropic_model?(model_id) if openrouter_id.start_with?("anthropic/")
110
+
111
+ false
112
+ end
113
+
114
+ def excluded_openai_model?(model_id)
115
+ @open_ai_exclude_models ||= OPEN_AI_EXCLUDE_MODELS.split(",").map(&:strip).reject(&:empty?)
116
+ @open_ai_exclude_models.include?(model_id)
117
+ end
118
+
119
+ def excluded_anthropic_model?(model_id)
120
+ threshold = ANTHROPIC_EXCLUDE_MODELS.to_s.strip
121
+ return false if threshold.empty? || !Gem::Version.correct?(threshold)
122
+
123
+ version = anthropic_model_version(model_id)
124
+ return false if version.nil? || !Gem::Version.correct?(version)
125
+
126
+ Gem::Version.new(version) < Gem::Version.new(threshold)
127
+ end
128
+
129
+ def anthropic_model_version(model_id)
130
+ base = model_id.to_s.sub(ANTHROPIC_DATE_SUFFIX, "")
131
+ match = ANTHROPIC_VERSION_PATTERN.match(base)
132
+ return unless match
133
+
134
+ major = match[1] || match[3]
135
+ minor = match[2] || match[4]
136
+ minor ? "#{major}.#{minor}" : major
137
+ end
138
+
95
139
  def read_json(file_path)
96
140
  path = Object.const_source_location(self.class.to_s)[0]
97
141
  connector_folder = File.dirname(path)
@@ -16,6 +16,9 @@ module Multiwoven
16
16
 
17
17
  JSON_SCHEMA_URL = "https://json-schema.org/draft-07/schema#"
18
18
 
19
+ OPEN_AI_EXCLUDE_MODELS = ENV["OPEN_AI_EXCLUDE_MODELS"] || ""
20
+ ANTHROPIC_EXCLUDE_MODELS = ENV["ANTHROPIC_EXCLUDE_MODELS"] || ""
21
+
19
22
  # CONNECTORS
20
23
  INSTALL_HTTPFS_QUERY = ENV["INSTALL_HTTPFS_QUERY"] || "INSTALL HTTPFS; LOAD HTTPFS;"
21
24
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Multiwoven
4
4
  module Integrations
5
- VERSION = "0.41.6"
5
+ VERSION = "0.41.8"
6
6
 
7
7
  ENABLED_SOURCES = %w[
8
8
  Snowflake
@@ -1,51 +1,5 @@
1
1
  {
2
2
  "models": [
3
- {
4
- "id": "bolt-instruct-1b",
5
- "name": "Bolt-Instruct-1B",
6
- "model_type": "llm",
7
- "type": "completion",
8
- "tasks": [
9
- "Text Classification",
10
- "Guardrails"
11
- ],
12
- "context_window": 32000,
13
- "max_output": 4096,
14
- "pricing": {
15
- "input": 0.0,
16
- "output": 0.0,
17
- "cached_read": 0.0,
18
- "cached_write": 0.0,
19
- "unit": "per_1m_tokens"
20
- },
21
- "capabilities": [
22
- "Documents"
23
- ]
24
- },
25
- {
26
- "id": "bolt-instruct-7b",
27
- "name": "Bolt-Instruct-7B",
28
- "model_type": "llm",
29
- "type": "completion",
30
- "tasks": [
31
- "Text Generation",
32
- "Routing",
33
- "Orchestration"
34
- ],
35
- "context_window": 32000,
36
- "max_output": 8192,
37
- "pricing": {
38
- "input": 0.0,
39
- "output": 0.0,
40
- "cached_read": 0.0,
41
- "cached_write": 0.0,
42
- "unit": "per_1m_tokens"
43
- },
44
- "capabilities": [
45
- "Documents",
46
- "Data analyst"
47
- ]
48
- },
49
3
  {
50
4
  "id": "bolt-instruct-32b",
51
5
  "name": "Bolt-Instruct-32B",
@@ -68,53 +22,6 @@
68
22
  "Documents",
69
23
  "Data analyst"
70
24
  ]
71
- },
72
- {
73
- "id": "bolt-embedding-large",
74
- "name": "Bolt-Embedding-Large",
75
- "model_type": "embedding",
76
- "type": "embedding",
77
- "tasks": [
78
- "Text Embeddings",
79
- "Indexing",
80
- "Retrieval"
81
- ],
82
- "context_window": 8192,
83
- "max_output": null,
84
- "pricing": {
85
- "input": 0.0,
86
- "output": null,
87
- "cached_read": null,
88
- "cached_write": null,
89
- "unit": "per_1m_tokens"
90
- },
91
- "capabilities": [
92
- "Documents"
93
- ]
94
- },
95
- {
96
- "id": "bolt-vision-9b",
97
- "name": "Bolt-Vision-9B",
98
- "model_type": "vision",
99
- "type": "completion",
100
- "tasks": [
101
- "Image-to-Text",
102
- "OCR",
103
- "Document Parsing"
104
- ],
105
- "context_window": 32000,
106
- "max_output": 8192,
107
- "pricing": {
108
- "input": 0.0,
109
- "output": 0.0,
110
- "cached_read": 0.0,
111
- "cached_write": 0.0,
112
- "unit": "per_1m_tokens"
113
- },
114
- "capabilities": [
115
- "Documents",
116
- "Image analysis"
117
- ]
118
25
  }
119
26
  ]
120
27
  }
@@ -72,8 +72,10 @@ module Multiwoven::Integrations::Source
72
72
  end
73
73
 
74
74
  # Some OpenAI models reject /v1/chat/completions and require /v1/completions or /v1/responses.
75
- def request_with_endpoint_fallback(connection_config, payload, url: OPEN_AI_URL)
75
+ # Models whose id ends with "-pro" (e.g. gpt-5-pro) only work on /v1/responses.
76
+ def request_with_endpoint_fallback(connection_config, payload, url: nil)
76
77
  normalized = normalize_payload(payload)
78
+ url ||= resolve_endpoint_url(normalized)
77
79
  response = post_openai(connection_config, adapt_payload_for_url(normalized, url), url)
78
80
  return response if success?(response)
79
81
 
@@ -83,8 +85,9 @@ module Multiwoven::Integrations::Source
83
85
  post_openai(connection_config, adapt_payload_for_url(normalized, fallback_url), fallback_url)
84
86
  end
85
87
 
86
- def stream_with_endpoint_fallback(connection_config, payload, url: OPEN_AI_URL)
88
+ def stream_with_endpoint_fallback(connection_config, payload, url: nil)
87
89
  normalized = normalize_payload(payload)
90
+ url ||= resolve_endpoint_url(normalized)
88
91
  emitted = false
89
92
 
90
93
  begin
@@ -103,6 +106,13 @@ module Multiwoven::Integrations::Source
103
106
  end
104
107
  end
105
108
 
109
+ def resolve_endpoint_url(payload)
110
+ model = payload["model"] || payload[:model]
111
+ return OPEN_AI_RESPONSES_URL if model.to_s.end_with?("-pro")
112
+
113
+ OPEN_AI_URL
114
+ end
115
+
106
116
  def post_openai(connection_config, payload, url)
107
117
  send_request(
108
118
  url: url,
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.41.6
4
+ version: 0.41.8
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: 2026-09-03 00:00:00.000000000 Z
11
+ date: 2026-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport