boxcars 0.10.12 → 0.10.13
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/CHANGELOG.md +16 -0
- data/Gemfile.lock +12 -12
- data/docs/boxcars_guide.md +38 -10
- data/lib/boxcars/engines.rb +1 -0
- data/lib/boxcars/version.rb +1 -1
- data/lib/boxcars.rb +2 -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: 1b384afa83de379dbebf4fb7bce4ece7883993c87ad5526240bb69b1fab05a50
|
|
4
|
+
data.tar.gz: bdd1d266db61afdb05f4f4bb6851e219fed3cf71380ee3d5c4dd50e3a5505253
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 84c44b4ea6d7d8ab957f93ace2a71a229fff834a048489a1e85b580b76010747c35e844a0c72e64ab9524dd401eb3a7067208d583b5310b2cd631ecee82e51bf
|
|
7
|
+
data.tar.gz: e462bdad7c4b9594b5f45efed712b4801176341edc407638a9259625bc62340d593a37d9e0eaa3163df6c8a86d8326badda8d4642969f202614e0fe9c45f5ab4
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.10.13] - 2026-08-04
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Added `Boxcars::Configuration#default_model_options` for applying shared engine options when the configured or built-in default model is used. Per-call options take precedence, and configured defaults are not passed to explicit models.
|
|
10
|
+
|
|
11
|
+
### Maintenance
|
|
12
|
+
|
|
13
|
+
- Refreshed bundled dependencies, including Active Record, OpenAI, RuboCop, and Sequel.
|
|
14
|
+
|
|
15
|
+
## [0.10.12] - 2026-07-20
|
|
16
|
+
|
|
17
|
+
### Maintenance
|
|
18
|
+
|
|
19
|
+
- Updated development dependency constraints and refreshed bundled dependencies, including OpenAI, PostHog, RuboCop, and Sequel.
|
|
20
|
+
|
|
5
21
|
## [0.10.11] - 2026-06-26
|
|
6
22
|
|
|
7
23
|
### Fixed
|
data/Gemfile.lock
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
boxcars (0.10.
|
|
4
|
+
boxcars (0.10.13)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
8
8
|
specs:
|
|
9
|
-
activemodel (8.1.3)
|
|
10
|
-
activesupport (= 8.1.3)
|
|
11
|
-
activerecord (8.1.3)
|
|
12
|
-
activemodel (= 8.1.3)
|
|
13
|
-
activesupport (= 8.1.3)
|
|
9
|
+
activemodel (8.1.3.1)
|
|
10
|
+
activesupport (= 8.1.3.1)
|
|
11
|
+
activerecord (8.1.3.1)
|
|
12
|
+
activemodel (= 8.1.3.1)
|
|
13
|
+
activesupport (= 8.1.3.1)
|
|
14
14
|
timeout (>= 0.4.0)
|
|
15
|
-
activesupport (8.1.3)
|
|
15
|
+
activesupport (8.1.3.1)
|
|
16
16
|
base64
|
|
17
17
|
bigdecimal
|
|
18
18
|
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
@@ -63,7 +63,7 @@ GEM
|
|
|
63
63
|
prism (>= 1.3.0)
|
|
64
64
|
rdoc (>= 4.0.0)
|
|
65
65
|
reline (>= 0.4.2)
|
|
66
|
-
json (2.21.
|
|
66
|
+
json (2.21.2)
|
|
67
67
|
language_server-protocol (3.17.0.6)
|
|
68
68
|
lint_roller (1.1.0)
|
|
69
69
|
logger (1.7.0)
|
|
@@ -89,7 +89,7 @@ GEM
|
|
|
89
89
|
racc (~> 1.4)
|
|
90
90
|
nokogiri (1.19.4-x86_64-linux-musl)
|
|
91
91
|
racc (~> 1.4)
|
|
92
|
-
openai (0.
|
|
92
|
+
openai (0.77.0)
|
|
93
93
|
base64
|
|
94
94
|
cgi
|
|
95
95
|
connection_pool
|
|
@@ -115,7 +115,7 @@ GEM
|
|
|
115
115
|
racc (1.8.1)
|
|
116
116
|
rainbow (3.1.1)
|
|
117
117
|
rake (13.4.2)
|
|
118
|
-
rbs (4.
|
|
118
|
+
rbs (4.1.2)
|
|
119
119
|
logger
|
|
120
120
|
prism (>= 1.6.0)
|
|
121
121
|
tsort
|
|
@@ -141,7 +141,7 @@ GEM
|
|
|
141
141
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
142
142
|
rspec-support (~> 3.13.0)
|
|
143
143
|
rspec-support (3.13.7)
|
|
144
|
-
rubocop (1.
|
|
144
|
+
rubocop (1.89.0)
|
|
145
145
|
json (~> 2.3)
|
|
146
146
|
language_server-protocol (~> 3.17.0.2)
|
|
147
147
|
lint_roller (~> 1.1.0)
|
|
@@ -168,7 +168,7 @@ GEM
|
|
|
168
168
|
faraday-multipart (>= 1)
|
|
169
169
|
ruby-progressbar (1.13.0)
|
|
170
170
|
securerandom (0.4.1)
|
|
171
|
-
sequel (5.
|
|
171
|
+
sequel (5.107.0)
|
|
172
172
|
bigdecimal
|
|
173
173
|
sqlite3 (2.9.5-aarch64-linux-gnu)
|
|
174
174
|
sqlite3 (2.9.5-aarch64-linux-musl)
|
data/docs/boxcars_guide.md
CHANGED
|
@@ -39,7 +39,8 @@ Use a Rails initializer for defaults, then call Boxcars from normal service obje
|
|
|
39
39
|
```ruby
|
|
40
40
|
# config/initializers/boxcars.rb
|
|
41
41
|
Boxcars.configure do |config|
|
|
42
|
-
config.default_model = "gpt-5-
|
|
42
|
+
config.default_model = "gpt-5.6-luna"
|
|
43
|
+
config.default_model_options = { reasoning_effort: "high" }
|
|
43
44
|
config.log_prompts = Rails.env.development?
|
|
44
45
|
end
|
|
45
46
|
```
|
|
@@ -279,24 +280,47 @@ If you need a softer rollout during migration, use `json_schema_strict: false` a
|
|
|
279
280
|
|
|
280
281
|
#### Global Configuration
|
|
281
282
|
|
|
282
|
-
Set a global default model used by `Boxcars::Engines.engine()`
|
|
283
|
+
Set a global default model and options used by `Boxcars::Engines.engine()` and
|
|
284
|
+
`Boxcars::Engines.json_engine()` when no model is specified:
|
|
283
285
|
|
|
284
286
|
```ruby
|
|
285
|
-
|
|
286
|
-
|
|
287
|
+
Boxcars.configure do |config|
|
|
288
|
+
config.default_model = "gpt-5.6-luna"
|
|
289
|
+
config.default_model_options = { reasoning_effort: "high" }
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
# Uses gpt-5.6-luna with reasoning_effort: "high"
|
|
293
|
+
engine = Boxcars::Engines.engine
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
`default_model_options` defaults to an empty hash. Options passed directly to
|
|
297
|
+
the factory override configured defaults:
|
|
287
298
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
299
|
+
```ruby
|
|
300
|
+
# Uses reasoning_effort: "low"
|
|
301
|
+
engine = Boxcars::Engines.engine(reasoning_effort: "low")
|
|
291
302
|
```
|
|
292
303
|
|
|
304
|
+
Passing an explicit model bypasses `default_model_options`, preventing options
|
|
305
|
+
intended for one provider or model from leaking into another:
|
|
306
|
+
|
|
307
|
+
```ruby
|
|
308
|
+
# Uses gpt-4o without the configured reasoning_effort option
|
|
309
|
+
engine = Boxcars::Engines.engine(model: "gpt-4o")
|
|
310
|
+
json_engine = Boxcars::Engines.json_engine(model: "gpt-4o")
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
For `json_engine`, the helper's JSON-specific defaults and explicit call options
|
|
314
|
+
take precedence over `default_model_options`.
|
|
315
|
+
|
|
293
316
|
#### Configuration Block
|
|
294
317
|
|
|
295
318
|
```ruby
|
|
296
319
|
Boxcars.configure do |config|
|
|
297
|
-
config.default_model = "
|
|
298
|
-
config.
|
|
299
|
-
config.
|
|
320
|
+
config.default_model = "gpt-5.6-luna"
|
|
321
|
+
config.default_model_options = { reasoning_effort: "high" }
|
|
322
|
+
config.logger = Rails.logger # Set custom logger
|
|
323
|
+
config.log_prompts = true # Enable prompt logging
|
|
300
324
|
end
|
|
301
325
|
```
|
|
302
326
|
|
|
@@ -334,6 +358,10 @@ end
|
|
|
334
358
|
2. **Global configuration**: `Boxcars.configuration.default_model`
|
|
335
359
|
3. **Built-in default**: `"gemini-2.5-flash"`
|
|
336
360
|
|
|
361
|
+
When no model is passed, configured `default_model_options` are merged with the
|
|
362
|
+
call's options, with call options winning. When a model is passed explicitly,
|
|
363
|
+
configured default options are not merged.
|
|
364
|
+
|
|
337
365
|
#### Supported Model Aliases for default_model
|
|
338
366
|
|
|
339
367
|
```ruby
|
data/lib/boxcars/engines.rb
CHANGED
|
@@ -40,6 +40,7 @@ module Boxcars
|
|
|
40
40
|
# @param kw_args [Hash] Additional arguments to pass to the engine
|
|
41
41
|
# @return [Boxcars::Engine] An instance of the appropriate engine class
|
|
42
42
|
def self.engine(model: nil, **kw_args)
|
|
43
|
+
kw_args = Boxcars.configuration.default_model_options.merge(kw_args) if model.nil?
|
|
43
44
|
model ||= Boxcars.configuration.default_model || DEFAULT_MODEL
|
|
44
45
|
emit_alias_deprecation_warning(model)
|
|
45
46
|
Boxcars.logger&.info { "running api with #{model}" }
|
data/lib/boxcars/version.rb
CHANGED
data/lib/boxcars.rb
CHANGED
|
@@ -29,13 +29,14 @@ module Boxcars
|
|
|
29
29
|
class Configuration
|
|
30
30
|
attr_writer :openai_access_token, :serpapi_api_key, :groq_api_key, :cerebras_api_key, :perplexity_api_key
|
|
31
31
|
attr_accessor :organization_id, :logger, :log_prompts, :log_generated, :default_train, :default_engine, :default_model,
|
|
32
|
-
:observability_backend, :strict_deprecated_model_aliases
|
|
32
|
+
:default_model_options, :observability_backend, :strict_deprecated_model_aliases
|
|
33
33
|
|
|
34
34
|
def initialize
|
|
35
35
|
@organization_id = nil
|
|
36
36
|
@logger = Rails.logger if defined?(Rails)
|
|
37
37
|
@log_prompts = ENV.fetch("LOG_PROMPTS", false)
|
|
38
38
|
@log_generated = ENV.fetch("LOG_GEN", false)
|
|
39
|
+
@default_model_options = {}
|
|
39
40
|
@strict_deprecated_model_aliases = false
|
|
40
41
|
self.emit_deprecation_warnings = true
|
|
41
42
|
self.openai_official_require_native = ENV.fetch("OPENAI_OFFICIAL_REQUIRE_NATIVE", false)
|