boxcars 0.3.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d42ec321ce559b15e1b9da6b7d0338f13ce1faca17a5c70dfc1b516eb51062f9
4
- data.tar.gz: 2b8841ca63703ef49426bf004207e808267bc7a692a33188f45d34bdf02c54ea
3
+ metadata.gz: f1a16f4a38b33df747173cfabb27c183b95eccdcf35b4b8167db16fec1ecc913
4
+ data.tar.gz: cdbc64c7a8d71c9bd2812a07ed022f25c08f2bd68e34d2a3bc8686dafde486d0
5
5
  SHA512:
6
- metadata.gz: e793cc40fd92d2ea1e249f3f613b4a4bd51954a794c02a201e171d6f38a84da95d851464feab60e11729813c80b90bf8091dfb4750fa4be0084439b94ee8d9a2
7
- data.tar.gz: 147e84f7839647fe86ac26d3ed0c9be34a450540dc29d43bd86b6b2fac944718fecb6ba0be324048dd836999ae8f1f0ad83e6f1d50e5975f8510905b35ded432
6
+ metadata.gz: ba80d07797ef09b43012048e52cb7181a707595f848b9a1b3f62890442e0355f190219301467bb51aecb9b6581d81908e8d1995b2b707ded618287bb50f10db6
7
+ data.tar.gz: 41c28b0fdca5dfb4da99c19963cd014bcdd1f3a582c0efdd0446f612bfdafae4c6a22303c0bcff4e5c1da02fae355a782651000802c90f20ca2c66b53d07b683
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- boxcars (0.3.4)
4
+ boxcars (0.3.5)
5
5
  google_search_results (~> 2.2)
6
6
  gpt4all (~> 0.0.4)
7
7
  hnswlib (~> 0.8)
@@ -165,7 +165,7 @@ module Boxcars
165
165
  begin
166
166
  output = call(inputs: inputs)
167
167
  rescue StandardError => e
168
- Boxcars.error "Error in #{name} boxcar#call: #{e}", :red
168
+ Boxcars.error "Error in #{name} boxcar#call: #{e}\nbt:#{caller[0..5].join("\n ")}", :red
169
169
  raise e
170
170
  end
171
171
  validate_outputs(outputs: output.keys)
@@ -114,7 +114,7 @@ module Boxcars
114
114
 
115
115
  # special format that replaces lone percent signs with double percent signs
116
116
  def cformat(*args)
117
- args[0].gsub!(/%(?!<)/, '%%') if args.length > 1
117
+ args[0] = args[0].dup.gsub(/%(?!<)/, '%%') if args.length > 1
118
118
  format(*args)
119
119
  end
120
120
  end
@@ -59,7 +59,7 @@ module Boxcars
59
59
  prompt = prompt.first if prompt.is_a?(Array)
60
60
  params = prompt.as_messages(inputs).merge(params)
61
61
  if Boxcars.configuration.log_prompts
62
- Boxcars.debug(params[:messages].map { |p| ">>>>>> Role: #{p[:role]} <<<<<<\n#{p[:content]}" }.join("\n"), :cyan)
62
+ Boxcars.debug(params[:messages].last(2).map { |p| ">>>>>> Role: #{p[:role]} <<<<<<\n#{p[:content]}" }.join("\n"), :cyan)
63
63
  end
64
64
  clnt.chat(parameters: params)
65
65
  else
data/lib/boxcars/train.rb CHANGED
@@ -214,7 +214,7 @@ module Boxcars
214
214
  rescue Boxcars::ConfigurationError, Boxcars::SecurityError => e
215
215
  raise e
216
216
  rescue StandardError => e
217
- Boxcars.error "Error in #{boxcar.name} boxcar#call: #{e}\nbt:#{caller[0..5].join("\n ")}", :red
217
+ Boxcars.error "Error in #{boxcar.name} train#call: #{e}\nbt:#{caller[0..5].join("\n ")}", :red
218
218
  observation = Observation.err("Error - #{e}, correct and try again.")
219
219
  end
220
220
  elsif output.boxcar == :error
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Boxcars
4
4
  # The current version of the gem.
5
- VERSION = "0.3.4"
5
+ VERSION = "0.3.5"
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.3.4
4
+ version: 0.3.5
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: 2023-07-11 00:00:00.000000000 Z
12
+ date: 2023-07-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: google_search_results