active_harness_pricing 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2653909fb5d73d8d77e59d831443339ab8729575eedc6cbf53dc38a8b6ac5cd9
4
- data.tar.gz: 0613137206fd9a05635641d47eb8dd2bc062ea9e1c0cfeae93945d7ba13eb903
3
+ metadata.gz: f689ca4f8b7b527abbb2acda1b27f1204cf67df99ce45054f26a5039e8f4ee16
4
+ data.tar.gz: df4cfba2637bbcb51712f31e832dd541fbf5b1700d0a4095fb4a50e2e371ae8b
5
5
  SHA512:
6
- metadata.gz: df0c43417885adcdaa3847768c4876c7312209e668a5ff9e15ef76bd729a913ffb1fe26747081b0732d83127565c2c809fd253ce8c20a4f38549484051f4d123
7
- data.tar.gz: 4b243ea1b8d27dccd2bf7ffe6db115266c41d8fb8c9870b743c32bff59c53975b2891a11c0577e29b24f2dbf0c2c06fdaf95f3efb1d09783151b76df9553f901
6
+ metadata.gz: 7837a3c69a2a7f70e8c97a5617820a7ee072ea1540c5a99cde473309a1ddd3103088768b4db079095fce26b0a74a47cdbca0c8b4cf66c58c9b34e72d1daec79c
7
+ data.tar.gz: 013d47bfe9231a842ca7ad09f6d3b181bfb253aa797be5027aad22c95a4d99ad2f8d2d1a02945c272a010c1fe6f508f515802e6bbd9b568bd9587a1a557b9191
@@ -9,7 +9,7 @@ module ActiveHarness
9
9
  # Fallback pricing source — fetches model data from models.dev.
10
10
  #
11
11
  # Data source:
12
- # {project_root}/tmp/active_harness/pricing_models_dev.json — fetched cache (24h TTL)
12
+ # {project_root}/tmp/active_harness/pricing_models_dev.json — fetched cache (72h TTL)
13
13
  # Returns nil/empty if cache is missing and network is unavailable.
14
14
  #
15
15
  # Usage:
@@ -4,8 +4,8 @@ module ActiveHarness
4
4
  # Pricing namespace — shared types and a facade over pricing source modules.
5
5
  #
6
6
  # Sources (in priority order):
7
- # Pricing::OpenRouter — live data from OpenRouter API (image models, 24h cache)
8
- # Pricing::ModelsDev — live data from models.dev API (all providers, 24h cache)
7
+ # Pricing::OpenRouter — live data from OpenRouter API (all modalities, 72h cache)
8
+ # Pricing::ModelsDev — live data from models.dev API (all providers, 72h cache)
9
9
  #
10
10
  # Public facade delegates to ModelsDev (used as the general fallback):
11
11
  # Pricing.find("gpt-4o") → ModelPrice or nil
@@ -102,11 +102,18 @@ module ActiveHarness
102
102
  end
103
103
 
104
104
  # ---------------------------------------------------------------------------
105
- # Facade — delegates to ModelsDev (general fallback source)
105
+ # Public facade
106
+ #
107
+ # ModelsDev is the general source — covers all major providers (openai,
108
+ # anthropic, gemini, …) and is the right default for provider-agnostic
109
+ # lookups. OpenRouter is a specialised source for OpenRouter-routed model
110
+ # IDs (e.g. "openai/gpt-4o") and is consulted separately where needed.
111
+ #
112
+ # preload! is the only method that touches both sources.
106
113
  # ---------------------------------------------------------------------------
107
114
  class << self
108
- # Eagerly fetch all pricing sources and load them into memory.
109
- # Called at Rails startup. Network failures are silently ignored.
115
+ # Eagerly load both pricing sources into memory.
116
+ # Called at Rails startup via Railtie. Network failures are silently ignored.
110
117
  def preload!
111
118
  ModelsDev.preload!
112
119
  OpenRouter.preload!
@@ -131,22 +138,6 @@ module ActiveHarness
131
138
  def provider_names
132
139
  ModelsDev.provider_names
133
140
  end
134
-
135
- def update
136
- ModelsDev.update
137
- end
138
-
139
- def reload!
140
- ModelsDev.reload!
141
- end
142
-
143
- def cache_file
144
- ModelsDev.cache_file
145
- end
146
-
147
- def available_providers
148
- ModelsDev.available_providers
149
- end
150
141
  end
151
142
  end
152
143
  end
@@ -3,5 +3,5 @@ require_relative "active_harness/pricing/models_dev"
3
3
  require_relative "active_harness/pricing/openrouter"
4
4
 
5
5
  module ActiveHarnessPricing
6
- VERSION = "0.1.2"
6
+ VERSION = "0.1.3"
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_harness_pricing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - the-teacher