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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a0d6ffe6c93fec2590c74ed5a01a944c81694fb98316bf35bde08db6efecfed9
|
|
4
|
+
data.tar.gz: 3e5174849ecf00a36f79e8926237f430ce1b1e8a8572c4fede2463e5cc0a3bda
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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 ||
|
|
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)).
|
|
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:
|
|
327
|
-
tier:
|
|
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)),
|