lex-llm-anthropic 0.2.10 → 0.2.11

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: 698085fefbd69b9c2689ac472c42ce579c05e0ef2be2d06dc146f324df2ba69e
4
- data.tar.gz: c72e6c9974500f0285084da0da19af6390806ccfb4f93a9f42128e50a65205ad
3
+ metadata.gz: 1237cef4710e768a52ab02e062379ed70a6f2ee7456cca1b5a45cfb03489c5c4
4
+ data.tar.gz: bb9a132592136f7c64c4f982a6d1f9896348e0362da9d46d77fb846566b6a2d8
5
5
  SHA512:
6
- metadata.gz: 725109b45b7fdf9849fcbdffba9e1d8b338e0b6e80c23d495c0aac5ef06d733f075c19f6b6de8bf1d34ea77050efc53d71d0ecd42873f59a30afbf7e7bbe60ba
7
- data.tar.gz: 3406970db252257e2c074455132e55d7166dc4180a4c06f5b803ed267e7a17030e523ed063511c87e48f5345141891bd9211ee555d749af8e9cde496bf5e8568
6
+ metadata.gz: 9e138f44cbb23a70c48dc489e53bc6dff5fef7964db248b41f519b37a71e839dee7aa2dcbc26ce7cc5aa41e3df5720c0889537c497b6fb25bfb31053864d0066
7
+ data.tar.gz: 725a59b156f68280cbc9d276eccb6c90e21c638900dbf6d81405588a15bd0ce00c3413555c311aef411162669b959635e9f3d4363fcd124d364eedf8725ef189
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.11 - 2026-05-21
4
+
5
+ - Add `api_version` and `default_max_tokens` to default_settings
6
+ - api_base and anthropic-version read from settings fallback
7
+ - max_tokens reads from settings[:default_max_tokens]
8
+ - Identity headers included via base provider
9
+
10
+
3
11
  ## 0.2.10 - 2026-05-18
4
12
 
5
13
  - Fix streaming tool call input accumulation: `build_chunk` now handles both `content_block_start` (tool_use with id+name) and `input_json_delta` (partial argument fragments) events. Previously only the start event was parsed, resulting in tool calls with empty arguments.
@@ -35,15 +35,19 @@ module Legion
35
35
  def embeddings?(_model) = false
36
36
  end
37
37
 
38
+ def settings
39
+ Anthropic.default_settings
40
+ end
41
+
38
42
  def api_base
39
- config.anthropic_api_base || 'https://api.anthropic.com'
43
+ config.anthropic_api_base || settings[:endpoint] || 'https://api.anthropic.com'
40
44
  end
41
45
 
42
46
  def headers
43
- {
47
+ identity_headers.merge({
44
48
  'x-api-key' => config.anthropic_api_key,
45
- 'anthropic-version' => config.anthropic_version || '2023-06-01'
46
- }.compact
49
+ 'anthropic-version' => config.anthropic_version || settings[:api_version] || '2023-06-01'
50
+ }.compact)
47
51
  end
48
52
 
49
53
  def completion_url = '/v1/messages'
@@ -82,7 +86,7 @@ module Legion
82
86
  model: model.id,
83
87
  messages: format_messages(chat_messages, thinking: thinking_enabled?(thinking)),
84
88
  stream: stream,
85
- max_tokens: model.max_tokens || 4096,
89
+ max_tokens: model.max_tokens || settings[:default_max_tokens] || 4096,
86
90
  system: system_content(system_messages),
87
91
  thinking: thinking_payload(thinking),
88
92
  temperature: temperature,
@@ -4,7 +4,7 @@ module Legion
4
4
  module Extensions
5
5
  module Llm
6
6
  module Anthropic
7
- VERSION = '0.2.10'
7
+ VERSION = '0.2.11'
8
8
  end
9
9
  end
10
10
  end
@@ -24,6 +24,8 @@ module Legion
24
24
  instance: {
25
25
  default_model: 'claude-sonnet-4-6',
26
26
  endpoint: 'https://api.anthropic.com',
27
+ api_version: '2023-06-01',
28
+ default_max_tokens: 4096,
27
29
  tier: :frontier,
28
30
  transport: :http,
29
31
  credentials: { api_key: 'env://ANTHROPIC_API_KEY' },
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.10
4
+ version: 0.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - LegionIO