boxcars 0.4.10 → 0.5.1

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: 4e9d011a30aa2b478281dca050fec260a09f5e985454beee40405d0ae6991411
4
- data.tar.gz: 2bd6e365273101ebd40a35780a1ef9913f4125a29dc24acaab317146a7c19344
3
+ metadata.gz: 03363b9d82506ac0c784569089c21c605fd76cc0f11fbfdbb05744e1bc330ddd
4
+ data.tar.gz: 6fb219328727d9603bd86358a28e3f715e861db57ff74e49c98d94801b960651
5
5
  SHA512:
6
- metadata.gz: f8937c0f246c0488e0656646bdcd9a02a62edbb068fbd92710e2e275c99c8c7006e4bfec277206b63ae5507833481ec2db9b0a274bb74be743d4739e8bfacc98
7
- data.tar.gz: 5c176f8854d058cad2426786707c11a49759781167e1a861b1e376da1f7c9b679e75b7a33645134cc3e8d7298e907c0c831059328979ff8d590262b5804e76d8
6
+ metadata.gz: 56c9344b6e8c9fbf07323add0e4b3ee245ff6663331a5fd6db917152f7c2aadb428565988c6d63fdb25f5bf2fac2870f47bcf2e8d8fcd9f22239571ea7ee635e
7
+ data.tar.gz: 99f92d94254d6df4260b975642e3d58af6093f024917e3d0e082c8cefd15f94aed879bdc713536f492cb1942d6ffbf52c97b598bb0afa5b26d643c93f3fea132
data/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # Changelog
2
2
 
3
+ ## [v0.4.10](https://github.com/BoxcarsAI/boxcars/tree/v0.4.10) (2024-04-19)
4
+
5
+ [Full Changelog](https://github.com/BoxcarsAI/boxcars/compare/v0.4.9...v0.4.10)
6
+
7
+ **Merged pull requests:**
8
+
9
+ - Add llms [\#169](https://github.com/BoxcarsAI/boxcars/pull/169) ([francis](https://github.com/francis))
10
+ - \[infra\] Bump pg from 1.5.5 to 1.5.6 [\#163](https://github.com/BoxcarsAI/boxcars/pull/163) ([dependabot[bot]](https://github.com/apps/dependabot))
11
+ - \[infra\] Bump rubocop-rspec from 2.26.1 to 2.29.1 [\#160](https://github.com/BoxcarsAI/boxcars/pull/160) ([dependabot[bot]](https://github.com/apps/dependabot))
12
+ - \[infra\] Bump rdoc from 6.6.2 to 6.6.3.1 [\#158](https://github.com/BoxcarsAI/boxcars/pull/158) ([dependabot[bot]](https://github.com/apps/dependabot))
13
+ - \[infra\] Bump dotenv from 3.0.2 to 3.1.0 [\#152](https://github.com/BoxcarsAI/boxcars/pull/152) ([dependabot[bot]](https://github.com/apps/dependabot))
14
+ - \[infra\] Bump webmock from 3.22.0 to 3.23.0 [\#150](https://github.com/BoxcarsAI/boxcars/pull/150) ([dependabot[bot]](https://github.com/apps/dependabot))
15
+ - \[infra\] Bump webmock from 3.20.0 to 3.22.0 [\#148](https://github.com/BoxcarsAI/boxcars/pull/148) ([dependabot[bot]](https://github.com/apps/dependabot))
16
+ - \[infra\] Bump dotenv from 2.8.1 to 3.0.2 [\#146](https://github.com/BoxcarsAI/boxcars/pull/146) ([dependabot[bot]](https://github.com/apps/dependabot))
17
+ - \[infra\] Bump pg from 1.5.4 to 1.5.5 [\#144](https://github.com/BoxcarsAI/boxcars/pull/144) ([dependabot[bot]](https://github.com/apps/dependabot))
18
+ - \[infra\] Bump webmock from 3.19.1 to 3.20.0 [\#142](https://github.com/BoxcarsAI/boxcars/pull/142) ([dependabot[bot]](https://github.com/apps/dependabot))
19
+ - \[infra\] Bump nokogiri from 1.16.0 to 1.16.2 [\#141](https://github.com/BoxcarsAI/boxcars/pull/141) ([dependabot[bot]](https://github.com/apps/dependabot))
20
+ - \[infra\] Bump rspec from 3.12.0 to 3.13.0 [\#140](https://github.com/BoxcarsAI/boxcars/pull/140) ([dependabot[bot]](https://github.com/apps/dependabot))
21
+ - \[infra\] Bump sqlite3 from 1.7.1 to 1.7.2 [\#139](https://github.com/BoxcarsAI/boxcars/pull/139) ([dependabot[bot]](https://github.com/apps/dependabot))
22
+
23
+ ## [v0.4.9](https://github.com/BoxcarsAI/boxcars/tree/v0.4.9) (2024-01-25)
24
+
25
+ [Full Changelog](https://github.com/BoxcarsAI/boxcars/compare/v0.4.8...v0.4.9)
26
+
27
+ **Merged pull requests:**
28
+
29
+ - use newest models by default from Open AI [\#138](https://github.com/BoxcarsAI/boxcars/pull/138) ([francis](https://github.com/francis))
30
+ - \[infra\] Bump sqlite3 from 1.7.0 to 1.7.1 [\#137](https://github.com/BoxcarsAI/boxcars/pull/137) ([dependabot[bot]](https://github.com/apps/dependabot))
31
+ - \[infra\] Bump rubocop from 1.60.0 to 1.60.2 [\#136](https://github.com/BoxcarsAI/boxcars/pull/136) ([dependabot[bot]](https://github.com/apps/dependabot))
32
+ - \[infra\] Bump rubocop from 1.59.0 to 1.60.0 [\#133](https://github.com/BoxcarsAI/boxcars/pull/133) ([dependabot[bot]](https://github.com/apps/dependabot))
33
+
3
34
  ## [v0.4.8](https://github.com/BoxcarsAI/boxcars/tree/v0.4.8) (2024-01-08)
4
35
 
5
36
  [Full Changelog](https://github.com/BoxcarsAI/boxcars/compare/v0.4.7...v0.4.8)
data/Gemfile CHANGED
@@ -9,11 +9,11 @@ gem "debug", "~> 1.9"
9
9
 
10
10
  gem "dotenv", "~> 3.1"
11
11
 
12
- gem "rake", "~> 13.1"
12
+ gem "rake", "~> 13.2"
13
13
 
14
14
  gem "sqlite3", "~> 1.7"
15
15
 
16
- gem "async", "~>1.31.0"
16
+ gem "async", "~>1.32.1"
17
17
 
18
18
  gem "activerecord", "~> 7.0"
19
19
 
@@ -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.60"
35
+ gem "rubocop", "~> 1.64"
36
36
  gem "vcr", "~> 6.2.0"
37
- gem "webmock", "~> 3.23.0"
37
+ gem "webmock", "~> 3.23.1"
38
38
  gem "rubocop-rake", "~> 0.6.0"
39
- gem "rubocop-rspec", "~> 2.29"
39
+ gem "rubocop-rspec", "~> 2.30"
40
40
  end
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- boxcars (0.4.10)
4
+ boxcars (0.5.1)
5
5
  anthropic (~> 0.1)
6
6
  google_search_results (~> 2.2)
7
7
  gpt4all (~> 0.0.4)
8
8
  hnswlib (~> 0.8)
9
9
  nokogiri (~> 1.16)
10
10
  pgvector (~> 0.2)
11
- ruby-openai (>= 4.2, < 7.0)
11
+ ruby-openai (>= 4.2, < 8.0)
12
12
 
13
13
  GEM
14
14
  remote: https://rubygems.org/
@@ -25,11 +25,11 @@ GEM
25
25
  tzinfo (~> 2.0)
26
26
  addressable (2.8.6)
27
27
  public_suffix (>= 2.0.2, < 6.0)
28
- anthropic (0.1.0)
28
+ anthropic (0.2.0)
29
29
  faraday (>= 1)
30
30
  faraday-multipart (>= 1)
31
31
  ast (2.4.2)
32
- async (1.31.0)
32
+ async (1.32.1)
33
33
  console (~> 1.10)
34
34
  nio4r (~> 2.3)
35
35
  timers (~> 4.1)
@@ -48,21 +48,22 @@ GEM
48
48
  async
49
49
  async-pool (0.4.0)
50
50
  async (>= 1.25)
51
- bigdecimal (3.1.6)
51
+ bigdecimal (3.1.8)
52
52
  concurrent-ruby (1.2.2)
53
- console (1.17.4)
53
+ console (1.24.0)
54
54
  fiber-annotation
55
55
  fiber-local
56
+ json
56
57
  crack (1.0.0)
57
58
  bigdecimal
58
59
  rexml
59
- debug (1.9.1)
60
+ debug (1.9.2)
60
61
  irb (~> 1.10)
61
62
  reline (>= 0.3.8)
62
63
  diff-lcs (1.5.1)
63
64
  domain_name (0.5.20190701)
64
65
  unf (>= 0.0.5, < 1.0.0)
65
- dotenv (3.1.0)
66
+ dotenv (3.1.2)
66
67
  event_stream_parser (1.0.0)
67
68
  faraday (2.9.0)
68
69
  faraday-net_http (>= 2.0, < 3.2)
@@ -97,10 +98,10 @@ GEM
97
98
  domain_name (~> 0.5)
98
99
  i18n (1.14.1)
99
100
  concurrent-ruby (~> 1.0)
100
- io-console (0.7.1)
101
- irb (1.11.0)
102
- rdoc
103
- reline (>= 0.3.8)
101
+ io-console (0.7.2)
102
+ irb (1.13.1)
103
+ rdoc (>= 4.0.0)
104
+ reline (>= 0.4.2)
104
105
  json (2.7.2)
105
106
  language_server-protocol (3.17.0.3)
106
107
  mime-types (3.4.1)
@@ -108,21 +109,21 @@ GEM
108
109
  mime-types-data (3.2023.0218.1)
109
110
  minitest (5.20.0)
110
111
  multi_json (1.15.0)
111
- multipart-post (2.3.0)
112
+ multipart-post (2.4.1)
112
113
  net-http (0.4.1)
113
114
  uri
114
115
  netrc (0.11.0)
115
- nio4r (2.5.9)
116
- nokogiri (1.16.2-arm64-darwin)
116
+ nio4r (2.7.1)
117
+ nokogiri (1.16.5-arm64-darwin)
117
118
  racc (~> 1.4)
118
- nokogiri (1.16.2-x86_64-linux)
119
+ nokogiri (1.16.5-x86_64-linux)
119
120
  racc (~> 1.4)
120
121
  octokit (4.25.1)
121
122
  faraday (>= 1, < 3)
122
123
  sawyer (~> 0.9)
123
124
  os (1.1.4)
124
125
  parallel (1.24.0)
125
- parser (3.3.0.5)
126
+ parser (3.3.2.0)
126
127
  ast (~> 2.4.1)
127
128
  racc
128
129
  pg (1.5.6)
@@ -136,21 +137,22 @@ GEM
136
137
  protocol-http (~> 0.18)
137
138
  psych (5.1.2)
138
139
  stringio
139
- public_suffix (5.0.4)
140
- racc (1.7.3)
140
+ public_suffix (5.0.5)
141
+ racc (1.8.0)
141
142
  rainbow (3.1.1)
142
- rake (13.1.0)
143
+ rake (13.2.1)
143
144
  rdoc (6.6.3.1)
144
145
  psych (>= 4.0.0)
145
- regexp_parser (2.9.0)
146
- reline (0.4.1)
146
+ regexp_parser (2.9.2)
147
+ reline (0.5.6)
147
148
  io-console (~> 0.5)
148
149
  rest-client (2.1.0)
149
150
  http-accept (>= 1.7.0, < 2.0)
150
151
  http-cookie (>= 1.0.2, < 2.0)
151
152
  mime-types (>= 1.16, < 4.0)
152
153
  netrc (~> 0.8)
153
- rexml (3.2.6)
154
+ rexml (3.2.8)
155
+ strscan (>= 3.0.9)
154
156
  rspec (3.13.0)
155
157
  rspec-core (~> 3.13.0)
156
158
  rspec-expectations (~> 3.13.0)
@@ -164,7 +166,7 @@ GEM
164
166
  diff-lcs (>= 1.2.0, < 2.0)
165
167
  rspec-support (~> 3.13.0)
166
168
  rspec-support (3.13.1)
167
- rubocop (1.60.2)
169
+ rubocop (1.64.1)
168
170
  json (~> 2.3)
169
171
  language_server-protocol (>= 3.17.0)
170
172
  parallel (~> 1.10)
@@ -172,25 +174,25 @@ GEM
172
174
  rainbow (>= 2.2.2, < 4.0)
173
175
  regexp_parser (>= 1.8, < 3.0)
174
176
  rexml (>= 3.2.5, < 4.0)
175
- rubocop-ast (>= 1.30.0, < 2.0)
177
+ rubocop-ast (>= 1.31.1, < 2.0)
176
178
  ruby-progressbar (~> 1.7)
177
179
  unicode-display_width (>= 2.4.0, < 3.0)
178
- rubocop-ast (1.31.2)
179
- parser (>= 3.3.0.4)
180
+ rubocop-ast (1.31.3)
181
+ parser (>= 3.3.1.0)
180
182
  rubocop-capybara (2.20.0)
181
183
  rubocop (~> 1.41)
182
184
  rubocop-factory_bot (2.25.1)
183
185
  rubocop (~> 1.41)
184
186
  rubocop-rake (0.6.0)
185
187
  rubocop (~> 1.0)
186
- rubocop-rspec (2.29.1)
188
+ rubocop-rspec (2.30.0)
187
189
  rubocop (~> 1.40)
188
190
  rubocop-capybara (~> 2.17)
189
191
  rubocop-factory_bot (~> 2.22)
190
192
  rubocop-rspec_rails (~> 2.28)
191
- rubocop-rspec_rails (2.28.2)
193
+ rubocop-rspec_rails (2.28.3)
192
194
  rubocop (~> 1.40)
193
- ruby-openai (6.3.1)
195
+ ruby-openai (7.0.1)
194
196
  event_stream_parser (>= 0.3.0, < 2.0.0)
195
197
  faraday (>= 1)
196
198
  faraday-multipart (>= 1)
@@ -202,6 +204,7 @@ GEM
202
204
  sqlite3 (1.7.2-x86_64-linux)
203
205
  stringio (3.1.0)
204
206
  strings-ansi (0.2.0)
207
+ strscan (3.1.0)
205
208
  timers (4.3.5)
206
209
  traces (0.11.1)
207
210
  tty-cursor (0.7.1)
@@ -219,7 +222,7 @@ GEM
219
222
  unicode-display_width (2.5.0)
220
223
  uri (0.13.0)
221
224
  vcr (6.2.0)
222
- webmock (3.23.0)
225
+ webmock (3.23.1)
223
226
  addressable (>= 2.8.0)
224
227
  crack (>= 0.3.2)
225
228
  hashdiff (>= 0.4.0, < 2.0.0)
@@ -232,7 +235,7 @@ PLATFORMS
232
235
  DEPENDENCIES
233
236
  activerecord (~> 7.0)
234
237
  activesupport (~> 7.0)
235
- async (~> 1.31.0)
238
+ async (~> 1.32.1)
236
239
  boxcars!
237
240
  debug (~> 1.9)
238
241
  dotenv (~> 3.1)
@@ -241,15 +244,15 @@ DEPENDENCIES
241
244
  hnswlib (~> 0.9.0)
242
245
  pg (~> 1.5)
243
246
  pgvector (~> 0.2.2)
244
- rake (~> 13.1)
247
+ rake (~> 13.2)
245
248
  rest-client (~> 2.1)
246
249
  rspec (~> 3.13)
247
- rubocop (~> 1.60)
250
+ rubocop (~> 1.64)
248
251
  rubocop-rake (~> 0.6.0)
249
- rubocop-rspec (~> 2.29)
252
+ rubocop-rspec (~> 2.30)
250
253
  sqlite3 (~> 1.7)
251
254
  vcr (~> 6.2.0)
252
- webmock (~> 3.23.0)
255
+ webmock (~> 3.23.1)
253
256
 
254
257
  BUNDLED WITH
255
258
  2.4.16
data/boxcars.gemspec CHANGED
@@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
37
37
  spec.add_dependency "hnswlib", "~> 0.8"
38
38
  spec.add_dependency "nokogiri", "~> 1.16"
39
39
  spec.add_dependency "pgvector", "~> 0.2"
40
- spec.add_dependency "ruby-openai", ">= 4.2", "< 7.0"
40
+ spec.add_dependency "ruby-openai", ">= 4.2", "< 8.0"
41
41
 
42
42
  # For more information and examples about making a new gem, checkout our
43
43
  # guide at: https://bundler.io/guides/creating_gem.html
@@ -99,10 +99,10 @@ module Boxcars
99
99
 
100
100
  # check for dangerous code that is outside of ActiveRecord
101
101
  def safe_to_run?(code)
102
- bad_words = %w[commit drop_constraint drop_constraint! drop_extension drop_extension! drop_foreign_key drop_foreign_key! \
103
- drop_index drop_index! drop_join_table drop_join_table! drop_materialized_view drop_materialized_view! \
104
- drop_partition drop_partition! drop_schema drop_schema! drop_table drop_table! drop_trigger drop_trigger! \
105
- drop_view drop_view! eval instance_eval send system execute reset revoke rollback truncate \
102
+ bad_words = %w[commit drop_constraint drop_constraint! drop_extension drop_extension! drop_foreign_key drop_foreign_key!
103
+ drop_index drop_index! drop_join_table drop_join_table! drop_materialized_view drop_materialized_view!
104
+ drop_partition drop_partition! drop_schema drop_schema! drop_table drop_table! drop_trigger drop_trigger!
105
+ drop_view drop_view! eval instance_eval send system execute reset revoke rollback truncate
106
106
  encrypted_password].freeze
107
107
  without_strings = code.gsub(/('([^'\\]*(\\.[^'\\]*)*)'|"([^"\\]*(\\.[^"\\]*)*"))/, 'XX')
108
108
 
@@ -13,7 +13,7 @@ module Boxcars
13
13
  kwargs[:description] ||= CALCDESC
14
14
  kwargs[:parameters] ||= default_params
15
15
 
16
- super(**kwargs)
16
+ super
17
17
  end
18
18
 
19
19
  def default_params
@@ -11,7 +11,7 @@ module Boxcars
11
11
  # :name, :description, :prompt, :top_k, :stop, and :engine
12
12
  def initialize(connection: nil, tables: nil, except_tables: nil, **kwargs)
13
13
  connection ||= ::ActiveRecord::Base.connection
14
- super(connection: connection, tables: tables, except_tables: except_tables, **kwargs)
14
+ super
15
15
  end
16
16
 
17
17
  private
@@ -10,7 +10,7 @@ module Boxcars
10
10
  # @param kwargs [Hash] Any other keyword arguments to pass to the parent class. This can include
11
11
  # :name, :description, :prompt, :top_k, :stop, and :engine
12
12
  def initialize(connection: nil, tables: nil, except_tables: nil, **kwargs)
13
- super(connection: connection, tables: tables, except_tables: except_tables, **kwargs)
13
+ super
14
14
  end
15
15
 
16
16
  private
@@ -10,7 +10,7 @@ module Boxcars
10
10
  # @param name [String] The name of the boxcar. Defaults to classname.
11
11
  # @param description [String] A description of the boxcar. Defaults to SERPDESC.
12
12
  def initialize(name: "FetchURL", description: DESC)
13
- super(name: name, description: description)
13
+ super
14
14
  end
15
15
 
16
16
  # Get text from a url.
@@ -13,7 +13,7 @@ module Boxcars
13
13
  # @param description [String] A description of the boxcar. Defaults to SERPDESC.
14
14
  # @param serpapi_api_key [String] The API key to use for the SerpAPI. Defaults to Boxcars.configuration.serpapi_api_key.
15
15
  def initialize(name: "Wikipedia", description: WDESC)
16
- super(name: name, description: description)
16
+ super
17
17
  end
18
18
 
19
19
  # Get an answer from Google using the SerpAPI.
@@ -59,12 +59,11 @@ module Boxcars
59
59
  end
60
60
 
61
61
  def load_data_files(training_data_path)
62
- data = []
63
62
  files = Dir.glob(training_data_path)
64
63
  raise_error "No files found at #{training_data_path}" if files.empty?
65
64
 
66
- files.each do |file|
67
- data << File.read(file)
65
+ data = files.map do |file|
66
+ File.read(file)
68
67
  end
69
68
  puts "Added #{files.length} files to data. Splitting text into chunks..."
70
69
  data
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Boxcars
4
4
  # The current version of the gem.
5
- VERSION = "0.4.10"
5
+ VERSION = "0.5.1"
6
6
  end
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.4.10
4
+ version: 0.5.1
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-04-19 00:00:00.000000000 Z
12
+ date: 2024-06-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: anthropic
@@ -104,7 +104,7 @@ dependencies:
104
104
  version: '4.2'
105
105
  - - "<"
106
106
  - !ruby/object:Gem::Version
107
- version: '7.0'
107
+ version: '8.0'
108
108
  type: :runtime
109
109
  prerelease: false
110
110
  version_requirements: !ruby/object:Gem::Requirement
@@ -114,7 +114,7 @@ dependencies:
114
114
  version: '4.2'
115
115
  - - "<"
116
116
  - !ruby/object:Gem::Version
117
- version: '7.0'
117
+ version: '8.0'
118
118
  description: You simply set an OpenAI key, give a number of Boxcars to a Train, and
119
119
  magic ensues when you run it.
120
120
  email: