lex-finops 0.1.2 → 0.1.3
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 +4 -4
- data/lib/legion/extensions/finops/helpers/budget_store.rb +1 -1
- data/lib/legion/extensions/finops/helpers/cost_calculator.rb +1 -1
- data/lib/legion/extensions/finops/runners/budget.rb +2 -0
- data/lib/legion/extensions/finops/runners/cost_attribution.rb +4 -2
- data/lib/legion/extensions/finops/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9a27bf85c3b7776a210358ce4783a98e8a5f86aa0ac4ce34d4570822ae4d5a03
|
|
4
|
+
data.tar.gz: a51f68fcc90d4ade3ebfc6ca7602ef62524e87b34b9252541fe0547af32e49d7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1e66fda73d245caf32c0e6c2925a66c56379f082735d3dc8caf6795fc93661bc1d29c323edf6539f86f11b8e11a0175f477d34cb87e3b30fee0b94d42eb65a8a
|
|
7
|
+
data.tar.gz: d4bbd6d7ef2bf49b908eb044ded0c43e0a28b883075ede56818a3747939ac52c339dd8ba415698b56d92fb20dc19b59ce52b36d9fde502e4094998f07d8f9b77
|
|
@@ -5,7 +5,9 @@ module Legion
|
|
|
5
5
|
module Finops
|
|
6
6
|
module Runners
|
|
7
7
|
module CostAttribution
|
|
8
|
-
|
|
8
|
+
extend self
|
|
9
|
+
|
|
10
|
+
def attribute_cost(worker_id:, provider:, model:, input_tokens:, # rubocop:disable Metrics/ParameterLists
|
|
9
11
|
output_tokens:, tenant_id: nil, team: nil,
|
|
10
12
|
task_id: nil, extension: nil, thinking_tokens: 0, **)
|
|
11
13
|
cost = Helpers::CostCalculator.estimate_cost(
|
|
@@ -54,7 +56,7 @@ module Legion
|
|
|
54
56
|
def metering_available?
|
|
55
57
|
defined?(Legion::Data) && Legion::Data.respond_to?(:connection) &&
|
|
56
58
|
Legion::Data.connection&.table_exists?(:metering_records)
|
|
57
|
-
rescue StandardError
|
|
59
|
+
rescue StandardError => _e
|
|
58
60
|
false
|
|
59
61
|
end
|
|
60
62
|
|