boxcars 0.7.5 → 0.7.6
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/Gemfile.lock +1 -1
- data/lib/boxcars/engine/openai.rb +11 -4
- data/lib/boxcars/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 998fff351b071b938cb5ba4cb0427b7448ffbb46e71b5272761bac45625dca3a
|
4
|
+
data.tar.gz: c6c945e4cabc226f4eb37e1368b77276a18023a26e1e05a5d60bb02742b3ed05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e4fad15d9c08ff76efec828697b387241534114f4594605ce5f257ce9de4d354f77aa5481f36961158b97399dba8d7913732b7644984eb864994103bab38839
|
7
|
+
data.tar.gz: 329d630f296a6e193633efe238e04aeb8ad54ebd4f378ee71467caa373786289529d40c9e0d1337dfb7b0b7acc7c94dc9cbe9cd9a8c3b1178bed7680d1d0aeb7
|
data/Gemfile.lock
CHANGED
@@ -66,10 +66,7 @@ module Boxcars
|
|
66
66
|
params.delete(:response_format)
|
67
67
|
params.delete(:stop)
|
68
68
|
end
|
69
|
-
params = prompt
|
70
|
-
if Boxcars.configuration.log_prompts
|
71
|
-
Boxcars.debug(params[:messages].last(2).map { |p| ">>>>>> Role: #{p[:role]} <<<<<<\n#{p[:content]}" }.join("\n"), :cyan)
|
72
|
-
end
|
69
|
+
params = get_params(prompt, inputs, params)
|
73
70
|
clnt.chat(parameters: params)
|
74
71
|
else
|
75
72
|
params = prompt.as_prompt(inputs: inputs).merge(params)
|
@@ -151,4 +148,14 @@ module Boxcars
|
|
151
148
|
max_size = modelname_to_contextsize(model_name)
|
152
149
|
max_size - num_tokens
|
153
150
|
end
|
151
|
+
|
152
|
+
def get_params(prompt, inputs, params)
|
153
|
+
params = prompt.as_messages(inputs).merge(params)
|
154
|
+
# Handle models like o1-mini that don't support the system role
|
155
|
+
params[:messages].first[:role] = :user if params[:model] =~ /^o/ && params[:messages].first&.fetch(:role) == :system
|
156
|
+
if Boxcars.configuration.log_prompts
|
157
|
+
Boxcars.debug(params[:messages].last(2).map { |p| ">>>>>> Role: #{p[:role]} <<<<<<\n#{p[:content]}" }.join("\n"), :cyan)
|
158
|
+
end
|
159
|
+
params
|
160
|
+
end
|
154
161
|
end
|
data/lib/boxcars/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: boxcars
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Francis Sullivan
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2025-04-
|
12
|
+
date: 2025-04-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: google_search_results
|