foobara-llm-backed-command 1.0.2 → 1.0.3

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: cf89dfdfd181a03c728a1e4776440dca2f5421ed0f488d2e3fc3a7630b497c64
4
- data.tar.gz: 60ae5ea17c418ffc323eeed3b6642e86e408a5c4b810e3471ef6a2bdf71ad9a7
3
+ metadata.gz: db414e87fff804a75d681c2ab455fbb8c451de1ef45e1b9372057700fbf6f2a0
4
+ data.tar.gz: 5ea0d6368f246450905e30625f69341cce3512312a0ed707dbc463e16160a36b
5
5
  SHA512:
6
- metadata.gz: cb2ba5b9634a0f5c7740d338e9f588f67d4bd214f5e101f0373cb91a0f2cf587707eee5b80beafcae0a5ea8c0c311b37138dc58c78279358609e50ffbb7d026f
7
- data.tar.gz: 97a025adf7c31a0cebce7c65427811fcd628634b948f7e2654112eaad8b8cfa3d3fb6992595ced1fcf5ca98f7531ce5a018ae97d1af05e4a1d8cc638ac64b61d
6
+ metadata.gz: 6a81124c1e05859be811881e0ec32a850bb42f8d1e314af3e11fdac4c9c803472f2428f1b5345da58447fc00641c09ceaf1de2bf41ab64677bdd141b2519770b
7
+ data.tar.gz: e84c195fade06f93fb2a86d472af0a6c2b68a57f529cd96e9bcec35705d649a5bd0100c5201ebf71954d7d13cdfb703a46fb529a2330a7799038d574d3526ef4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [1.0.3] - 2026-09-11
2
+
3
+ - Handle removed JSON.fast_generate
4
+
1
5
  ## [1.0.2] - 2025-08-11
2
6
 
3
7
  - Handle situation where smaller models incorrectly use {"result":"whatever"} instead of "whatever"
@@ -5,10 +5,10 @@ require "foobara/ai"
5
5
  require "foobara/json_schema_generator"
6
6
 
7
7
  if Foobara::Ai.foobara_all_command.empty?
8
- # :nocov:
8
+ # simplecov:disable
9
9
  raise "No api services loaded. " \
10
10
  "Did you forget to set a URL/API key env var or a require for either ollama, anthropic, or openai?"
11
- # :nocov:
11
+ # simplecov:enable
12
12
  end
13
13
 
14
14
  Foobara::Util.require_directory "#{__dir__}/../../src"
@@ -81,9 +81,9 @@ module Foobara
81
81
  when Foobara::AssociationDepth::PRIMARY_KEY_ONLY
82
82
  Foobara::CommandConnectors::Serializers::EntitiesToPrimaryKeysSerializer
83
83
  else
84
- # :nocov:
84
+ # simplecov:disable
85
85
  raise "Unknown depth: #{depth}"
86
- # :nocov:
86
+ # simplecov:enable
87
87
  end.instance
88
88
  end
89
89
 
@@ -120,7 +120,7 @@ module Foobara
120
120
  end
121
121
 
122
122
  content = serializer.serialize(content)
123
- message.merge(content: JSON.fast_generate(content))
123
+ message.merge(content: JSON.generate(content))
124
124
  end
125
125
  end
126
126
  end
@@ -166,18 +166,18 @@ module Foobara
166
166
  fencepostless_answer = match[1]
167
167
  JSON.parse(fencepostless_answer)
168
168
  else
169
- # :nocov:
169
+ # simplecov:disable
170
170
  raise
171
- # :nocov:
171
+ # simplecov:enable
172
172
  end
173
173
  rescue JSON::ParserError => e
174
174
  # TODO: figure out how to test this code path
175
- # :nocov:
175
+ # simplecov:disable
176
176
  add_runtime_error :could_not_parse_result_json,
177
177
  "Could not parse result JSON: #{e.message}",
178
178
  raw_answer: answer,
179
179
  stripped_answer: fencepostless_answer
180
- # :nocov:
180
+ # simplecov:enable
181
181
  end
182
182
  end
183
183
  end
@@ -197,9 +197,9 @@ module Foobara
197
197
  if result_type.process_value(result).success?
198
198
  result
199
199
  else
200
- # :nocov:
200
+ # simplecov:disable
201
201
  parsed_answer
202
- # :nocov:
202
+ # simplecov:enable
203
203
  end
204
204
  end
205
205
  else
@@ -262,9 +262,9 @@ module Foobara
262
262
  @llm_instructions_cache ||= {}
263
263
 
264
264
  if @llm_instructions_cache.key?(key)
265
- # :nocov:
265
+ # simplecov:disable
266
266
  @llm_instructions_cache[key]
267
- # :nocov:
267
+ # simplecov:enable
268
268
  else
269
269
  @llm_instructions_cache[key] = build_llm_instructions(user_association_depth, assistant_association_depth)
270
270
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara-llm-backed-command
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
@@ -15,7 +15,7 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: 0.0.136
18
+ version: 0.1.1
19
19
  - - "<"
20
20
  - !ruby/object:Gem::Version
21
21
  version: 2.0.0
@@ -25,7 +25,7 @@ dependencies:
25
25
  requirements:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
- version: 0.0.136
28
+ version: 0.1.1
29
29
  - - "<"
30
30
  - !ruby/object:Gem::Version
31
31
  version: 2.0.0
@@ -98,13 +98,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
98
98
  - - ">="
99
99
  - !ruby/object:Gem::Version
100
100
  version: 3.4.0
101
+ - - "<"
102
+ - !ruby/object:Gem::Version
103
+ version: '4.1'
101
104
  required_rubygems_version: !ruby/object:Gem::Requirement
102
105
  requirements:
103
106
  - - ">="
104
107
  - !ruby/object:Gem::Version
105
108
  version: '0'
106
109
  requirements: []
107
- rubygems_version: 3.6.9
110
+ rubygems_version: 4.0.16
108
111
  specification_version: 4
109
112
  summary: Provides an easy way to implement a command whose logic is managed by an
110
113
  LLM