ask-tokens-rails 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe4e15b2393197cf4983d5db195ed7e4d513de3593b553b4359f4a5abd114883
4
- data.tar.gz: 56f42f53d6899ea2c7fdba9d8e664cf083398abe0b510f207663e817564387b2
3
+ metadata.gz: cc1c7646a3a0c0d4c2d740a3cddc4de2104922ad01422996a75b242a92768b03
4
+ data.tar.gz: b612c6ec93c58cb88896e1eae846bf8610e8967a3702bca09a48f9eaec9a6a99
5
5
  SHA512:
6
- metadata.gz: bcb48f78eed19e4777b2236b7b0a98a53645173a122845db5f8b26c35c7e9f004f98766889b2b366d94814820e1d7d3cb5fdec9d68081aa28c2e3912ec518b14
7
- data.tar.gz: 2f5d0a2ae26cd3997b2964c4e6d804b757382b5db26af238ae2a5cd809e616e3c16d8bfece4446bf289c17d5bca56a0853ee197c0f2ea1b69cfe4b41526b4e80
6
+ metadata.gz: 88fdaae1e59cdd5b93171f17ca0281acbe122ec3d5a4050af6c968673a160ee5f4002a151860467c367530c687e2f70a380f9d7b0b73cde8287774e24ef7b9f8
7
+ data.tar.gz: e7d60c01b89f2023ae0a04d1315672080abca3bb69db7581608387a086fbb5ea7f9085b09c2901de50f1faf63c95f085f3fd5e85c699f1ba6b9b58077e2923ab
@@ -96,7 +96,7 @@ module Ask
96
96
  # LLM context are unaffected. Symbol and string keys are both handled.
97
97
  # Intersected with the table's actual columns so installs created
98
98
  # before the billing columns existed keep the detail in metadata.
99
- COLUMN_KEYS = %i[model_id provider input_tokens output_tokens cached_tokens llm_cost_usd multiplier].freeze
99
+ COLUMN_KEYS = %i[model_id provider input_tokens output_tokens cached_tokens llm_cost_usd multiplier cost_kind unit_kind units].freeze
100
100
 
101
101
  def extract_columns_from_metadata(meta)
102
102
  keys = COLUMN_KEYS & Ask::Tokens::TokenTransaction.column_names.map(&:to_sym)
@@ -3,7 +3,7 @@
3
3
  module Ask
4
4
  module Tokens
5
5
  module Rails
6
- VERSION = "0.4.0"
6
+ VERSION = "0.5.0"
7
7
  end
8
8
  end
9
9
  end
@@ -28,6 +28,9 @@ class CreateAskTokensTables < ActiveRecord::Migration[7.0]
28
28
  t.bigint :cached_tokens
29
29
  t.decimal :llm_cost_usd, precision: 12, scale: 8
30
30
  t.decimal :multiplier, precision: 6, scale: 4, default: 1.0, null: false
31
+ t.string :cost_kind # llm, messaging, voice, storage
32
+ t.string :unit_kind # tokens, messages, minutes
33
+ t.bigint :units
31
34
  t.datetime :created_at, null: false
32
35
  end
33
36
  add_index :<%= Ask::Tokens::Rails.config.transactions_table %>, %i[token_wallet_id created_at]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ask-tokens-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaka Ruto