boxcars 0.6.1 → 0.6.2

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: 71b72b7d30bda72b5dd0b3150773a233eac72e15ab3efa66d7643d5278770793
4
- data.tar.gz: '080addca8e8c89f982db5ae91d9f12e67db15fb37f58d4787857b209848c1006'
3
+ metadata.gz: dda5f801d5c9725c2b73f4cc0d69667f243c90684c7a55d45ef91cd0440378cb
4
+ data.tar.gz: 3d486a0fbc40e4e393a7dd1a646e4c896df842a548c77ab23cb81ec7f6a669b9
5
5
  SHA512:
6
- metadata.gz: 330aa8094b7069084a7e06c7d656b30bd1935f1e12cfefded4788f23d92c62dbbbb92458328e37b95cbf5e446afd73b9170916329f409490e532ae329ac20a79
7
- data.tar.gz: 1730d2356b2ddae5e19ee6d0ec0b4b6150eb9a9efb2305863b8e946ccd0184124a3ab22ef6fa37c4cfdacebed7a8fbf520f2d18243f9d05de7f547764d3625ef
6
+ metadata.gz: f462c9cee5a487fe7f896a0265edcf210cf920633dce4199312557cf5cae2671974c5daf26f70555bb188da377ebc44cef1b3503f2bc56a19f08df151371744a
7
+ data.tar.gz: e0997b7e0c21d92299fba883781090d25d93566ec8eb4b23b86acdc0d132256e6ece8bc0286b31dec9656d10d9da028d60247b5fa668d506adf5011a961f4a24
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.2.2
1
+ 3.3.3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## [v0.6.1](https://github.com/BoxcarsAI/boxcars/tree/v0.6.1) (2024-07-19)
4
+
5
+ [Full Changelog](https://github.com/BoxcarsAI/boxcars/compare/v0.5.1...v0.6.1)
6
+
7
+ **Merged pull requests:**
8
+
9
+ - various updates with Claude 3.5 support [\#197](https://github.com/BoxcarsAI/boxcars/pull/197) ([francis](https://github.com/francis))
10
+ - \[infra\] Bump rubocop-rspec from 2.30.0 to 3.0.2 [\#195](https://github.com/BoxcarsAI/boxcars/pull/195) ([dependabot[bot]](https://github.com/apps/dependabot))
11
+ - \[infra\] Bump nokogiri from 1.16.5 to 1.16.6 [\#194](https://github.com/BoxcarsAI/boxcars/pull/194) ([dependabot[bot]](https://github.com/apps/dependabot))
12
+ - \[infra\] Bump ruby-openai from 7.0.1 to 7.1.0 [\#193](https://github.com/BoxcarsAI/boxcars/pull/193) ([dependabot[bot]](https://github.com/apps/dependabot))
13
+
3
14
  ## [v0.5.1](https://github.com/BoxcarsAI/boxcars/tree/v0.5.1) (2024-06-14)
4
15
 
5
16
  [Full Changelog](https://github.com/BoxcarsAI/boxcars/compare/v0.4.10...v0.5.1)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- boxcars (0.6.1)
4
+ boxcars (0.6.2)
5
5
  anthropic (~> 0.1)
6
6
  google_search_results (~> 2.2)
7
7
  gpt4all (~> 0.0.4)
@@ -5,20 +5,21 @@ module Boxcars
5
5
  # For Boxcars that use an engine to do their work.
6
6
  class JSONEngineBoxcar < EngineBoxcar
7
7
  # A JSON Engine Boxcar is a container for a single tool to run.
8
- attr_accessor :wanted_data, :data_description, :important
8
+ attr_accessor :wanted_data, :data_description, :important, :symbolize
9
9
 
10
10
  # @param prompt [Boxcars::Prompt] The prompt to use for this boxcar with sane defaults.
11
11
  # @param wanted_data [String] The data to extract from.
12
12
  # @param data_description [String] The description of the data.
13
13
  # @param important [String] Any important instructions you want to give the LLM.
14
+ # @param symbolize [Boolean] Symbolize the JSON results if true
14
15
  # @param kwargs [Hash] Additional arguments
15
- def initialize(prompt: nil, wanted_data: nil, data_description: nil, important: nil, **kwargs)
16
+ def initialize(prompt: nil, wanted_data: nil, data_description: nil, important: nil, symbolize: false, **kwargs)
16
17
  @wanted_data = wanted_data || "summarize the pertinent facts from the input data"
17
18
  @data_description = data_description || "the input data"
18
19
  @important = important
19
20
  the_prompt = prompt || default_prompt
20
- the_prompt.append("\n\nImportant: #{important}\n") if important.present?
21
21
  kwargs[:description] ||= "JSON Engine Boxcar"
22
+ @symbolize = symbolize
22
23
  super(prompt: the_prompt, **kwargs)
23
24
  end
24
25
 
@@ -34,6 +35,8 @@ module Boxcars
34
35
  %<wanted_data>s
35
36
  }
36
37
  SYSPR
38
+ stock_prompt += "\n\nImportant:\n#{important}\n" if important.present?
39
+
37
40
  sprompt = format(stock_prompt, wanted_data: wanted_data, data_description: data_description)
38
41
  ctemplate = [
39
42
  Boxcar.syst(sprompt),
@@ -50,7 +53,7 @@ module Boxcars
50
53
  # sometimes the LLM adds text in front of the JSON output, so let's strip it here
51
54
  json_start = engine_output.index("{")
52
55
  json_end = engine_output.rindex("}")
53
- extract_answer(JSON.parse(engine_output[json_start..json_end]))
56
+ extract_answer(JSON.parse(engine_output[json_start..json_end], symbolize_names: symbolize))
54
57
  rescue StandardError => e
55
58
  Result.from_error("Error: #{e.message}:\n#{engine_output}")
56
59
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Boxcars
4
4
  # The current version of the gem.
5
- VERSION = "0.6.1"
5
+ VERSION = "0.6.2"
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.6.1
4
+ version: 0.6.2
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-07-19 00:00:00.000000000 Z
12
+ date: 2024-07-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: anthropic