lex-llm-anthropic 0.2.26 → 0.2.27

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: a43ec4b5821302a3e7a3144ee23d22bb4954530af9cebd7c5b51b6767915b575
4
- data.tar.gz: 3a470f8f0a6b69a96411eb1c13276eee6428e90e176d93a42e64fb442ce4da02
3
+ metadata.gz: 97751d7238ebf9e367da582abec08e7967f2afa11fd0d3eb293c12215c959b77
4
+ data.tar.gz: 607d8ecf40fb56d5716cc53a18e976545464459f2e021ecab988b5d9768f81f3
5
5
  SHA512:
6
- metadata.gz: 5c80ed046d1c0b7d9ad03be2ad3f06284732d5cb53419cc45bdf6c8ccbc3f53162c6e5831c6e42cc322435285dcd24693c4abc955c626995fbccb329b57e92f6
7
- data.tar.gz: 975f2fde3051df569513aed373a8485559b240f7c0a548759c4fd6ec9d9b363c74f9c1788a43e33a102b6f7a73e60fb0f6d7f728d5d267ae4096a9aef72c493d
6
+ metadata.gz: e017b2414a4f94da4d38e804ac91c9c4e1bf254933becb55e8debcd107b234b19df774a0b990aff2f1f3bc8392beb5108f9aa7bf882e410c245079a8b54af037
7
+ data.tar.gz: 501e1f0d5c32d84da86734b85c39d6332be57b607601cc751b41a8beab9913aa4df690c519758097b7410804714471525ec8eae614491a18a3d03fcff54f239f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.27] - 2026-07-09
4
+
5
+ ### Fixed
6
+ - **Claude models now advertise the `:thinking` capability.** `resolve_model_capabilities` passed `provider_catalog: {}` to `CapabilityPolicy.resolve`, so per-model capabilities from the shared lex-llm catalog (which correctly tags Claude 3.7 / 4+ models `reasoning` → `:thinking`, and vision) were ignored — Claude models reported only completion/streaming/tools, so the router's thinking filter could not route thinking requests correctly. It now consults the shared catalog via `catalog_capabilities(model_id)`; unknown models fall back to the provider envelope (no `:thinking`). No hardcoded capability list — the shared catalog (refreshed from provider APIs + models.dev) is the source of truth.
7
+
3
8
  ## [0.2.26] - 2026-06-20
4
9
 
5
10
  ### Fixed
@@ -453,7 +453,7 @@ module Legion
453
453
  def resolve_model_capabilities(model_id)
454
454
  Legion::Extensions::Llm::CapabilityPolicy.resolve(
455
455
  real: {},
456
- provider_catalog: {},
456
+ provider_catalog: catalog_capabilities(model_id),
457
457
  probe: {},
458
458
  provider_envelope: { streaming: true, tools: true },
459
459
  provider_config: provider_capability_config,
@@ -462,6 +462,29 @@ module Legion
462
462
  )
463
463
  end
464
464
 
465
+ # Boolean capability hash for a model, read from the shared lex-llm
466
+ # catalog (models.dev-sourced). This is where Claude extended-thinking
467
+ # support (`reasoning` -> `:thinking`) is surfaced during discovery, so
468
+ # thinking-capable Claude models advertise `:thinking` and the router's
469
+ # thinking filter can route them. Unknown models return `{}`, falling
470
+ # back to the provider envelope. The catalog is the single source of
471
+ # truth for per-model capabilities across every provider.
472
+ def catalog_capabilities(model_id)
473
+ model = Legion::Extensions::Llm::Models.find(model_id, :anthropic)
474
+ Array(model&.capabilities).each_with_object({}) do |capability, result|
475
+ canonical = Legion::Extensions::Llm::Capabilities.canonical(capability)
476
+ next unless Legion::Extensions::Llm::CapabilityPolicy::OPTIONAL_CAPABILITIES.include?(canonical)
477
+
478
+ result[canonical] = true
479
+ end
480
+ rescue Legion::Extensions::Llm::ModelNotFoundError
481
+ {}
482
+ rescue StandardError => e
483
+ handle_exception(e, level: :warn, handled: true,
484
+ operation: "#{slug}.catalog_capabilities", model: model_id)
485
+ {}
486
+ end
487
+
465
488
  def infer_context_window(model_id)
466
489
  CONTEXT_WINDOWS.find { |prefix, _| model_id.start_with?(prefix) }&.last
467
490
  end
@@ -4,7 +4,7 @@ module Legion
4
4
  module Extensions
5
5
  module Llm
6
6
  module Anthropic
7
- VERSION = '0.2.26'
7
+ VERSION = '0.2.27'
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lex-llm-anthropic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.26
4
+ version: 0.2.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - LegionIO