llmshim 0.8.1 → 0.9.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f5c255906b9f112fd496066f21ca34ae171b51ac26eedd0f5a721a4525737c02
4
- data.tar.gz: 227edd46189cfb56a20117a2e28013b7d5e212a9f2894bc9517ac9fb02d6cea8
3
+ metadata.gz: ce96467ac951dee739b287b5bb75e23191c4589f2cf1430f37aacb4d6c9743f7
4
+ data.tar.gz: 4d9292250caebc6e984e19345ebfdfbc73b82249874989580a745722af198683
5
5
  SHA512:
6
- metadata.gz: 46a2c915082c26c2e9677e84c08977623295963fb6f4bc7346a6af139eccf2e2dc7ca90a259fde7fcb14612c64aa4e89907b36add93cbcb8f21b1bf55831d393
7
- data.tar.gz: 3e7ce28a54dd59fa2d8114da93e50501bd6885dd64785d120fb7ebf67a1d5ce6e93c07affd4e547a2b59dca829b73c97dc0dd80f4ad04cf9c062e6244cd66152
6
+ metadata.gz: b50ba4fe4c8c5923c5ab7404b17fe75de397066efab25242301b8292eff890a18aae43c081899749d4090b63df57ccb160f1a90b88e1a3b16de7570681022975
7
+ data.tar.gz: 0b8dcbb17eecb8a2d503727de442077cf7ef93a54b1a4ac3d8c14a7e71e3155ec0c35f1d57ecaac618b22349be1efb9b688ad325d4b63b9d6b2a471a45cf5fc6
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, :cost_usd,
11
+ :cache_read_tokens, :cache_write_tokens, :cost_usd, :cost_source,
12
12
  keyword_init: true
13
13
  ) do
14
14
  def self.from_hash(hash)
@@ -22,7 +22,10 @@ module Llmshim
22
22
  cache_read_tokens: hash.fetch("cache_read_tokens", 0),
23
23
  cache_write_tokens: hash.fetch("cache_write_tokens", 0),
24
24
  # nil means the server could not price the model, never free.
25
- cost_usd: hash["cost_usd"]
25
+ cost_usd: hash["cost_usd"],
26
+ # "provider" when the number is the bill the provider reported for this
27
+ # generation, "catalog" when it was computed from catalog prices.
28
+ cost_source: hash["cost_source"]
26
29
  )
27
30
  end
28
31
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Llmshim
4
- VERSION = "0.8.1"
4
+ VERSION = "0.9.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: llmshim
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sanjay Nadhavajhala