llmshim 0.4.0 → 0.5.0
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 +4 -4
- data/lib/llmshim/types.rb +4 -2
- data/lib/llmshim/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5929fc579493f05ebbfc27fa5aaa5c570b6f886421545f2ab0c008d695bca4e7
|
|
4
|
+
data.tar.gz: bb2947ee359e67054a0ca8946890d9c139cd866e7c169c4a2d28af10caaa1b9e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 555a81741fe9549d5beded8aa0857594e9af7d4836c99b6a155302228434e8100a1246c4158ad19390152b28892bb51071e28df99d17b4641393e342566efa97
|
|
7
|
+
data.tar.gz: a9d8c8cac89793ce30f475498404468c546916104c8c88953208079100da5dd92b6a626013c1067ce45d57c1d426c1f83adad969a2e78c701509a80f6b8494e2
|
data/lib/llmshim/types.rb
CHANGED
|
@@ -8,7 +8,7 @@ module Llmshim
|
|
|
8
8
|
# Mirrors the +Usage+ schema in api/openapi.yaml.
|
|
9
9
|
Usage = Struct.new(
|
|
10
10
|
:input_tokens, :output_tokens, :reasoning_tokens, :total_tokens,
|
|
11
|
-
:cache_read_tokens, :cache_write_tokens,
|
|
11
|
+
:cache_read_tokens, :cache_write_tokens, :cost_usd,
|
|
12
12
|
keyword_init: true
|
|
13
13
|
) do
|
|
14
14
|
def self.from_hash(hash)
|
|
@@ -20,7 +20,9 @@ module Llmshim
|
|
|
20
20
|
reasoning_tokens: hash["reasoning_tokens"],
|
|
21
21
|
total_tokens: hash["total_tokens"],
|
|
22
22
|
cache_read_tokens: hash.fetch("cache_read_tokens", 0),
|
|
23
|
-
cache_write_tokens: hash.fetch("cache_write_tokens", 0)
|
|
23
|
+
cache_write_tokens: hash.fetch("cache_write_tokens", 0),
|
|
24
|
+
# nil means the server could not price the model, never free.
|
|
25
|
+
cost_usd: hash["cost_usd"]
|
|
24
26
|
)
|
|
25
27
|
end
|
|
26
28
|
end
|
data/lib/llmshim/version.rb
CHANGED