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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 97751d7238ebf9e367da582abec08e7967f2afa11fd0d3eb293c12215c959b77
|
|
4
|
+
data.tar.gz: 607d8ecf40fb56d5716cc53a18e976545464459f2e021ecab988b5d9768f81f3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|