llmshim 0.4.0 → 0.6.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: 7daaabbea4814eb113a27e7cf8965d87f8bc29459f4a1b6caad395984388e2da
4
- data.tar.gz: f629a9202933185c03908033c48d2ef8a6d30330acd5cabb7048309680eb4ca0
3
+ metadata.gz: 7219b9abb5ef3aeadd2bf8316e2cd161ed0b454a258f8601572e8410ba9abe11
4
+ data.tar.gz: e0d4f3a95d89464624954b01497b02f06e6fcd9c886bd5f90342de1879cc1a22
5
5
  SHA512:
6
- metadata.gz: 40f1298cb6bed88b1353236cb09b8085bd21e9dc6bb8d968c66ad85cddb9e711b7ce7ae3c2dc6ac9236aca12e776ee28dc43910c437a80995822065961b5c14b
7
- data.tar.gz: 76a5d19612b5ae27ad8e602c5b37848e08998909e43b41ef2067ade819fffe8b6dc4efcf34ffa494f2b7594ac7aa30a56b6ee62a76c8dcf3d165dc43bf22253a
6
+ metadata.gz: 2fc47ae529edb85f680eef90d92c83c3b8fdf800c21a4ac3f782c8df71f447b5765ce45dcbdea14adbd684181859d36752f92902f3e05f1c2bfc4b84034f98da
7
+ data.tar.gz: 5e926c2d3191c98c7de685c6bc4c63b933c2a256ab7cbc4c8bbf445c1afe9dee3dec14b23a9854381b8c124cab99a4278972bc7eef2e915f7b31485b2bd0adbd
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Llmshim
4
- VERSION = "0.4.0"
4
+ VERSION = "0.6.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.4.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sanjay Nadhavajhala