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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cc1c7646a3a0c0d4c2d740a3cddc4de2104922ad01422996a75b242a92768b03
|
|
4
|
+
data.tar.gz: b612c6ec93c58cb88896e1eae846bf8610e8967a3702bca09a48f9eaec9a6a99
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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)
|
|
@@ -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]
|