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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/foobara/llm_backed_command.rb +2 -2
- data/src/llm_backed_execute_method.rb +11 -11
- metadata +7 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: db414e87fff804a75d681c2ab455fbb8c451de1ef45e1b9372057700fbf6f2a0
|
|
4
|
+
data.tar.gz: 5ea0d6368f246450905e30625f69341cce3512312a0ed707dbc463e16160a36b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6a81124c1e05859be811881e0ec32a850bb42f8d1e314af3e11fdac4c9c803472f2428f1b5345da58447fc00641c09ceaf1de2bf41ab64677bdd141b2519770b
|
|
7
|
+
data.tar.gz: e84c195fade06f93fb2a86d472af0a6c2b68a57f529cd96e9bcec35705d649a5bd0100c5201ebf71954d7d13cdfb703a46fb529a2330a7799038d574d3526ef4
|
data/CHANGELOG.md
CHANGED
|
@@ -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
|
-
# :
|
|
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
|
-
# :
|
|
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
|
-
# :
|
|
84
|
+
# simplecov:disable
|
|
85
85
|
raise "Unknown depth: #{depth}"
|
|
86
|
-
# :
|
|
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.
|
|
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
|
-
# :
|
|
169
|
+
# simplecov:disable
|
|
170
170
|
raise
|
|
171
|
-
# :
|
|
171
|
+
# simplecov:enable
|
|
172
172
|
end
|
|
173
173
|
rescue JSON::ParserError => e
|
|
174
174
|
# TODO: figure out how to test this code path
|
|
175
|
-
# :
|
|
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
|
-
# :
|
|
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
|
-
# :
|
|
200
|
+
# simplecov:disable
|
|
201
201
|
parsed_answer
|
|
202
|
-
# :
|
|
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
|
-
# :
|
|
265
|
+
# simplecov:disable
|
|
266
266
|
@llm_instructions_cache[key]
|
|
267
|
-
# :
|
|
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.
|
|
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.
|
|
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.
|
|
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:
|
|
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
|