boxcars 0.6.5 → 0.6.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/CHANGELOG.md +26 -0
- data/Gemfile +4 -4
- data/Gemfile.lock +30 -29
- data/lib/boxcars/engine/anthropic.rb +5 -0
- data/lib/boxcars/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93deffd0bbce00b58479a93a7c20afdd59fa029bff798d3e90abafb37569ae83
|
4
|
+
data.tar.gz: 314f504e1b061856c90951730b9d3c8465174eaa007363a12c8805ee1e36fc32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29fc4a409bd98e4528142e295a09727b3a5b0c156343d365601f07852f5f09333ebe6a4a1c798e2e0890420e7414c6be5fa17dd02aa40f528375a207fd74da04
|
7
|
+
data.tar.gz: a317992e392cda328242487910713cd82968ca371783072564379d3a806c1a8e831d00eace9ea6df80da4bc569526f97ecd1b1a6c133b4b5d7bb43ee8c1b305a
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,31 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [v0.6.5](https://github.com/BoxcarsAI/boxcars/tree/v0.6.5) (2024-10-04)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/BoxcarsAI/boxcars/compare/v0.6.4...v0.6.5)
|
6
|
+
|
7
|
+
**Closed issues:**
|
8
|
+
|
9
|
+
- Consider methods to prevent hallucinations and incorrect answers [\#89](https://github.com/BoxcarsAI/boxcars/issues/89)
|
10
|
+
- Fix: change SQL Boxcar to use the name of the database in the prompt [\#14](https://github.com/BoxcarsAI/boxcars/issues/14)
|
11
|
+
|
12
|
+
**Merged pull requests:**
|
13
|
+
|
14
|
+
- Update ruby [\#217](https://github.com/BoxcarsAI/boxcars/pull/217) ([francis](https://github.com/francis))
|
15
|
+
- \[infra\] Bump rubocop-rspec from 3.0.4 to 3.1.0 [\#216](https://github.com/BoxcarsAI/boxcars/pull/216) ([dependabot[bot]](https://github.com/apps/dependabot))
|
16
|
+
- \[infra\] Bump pg from 1.5.7 to 1.5.8 [\#214](https://github.com/BoxcarsAI/boxcars/pull/214) ([dependabot[bot]](https://github.com/apps/dependabot))
|
17
|
+
- \[infra\] Bump dotenv from 3.1.2 to 3.1.4 [\#213](https://github.com/BoxcarsAI/boxcars/pull/213) ([dependabot[bot]](https://github.com/apps/dependabot))
|
18
|
+
- \[infra\] Bump rubocop from 1.65.1 to 1.66.1 [\#212](https://github.com/BoxcarsAI/boxcars/pull/212) ([dependabot[bot]](https://github.com/apps/dependabot))
|
19
|
+
- \[infra\] Bump activesupport from 7.1.3.4 to 7.1.4 [\#211](https://github.com/BoxcarsAI/boxcars/pull/211) ([dependabot[bot]](https://github.com/apps/dependabot))
|
20
|
+
- \[infra\] Bump activerecord from 7.1.3.4 to 7.1.4 [\#210](https://github.com/BoxcarsAI/boxcars/pull/210) ([dependabot[bot]](https://github.com/apps/dependabot))
|
21
|
+
- \[infra\] Bump rexml from 3.3.4 to 3.3.6 [\#209](https://github.com/BoxcarsAI/boxcars/pull/209) ([dependabot[bot]](https://github.com/apps/dependabot))
|
22
|
+
- \[infra\] Bump vcr from 6.3.0 to 6.3.1 [\#208](https://github.com/BoxcarsAI/boxcars/pull/208) ([dependabot[bot]](https://github.com/apps/dependabot))
|
23
|
+
- \[infra\] Bump vcr from 6.2.0 to 6.3.0 [\#207](https://github.com/BoxcarsAI/boxcars/pull/207) ([dependabot[bot]](https://github.com/apps/dependabot))
|
24
|
+
- \[infra\] Bump rubocop-rspec from 3.0.3 to 3.0.4 [\#205](https://github.com/BoxcarsAI/boxcars/pull/205) ([dependabot[bot]](https://github.com/apps/dependabot))
|
25
|
+
- \[infra\] Bump rubocop from 1.65.0 to 1.65.1 [\#204](https://github.com/BoxcarsAI/boxcars/pull/204) ([dependabot[bot]](https://github.com/apps/dependabot))
|
26
|
+
- \[infra\] Bump nokogiri from 1.16.6 to 1.16.7 [\#202](https://github.com/BoxcarsAI/boxcars/pull/202) ([dependabot[bot]](https://github.com/apps/dependabot))
|
27
|
+
- \[infra\] Bump pg from 1.5.6 to 1.5.7 [\#201](https://github.com/BoxcarsAI/boxcars/pull/201) ([dependabot[bot]](https://github.com/apps/dependabot))
|
28
|
+
|
3
29
|
## [v0.6.4](https://github.com/BoxcarsAI/boxcars/tree/v0.6.4) (2024-07-27)
|
4
30
|
|
5
31
|
[Full Changelog](https://github.com/BoxcarsAI/boxcars/compare/v0.6.3...v0.6.4)
|
data/Gemfile
CHANGED
@@ -11,7 +11,7 @@ gem "dotenv", "~> 3.1"
|
|
11
11
|
|
12
12
|
gem "rake", "~> 13.2"
|
13
13
|
|
14
|
-
gem "sqlite3", "~>
|
14
|
+
gem "sqlite3", "~> 2.0"
|
15
15
|
|
16
16
|
gem "async", "~>1.32.1"
|
17
17
|
|
@@ -32,9 +32,9 @@ gem "pgvector", "~> 0.2.2"
|
|
32
32
|
|
33
33
|
group :development, :test do
|
34
34
|
gem "rspec", "~> 3.13"
|
35
|
-
gem "rubocop", "~> 1.
|
35
|
+
gem "rubocop", "~> 1.67"
|
36
36
|
gem "vcr", "~> 6.3.1"
|
37
|
-
gem "webmock", "~> 3.
|
37
|
+
gem "webmock", "~> 3.24.0"
|
38
38
|
gem "rubocop-rake", "~> 0.6.0"
|
39
|
-
gem "rubocop-rspec", "~> 3.
|
39
|
+
gem "rubocop-rspec", "~> 3.2"
|
40
40
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
boxcars (0.6.
|
4
|
+
boxcars (0.6.6)
|
5
5
|
anthropic (~> 0.1)
|
6
6
|
google_search_results (~> 2.2)
|
7
7
|
gpt4all (~> 0.0.4)
|
@@ -13,13 +13,13 @@ PATH
|
|
13
13
|
GEM
|
14
14
|
remote: https://rubygems.org/
|
15
15
|
specs:
|
16
|
-
activemodel (7.1.4)
|
17
|
-
activesupport (= 7.1.4)
|
18
|
-
activerecord (7.1.4)
|
19
|
-
activemodel (= 7.1.4)
|
20
|
-
activesupport (= 7.1.4)
|
16
|
+
activemodel (7.1.4.2)
|
17
|
+
activesupport (= 7.1.4.2)
|
18
|
+
activerecord (7.1.4.2)
|
19
|
+
activemodel (= 7.1.4.2)
|
20
|
+
activesupport (= 7.1.4.2)
|
21
21
|
timeout (>= 0.4.0)
|
22
|
-
activesupport (7.1.4)
|
22
|
+
activesupport (7.1.4.2)
|
23
23
|
base64
|
24
24
|
bigdecimal
|
25
25
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
@@ -31,7 +31,7 @@ GEM
|
|
31
31
|
tzinfo (~> 2.0)
|
32
32
|
addressable (2.8.7)
|
33
33
|
public_suffix (>= 2.0.2, < 7.0)
|
34
|
-
anthropic (0.3.
|
34
|
+
anthropic (0.3.2)
|
35
35
|
event_stream_parser (>= 0.3.0, < 2.0.0)
|
36
36
|
faraday (>= 1)
|
37
37
|
faraday-multipart (>= 1)
|
@@ -74,14 +74,15 @@ GEM
|
|
74
74
|
dotenv (3.1.4)
|
75
75
|
drb (2.2.1)
|
76
76
|
event_stream_parser (1.0.0)
|
77
|
-
faraday (2.
|
78
|
-
faraday-net_http (>= 2.0, < 3.
|
77
|
+
faraday (2.12.0)
|
78
|
+
faraday-net_http (>= 2.0, < 3.4)
|
79
|
+
json
|
79
80
|
logger
|
80
81
|
faraday-http-cache (2.5.1)
|
81
82
|
faraday (>= 0.8)
|
82
83
|
faraday-multipart (1.0.4)
|
83
84
|
multipart-post (~> 2)
|
84
|
-
faraday-net_http (3.
|
85
|
+
faraday-net_http (3.3.0)
|
85
86
|
net-http
|
86
87
|
faraday-retry (2.2.1)
|
87
88
|
faraday (~> 2.0)
|
@@ -103,20 +104,20 @@ GEM
|
|
103
104
|
faraday (~> 2.7)
|
104
105
|
os (~> 1.1)
|
105
106
|
tty-progressbar (~> 0.18.2)
|
106
|
-
hashdiff (1.1.
|
107
|
+
hashdiff (1.1.1)
|
107
108
|
hnswlib (0.9.0)
|
108
109
|
http-accept (1.7.0)
|
109
110
|
http-cookie (1.0.6)
|
110
111
|
domain_name (~> 0.5)
|
111
|
-
i18n (1.14.
|
112
|
+
i18n (1.14.6)
|
112
113
|
concurrent-ruby (~> 1.0)
|
113
114
|
io-console (0.7.2)
|
114
115
|
irb (1.14.0)
|
115
116
|
rdoc (>= 4.0.0)
|
116
117
|
reline (>= 0.4.2)
|
117
|
-
json (2.7.
|
118
|
+
json (2.7.5)
|
118
119
|
language_server-protocol (3.17.0.3)
|
119
|
-
logger (1.6.
|
120
|
+
logger (1.6.1)
|
120
121
|
mime-types (3.5.2)
|
121
122
|
mime-types-data (~> 3.2015)
|
122
123
|
mime-types-data (3.2024.0702)
|
@@ -151,7 +152,7 @@ GEM
|
|
151
152
|
protocol-http (~> 0.18)
|
152
153
|
psych (5.1.2)
|
153
154
|
stringio
|
154
|
-
public_suffix (6.0.
|
155
|
+
public_suffix (6.0.1)
|
155
156
|
racc (1.8.1)
|
156
157
|
rainbow (3.1.1)
|
157
158
|
rake (13.2.1)
|
@@ -165,7 +166,7 @@ GEM
|
|
165
166
|
http-cookie (>= 1.0.2, < 2.0)
|
166
167
|
mime-types (>= 1.16, < 4.0)
|
167
168
|
netrc (~> 0.8)
|
168
|
-
rexml (3.3.
|
169
|
+
rexml (3.3.9)
|
169
170
|
rspec (3.13.0)
|
170
171
|
rspec-core (~> 3.13.0)
|
171
172
|
rspec-expectations (~> 3.13.0)
|
@@ -179,7 +180,7 @@ GEM
|
|
179
180
|
diff-lcs (>= 1.2.0, < 2.0)
|
180
181
|
rspec-support (~> 3.13.0)
|
181
182
|
rspec-support (3.13.1)
|
182
|
-
rubocop (1.
|
183
|
+
rubocop (1.67.0)
|
183
184
|
json (~> 2.3)
|
184
185
|
language_server-protocol (>= 3.17.0)
|
185
186
|
parallel (~> 1.10)
|
@@ -189,13 +190,13 @@ GEM
|
|
189
190
|
rubocop-ast (>= 1.32.2, < 2.0)
|
190
191
|
ruby-progressbar (~> 1.7)
|
191
192
|
unicode-display_width (>= 2.4.0, < 3.0)
|
192
|
-
rubocop-ast (1.
|
193
|
+
rubocop-ast (1.33.0)
|
193
194
|
parser (>= 3.3.1.0)
|
194
195
|
rubocop-rake (0.6.0)
|
195
196
|
rubocop (~> 1.0)
|
196
|
-
rubocop-rspec (3.
|
197
|
+
rubocop-rspec (3.2.0)
|
197
198
|
rubocop (~> 1.61)
|
198
|
-
ruby-openai (7.1
|
199
|
+
ruby-openai (7.3.1)
|
199
200
|
event_stream_parser (>= 0.3.0, < 2.0.0)
|
200
201
|
faraday (>= 1)
|
201
202
|
faraday-multipart (>= 1)
|
@@ -203,8 +204,8 @@ GEM
|
|
203
204
|
sawyer (0.9.2)
|
204
205
|
addressable (>= 2.3.5)
|
205
206
|
faraday (>= 0.17.3, < 3)
|
206
|
-
sqlite3 (
|
207
|
-
sqlite3 (
|
207
|
+
sqlite3 (2.0.4-arm64-darwin)
|
208
|
+
sqlite3 (2.0.4-x86_64-linux-gnu)
|
208
209
|
stringio (3.1.1)
|
209
210
|
strings-ansi (0.2.0)
|
210
211
|
timeout (0.4.1)
|
@@ -220,10 +221,10 @@ GEM
|
|
220
221
|
tzinfo (2.0.6)
|
221
222
|
concurrent-ruby (~> 1.0)
|
222
223
|
unicode-display_width (2.6.0)
|
223
|
-
uri (0.13.
|
224
|
+
uri (0.13.1)
|
224
225
|
vcr (6.3.1)
|
225
226
|
base64
|
226
|
-
webmock (3.
|
227
|
+
webmock (3.24.0)
|
227
228
|
addressable (>= 2.8.0)
|
228
229
|
crack (>= 0.3.2)
|
229
230
|
hashdiff (>= 0.4.0, < 2.0.0)
|
@@ -249,12 +250,12 @@ DEPENDENCIES
|
|
249
250
|
rake (~> 13.2)
|
250
251
|
rest-client (~> 2.1)
|
251
252
|
rspec (~> 3.13)
|
252
|
-
rubocop (~> 1.
|
253
|
+
rubocop (~> 1.67)
|
253
254
|
rubocop-rake (~> 0.6.0)
|
254
|
-
rubocop-rspec (~> 3.
|
255
|
-
sqlite3 (~>
|
255
|
+
rubocop-rspec (~> 3.2)
|
256
|
+
sqlite3 (~> 2.0)
|
256
257
|
vcr (~> 6.3.1)
|
257
|
-
webmock (~> 3.
|
258
|
+
webmock (~> 3.24.0)
|
258
259
|
|
259
260
|
BUNDLED WITH
|
260
261
|
2.4.16
|
@@ -45,6 +45,7 @@ module Boxcars
|
|
45
45
|
# @param anthropic_api_key [String] Optional api key to use when asking the engine.
|
46
46
|
# Defaults to Boxcars.configuration.anthropic_api_key.
|
47
47
|
# @param kwargs [Hash] Additional parameters to pass to the engine if wanted.
|
48
|
+
# rubocop:disable Metrics/PerceivedComplexity
|
48
49
|
def client(prompt:, inputs: {}, **kwargs)
|
49
50
|
model_params = llm_params.merge(kwargs)
|
50
51
|
api_key = Boxcars.configuration.anthropic_api_key(**kwargs)
|
@@ -54,6 +55,9 @@ module Boxcars
|
|
54
55
|
if conversation_model?(model_params[:model])
|
55
56
|
params = convert_to_anthropic(prompt.as_messages(inputs).merge(model_params))
|
56
57
|
if Boxcars.configuration.log_prompts
|
58
|
+
if params[:messages].length < 2 && params[:system].present?
|
59
|
+
Boxcars.debug(">>>>>> Role: system <<<<<<\n#{params[:system]}")
|
60
|
+
end
|
57
61
|
Boxcars.debug(params[:messages].last(2).map { |p| ">>>>>> Role: #{p[:role]} <<<<<<\n#{p[:content]}" }.join("\n"), :cyan)
|
58
62
|
end
|
59
63
|
response = aclient.messages(parameters: params)
|
@@ -68,6 +72,7 @@ module Boxcars
|
|
68
72
|
aclient.complete(parameters: params)
|
69
73
|
end
|
70
74
|
end
|
75
|
+
# rubocop:enable Metrics/PerceivedComplexity
|
71
76
|
|
72
77
|
# get an answer from the engine for a question.
|
73
78
|
# @param question [String] The question to ask the engine.
|
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.6.
|
4
|
+
version: 0.6.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: 2024-
|
12
|
+
date: 2024-11-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: anthropic
|
@@ -219,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
219
219
|
- !ruby/object:Gem::Version
|
220
220
|
version: '0'
|
221
221
|
requirements: []
|
222
|
-
rubygems_version: 3.5.
|
222
|
+
rubygems_version: 3.5.23
|
223
223
|
signing_key:
|
224
224
|
specification_version: 4
|
225
225
|
summary: Boxcars is a gem that enables you to create new systems with AI composability.
|