lex-xai 0.1.3 → 0.1.4
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: f122be7885c3d5f79b22015679579e69bbf8ccbb841a4e5f903688e2ae2d1221
|
|
4
|
+
data.tar.gz: 7738c16fc492d2f975702b535d9b1d54ca370bbe8013a0d03946b7203070386b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6b39da9f13c8445ca28b69402162d9323fc280eb84770c96040a0979f4890eae53c7acc1017ed7f07c4db8e140a57b38c51abb065cee872b82423e5c59b77aec
|
|
7
|
+
data.tar.gz: 9aea0da6fc20892bad4346e9c72d27c25244987b10d650b79f273fc0db53b313f965b4f605b4e00960c11d34f893a77e0fc85b1cef28c4651c082d6c8d2b8fea
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.4] - 2026-03-31
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- Standardized `usage:` key in `Runners::Chat#create` and `Runners::Embeddings#create` return hashes with `input_tokens`, `output_tokens`, `cache_read_tokens`, and `cache_write_tokens` fields for consumption by legion-llm's CostEstimator and metering
|
|
7
|
+
|
|
3
8
|
## [0.1.3] - 2026-03-30
|
|
4
9
|
|
|
5
10
|
### Changed
|
|
@@ -16,7 +16,16 @@ module Legion
|
|
|
16
16
|
body[:temperature] = temperature if temperature
|
|
17
17
|
|
|
18
18
|
response = client(api_key: api_key, **).post('/v1/chat/completions', body)
|
|
19
|
-
|
|
19
|
+
body = response.body
|
|
20
|
+
{
|
|
21
|
+
result: body,
|
|
22
|
+
usage: {
|
|
23
|
+
input_tokens: body.dig('usage', 'prompt_tokens') || 0,
|
|
24
|
+
output_tokens: body.dig('usage', 'completion_tokens') || 0,
|
|
25
|
+
cache_read_tokens: 0,
|
|
26
|
+
cache_write_tokens: 0
|
|
27
|
+
}
|
|
28
|
+
}
|
|
20
29
|
end
|
|
21
30
|
|
|
22
31
|
include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers, false) &&
|
|
@@ -13,7 +13,16 @@ module Legion
|
|
|
13
13
|
body = { model: model, input: input }
|
|
14
14
|
|
|
15
15
|
response = client(api_key: api_key, **).post('/v1/embeddings', body)
|
|
16
|
-
|
|
16
|
+
body = response.body
|
|
17
|
+
{
|
|
18
|
+
result: body,
|
|
19
|
+
usage: {
|
|
20
|
+
input_tokens: body.dig('usage', 'prompt_tokens') || 0,
|
|
21
|
+
output_tokens: body.dig('usage', 'completion_tokens') || 0,
|
|
22
|
+
cache_read_tokens: 0,
|
|
23
|
+
cache_write_tokens: 0
|
|
24
|
+
}
|
|
25
|
+
}
|
|
17
26
|
end
|
|
18
27
|
|
|
19
28
|
include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers, false) &&
|