lex-llm-anthropic 0.2.9 → 0.2.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: 698085fefbd69b9c2689ac472c42ce579c05e0ef2be2d06dc146f324df2ba69e
|
|
4
|
+
data.tar.gz: c72e6c9974500f0285084da0da19af6390806ccfb4f93a9f42128e50a65205ad
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 725109b45b7fdf9849fcbdffba9e1d8b338e0b6e80c23d495c0aac5ef06d733f075c19f6b6de8bf1d34ea77050efc53d71d0ecd42873f59a30afbf7e7bbe60ba
|
|
7
|
+
data.tar.gz: 3406970db252257e2c074455132e55d7166dc4180a4c06f5b803ed267e7a17030e523ed063511c87e48f5345141891bd9211ee555d749af8e9cde496bf5e8568
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.10 - 2026-05-18
|
|
4
|
+
|
|
5
|
+
- 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.
|
|
6
|
+
|
|
7
|
+
|
|
3
8
|
## 0.2.9 - 2026-05-16
|
|
4
9
|
|
|
5
10
|
- Advertise Anthropic tool support in discovered instance and model metadata so capability-aware routing can select Claude models for native tool requests.
|
|
@@ -347,10 +347,24 @@ module Legion
|
|
|
347
347
|
),
|
|
348
348
|
input_tokens: data.dig('message', 'usage', 'input_tokens'),
|
|
349
349
|
output_tokens: data.dig('message', 'usage', 'output_tokens') || data.dig('usage', 'output_tokens'),
|
|
350
|
-
tool_calls:
|
|
350
|
+
tool_calls: extract_streaming_tool_calls(data, delta_type)
|
|
351
351
|
)
|
|
352
352
|
end
|
|
353
353
|
|
|
354
|
+
def extract_streaming_tool_calls(data, delta_type)
|
|
355
|
+
content_block = data['content_block']
|
|
356
|
+
if content_block && content_block['type'] == 'tool_use'
|
|
357
|
+
{ content_block['id'] => Legion::Extensions::Llm::ToolCall.new(
|
|
358
|
+
id: content_block['id'], name: content_block['name'], arguments: ''
|
|
359
|
+
) }
|
|
360
|
+
elsif delta_type == 'input_json_delta'
|
|
361
|
+
partial = data.dig('delta', 'partial_json')
|
|
362
|
+
return nil unless partial
|
|
363
|
+
|
|
364
|
+
{ nil => Legion::Extensions::Llm::ToolCall.new(id: nil, name: nil, arguments: partial) }
|
|
365
|
+
end
|
|
366
|
+
end
|
|
367
|
+
|
|
354
368
|
def parse_tool_calls(content_blocks)
|
|
355
369
|
blocks = Array(content_blocks).select { |block| block && block['type'] == 'tool_use' }
|
|
356
370
|
return nil if blocks.empty?
|