llmshim 0.8.1 → 0.10.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: e100fa9d1d5eee5ca4f795c4ada147ceddae310d0df084a8da5a339c8f5ef1db
4
+ data.tar.gz: 3b7adea744d40650839db4e33487ca75a63c04050ce295d2e17fc5a9ebb65c96
5
5
  SHA512:
6
- metadata.gz: 46a2c915082c26c2e9677e84c08977623295963fb6f4bc7346a6af139eccf2e2dc7ca90a259fde7fcb14612c64aa4e89907b36add93cbcb8f21b1bf55831d393
7
- data.tar.gz: 3e7ce28a54dd59fa2d8114da93e50501bd6885dd64785d120fb7ebf67a1d5ce6e93c07affd4e547a2b59dca829b73c97dc0dd80f4ad04cf9c062e6244cd66152
6
+ metadata.gz: c82ece09f787d50fa7d89746bf8c469b31f70da4f925c484e6580d444b49e6e45f8f835f44c04004c2a9d788b1811391309e894e3b43227aa12c342d4ec5b1ec
7
+ data.tar.gz: d273a4194261f38efaab70a6729bb1ca7162cbad3d2c0172496e32446e9a3df23df5bfa26904e94f4c4ea41dcb3c38cca42ca83180a27f6ec446b3d587328181
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.10.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.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sanjay Nadhavajhala