lex-llm-bedrock 0.3.9 → 0.3.10

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: 1d0b15f1168f45e6f11211963cc8c0939085562bd92e720bcd74426367824318
4
- data.tar.gz: e68d8865e321e62f0b7c54cf16a573286174626531229b325e53b0aecbc8c3ea
3
+ metadata.gz: a0d6ffe6c93fec2590c74ed5a01a944c81694fb98316bf35bde08db6efecfed9
4
+ data.tar.gz: 3e5174849ecf00a36f79e8926237f430ce1b1e8a8572c4fede2463e5cc0a3bda
5
5
  SHA512:
6
- metadata.gz: ac5ed2ff6e4d586891edc3d05a8935cd32b25b561862a882c04a17d2c42324f8cfde527338c8d464cc8373d06dfa4b758fc3a7ab4c1ac70072d22d9998799207
7
- data.tar.gz: 1e6f4bd752aa5fe9eeb033426405718826135763e2f6974674a7238ffbf74134024ad8f164962d02dc908aa8276417451087c7092e623beda5e0df58977efbf4
6
+ metadata.gz: 273bc8934934e7eb40e9365a57de5fb33c12114c84b435b353ffb3e0e83329ced120f94016ddc59bd8cfc484c3a35094814f41beb8b0361ece513417505954d5
7
+ data.tar.gz: 2d36dcff70b35577a0d5bbf6846ed6181851e6ac32d8cd65f67367429f32ec88869a084ccc4e3fdde200ab50ae3ca6c21509c84fa7a4af5ae360eaf75b85a2c5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.10 - 2026-05-21
4
+
5
+ - Add `default_transport`/`default_tier` class declarations, remove `configured_transport`/`configured_tier`
6
+ - Add `model_allowed?` filtering in `discover_offerings` (handles ModelOffering objects)
7
+ - Move `DEFAULT_REGION` to settings[:region]
8
+ - Default tier corrected from :frontier to :cloud
9
+ - Identity headers included via base provider
10
+
11
+
3
12
  ## 0.3.9 - 2026-05-18
4
13
 
5
14
  - Fix streaming tool call parsing: `stream_converse` now handles content_block_start/delta/stop events for tool_use blocks, capturing tool ids, names, and accumulated input JSON. Previously only text deltas were captured and tool calls were silently dropped.
@@ -14,8 +14,6 @@ module Legion
14
14
  class Provider < Legion::Extensions::Llm::Provider # rubocop:disable Metrics/ClassLength
15
15
  include Legion::Logging::Helper
16
16
 
17
- DEFAULT_REGION = 'us-east-1'
18
-
19
17
  STATIC_MODELS = [
20
18
  { model: 'anthropic.claude-3-haiku-20240307-v1:0', alias: 'claude-3-haiku' },
21
19
  { model: 'amazon.titan-text-express-v1', alias: 'titan-text-express' },
@@ -50,6 +48,8 @@ module Legion
50
48
 
51
49
  class << self
52
50
  def slug = 'bedrock'
51
+ def default_transport = :aws_sdk
52
+ def default_tier = :cloud
53
53
 
54
54
  def configuration_options
55
55
  %i[
@@ -113,7 +113,7 @@ module Legion
113
113
  def count_tokens_url = 'CountTokens'
114
114
 
115
115
  def region
116
- config.bedrock_region || DEFAULT_REGION
116
+ config.bedrock_region || settings[:region] || 'us-east-1'
117
117
  end
118
118
 
119
119
  def discover_offerings(live: false, **filters)
@@ -126,8 +126,12 @@ module Legion
126
126
 
127
127
  log.info { "bedrock.provider.discover_offerings: listing foundation models (region=#{region})" }
128
128
  response = bedrock_client.list_foundation_models(**filters)
129
- @cached_offerings = Array(value(response, :model_summaries)).map do |summary|
130
- offering_from_summary(summary)
129
+ @cached_offerings = Array(value(response, :model_summaries)).filter_map do |summary|
130
+ offering = offering_from_summary(summary)
131
+ model_id = offering.respond_to?(:model) ? offering.model : (offering[:model] || offering[:id])
132
+ next unless model_allowed?(model_id.to_s)
133
+
134
+ offering
131
135
  end
132
136
  log.info { "bedrock.provider.discover_offerings: found #{@cached_offerings.size} models" }
133
137
  @cached_offerings
@@ -323,8 +327,8 @@ module Legion
323
327
  Legion::Extensions::Llm::Routing::ModelOffering.new(
324
328
  provider_family: :bedrock,
325
329
  instance_id: instance_id,
326
- transport: configured_transport(:aws_sdk),
327
- tier: configured_tier(:frontier),
330
+ transport: offering_transport,
331
+ tier: offering_tier,
328
332
  model: model,
329
333
  usage_type: usage_type,
330
334
  capabilities: capabilities || default_capabilities(model),
@@ -346,14 +350,6 @@ module Legion
346
350
  ctx ? { context_window: ctx } : nil
347
351
  end
348
352
 
349
- def configured_transport(default)
350
- config.respond_to?(:transport) ? config.transport : default
351
- end
352
-
353
- def configured_tier(default)
354
- config.respond_to?(:tier) ? config.tier : default
355
- end
356
-
357
353
  def converse_request(messages, model:, temperature:, max_tokens:, tools:, tool_prefs:)
358
354
  {
359
355
  model_id: self.class.inference_profile_id(model_id(model)),
@@ -4,7 +4,7 @@ module Legion
4
4
  module Extensions
5
5
  module Llm
6
6
  module Bedrock
7
- VERSION = '0.3.9'
7
+ VERSION = '0.3.10'
8
8
  end
9
9
  end
10
10
  end
@@ -23,7 +23,8 @@ module Legion
23
23
  family: PROVIDER_FAMILY,
24
24
  instance: {
25
25
  default_model: 'us.anthropic.claude-sonnet-4-6',
26
- tier: :frontier,
26
+ region: 'us-east-1',
27
+ tier: :cloud,
27
28
  transport: :aws_sdk,
28
29
  credentials: {
29
30
  bearer_token: nil,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lex-llm-bedrock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
4
+ version: 0.3.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - LegionIO